The HTML5 Video Element
The `<video>` tag is the simplest path for browser video. Point its `src` attribute at a direct MP4 URL and the browser fetches and plays it using HTTP Range Requests. The browser manages buffering automatically. This works perfectly for straightforward progressive MP4 streaming. The limitation: it can't handle adaptive bitrate formats like HLS without extra help.
Media Source Extensions (MSE)
MSE is a browser API that lets JavaScript feed video data into a virtual buffer, which the `<video>` element reads from. This is what powers HLS and DASH playback on Chrome and Firefox. Libraries like hls.js download .ts or .fmp4 video segments, push them into an MSE `SourceBuffer`, and control exactly which quality level the player uses based on current network speed. Without MSE, adaptive streaming would be impossible in the browser.
How FluxPlays Uses These APIs
FluxPlays detects the URL type you paste. For a direct .mp4 or .webm, it uses a plain `<video src>` approach with a custom UI overlay. For .m3u8 HLS streams, it initializes hls.js which uses MSE. This means the same input box handles both simple file playback and complex adaptive streaming manifests, automatically choosing the right decoding path.