Search code examples
reactjsgoogle-chromestreaminghttp-live-streamingshaka

Shaka player cannot load HLS on google chrome


I'm trying to load a VOD on shaka player. this is my Url:

https://5b48f8f32d3be.streamlock.net/023a27950bd44774/mp4:22436e792e8b42de_HD.0.mp4/playlist.m3u8


I keep getting 4032 error in the console and I've searched a little bit about it. In the shaka document, the 4032 error has mentioned as CONTENT_UNSUPPORTED_BY_BROWSER. But when I'm testing my URL on the shaka player test URL everything is working fine.

https://shaka-player-demo.appspot.com/demo/#asset=https://storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd;lang=en-US;build=uncompiled

if my browser was the problem, it shouldn't play on the test URL too. What should I have to do to shaka support HLS?


Solution

  • Much of the HLS content out there has MPEG2-TS streams, which many browsers don't support. To work around this issue, Shaka Player supports transmuxing TS to MP4 so the browser can play it. This is done using the mux.js library. This library needs to be loaded in a separate script tag before Shaka Player is loaded. For example, here is how the Shaka Player demo does it.