Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How is this preferable to using the <video> tag?


If all you want to do is play a simple unencrypted video without ads, a <video> tag is indeed all you need. As soon as you start working with adaptive streaming (DASH/HLS), need ads, need a more advanced UI or need better metrics, you'll need some sort of base video player 'framework' to deal with those things. This provides that, similar to video-js, but in a more modern way.


Is that really true? Netflix uses html5 video to stream. The use case for a pure js player must be fairly small

edit: my bad, I thought the project in the OP didn't use html5 video at all, I see how that it is a wrapper around it.


It's impossible to play DRM video without heavy JS (except in Safari). Netflix probably uses a similar library to Shaka for their DASH streams.

HTML5 video is only really simple if you want to just play MP4's with H264 encodings. For everything else you're going to want a wrapper to deal with compatibility checks, smoothing out cross-browser bugs, deal with ads, set up DRM, ...


The <video> tag for instance doesn't support MPEG-DASH and HLS (outside of Edge and Safari). So if you want to do DRM or live streaming, that isn't supported. Thats why this project bundles shaka-player and hls.js


Two years ago when we checked out the DASH and HLS support in Edge it turned out to be so unreliable we still just went with Shaka instead.

Fun fact: besides FairPlay compatibility, HLS in Safari is way more annoying to deal with than HLS via hls.js in browsers that don't natively support it. Safari provides you way less information about what's happening stream/buffer wise, and if you work with HLS event streams you need a ton of hacks to make it behave correctly.


You can use DRM and html5 video, https://en.wikipedia.org/wiki/Encrypted_Media_Extensions

" This allows the use of HTML5 video to play back DRM-wrapped content such as streaming video services "


Yes, that is what is used with MPEG-DASH and HLS too. But none of the DRM systems implemented (beyond ClearKey) is used on just pure MP4 files. So while EME works in either case, nobody is doing it with the file formats natively supported. It's pretty much always in combination with https://developer.mozilla.org/en-US/docs/Web/API/Media_Sourc...


Video newbie question here. Is it just me or is the html5 video player is really slow? Does using a framework like this help with performance/buffering/streaming? Like skipping video is a common use-case where performance is really key..


html5 video out of the box doesn't consistently provide support for most sorts of adaptive bitrate streaming (HLS/Dash being the pre-eminent ones). Using a single bitrate mp4 has no way to adjust for performance and is usually going to be less than ideal.

Noting that most player still use the video tag under the hood, but a lot of functionality has been pushed to the Media Extensions layer for different formats of video.

Using HLS with HLS.js or Dash with Dash.js is the "Simple" way of adding adaptive bitrate support to HTML5 Video tag for better performance. After that its your video delivery pipeline.


> html5 video out of the box doesn't consistently provide support for most sorts of adaptive bitrate streaming (HLS/Dash being the pre-eminent ones)

Can you elaborate on this? I use <video> to debug HLS issues all the time. Is there something specific that straight-up video tag won't do?

If there are edge cases I'm sure I haven't seen them, because personally I'm only ever using HTML as basically a control group when reproducing bug reports from native video player stuff.


https://www.lambdatest.com/HTTP-Live-Streaming(HLS)

HLS Isn’t supported natively in a lot of browsers. Chrome doesn’t. It’s pretty easy to shim with Media Extensions so it’s fine to use but just sticking it as a src property in a lot of browsers it won’t work.

Personally I think that the Media Extensions API is going to be the primary mechanism for adding new codecs and transports moving forward as opposed to having the browsers need to implement all the options.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: