<video>
<source
id="el"
src="largeVideo.mov"
type="video/quicktime"
media="screen and (width >= 600px)" />
</video>HTMLSourceElement: media property / notebook
HTMLSourceElement: media property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
const el = document.getElementById("el");
console.log(el.media); // Output: "screen and (width >= 600px)"
el.media = "(width >= 800px)"; // Updates the media value