shaka-project / shaka-player

JavaScript player library / DASH & HLS client / MSE-EME player
Apache License 2.0
7.1k stars 1.33k forks source link

Failed to execute 'addSourceBuffer' on 'MediaSource': The type provided ('video/mp2t; codecs="avc1.42E01E,mp4a.40.2"') #4864

Closed RyanSacks closed 1 year ago

RyanSacks commented 1 year ago

Have you read the FAQ and checked for duplicate open issues? Yes

What version of Shaka Player are you using? 4.3.2

Can you reproduce the issue with our latest release version? Yes

Can you reproduce the issue with the latest code from main? We're using 2 files from the cloudflare CDN.

Are you using the demo app or your own custom app? Our own custom app.

If custom app, can you reproduce the issue using our demo app? No, the stream works on the Demo, but not on our custom app and we're not sure why.

What browser and OS are you using? Chrome Version 108.0.5359.124 (Official Build) (x86_64) MacOS Mojave Version 10.14.6 (18G9323)

For embedded devices (smart TVs, etc.), what model and firmware version are you using? We're not using this.

What are the manifest and license server URIs?

For security reasons, available upon request via email, and since this is during a live streaming, we need to live stream to issue a new URI.

What configuration are you using? What is the output of player.getConfiguration()?

I'm not sure at the moment.

What did you do?

We added the HTML, CSS and Javascript from this page: https://shaka-player-demo.appspot.com/docs/api/tutorial-ui.html The player works with mp4 and Dash files, but not an HLS .m3u8 file for some strange reason, which is what we use, we use NGINX-RTMP and HLS.

What did you expect to happen? The player should play our video when we Broadcast LIVE using a tool like OBS to create Broadcast Live videos.

What actually happened?

The video doesn't play and we get this error in the console. Error code 9 object DOMException: Failed to execute 'addSourceBuffer' on 'MediaSource': The type provided ('video/mp2t; codecs="avc1.42E01E,mp4a.40.2"') is unsupported.

danlaquarium commented 1 year ago

We found that it required mux.js to unlock support for MPEG-TS when used by NGINX/RTMP

Link to the specs for Shaka Player mentioning MPEG-TS support required https://www.npmjs.com/package/shaka-player#:~:text=supported%20in%20HLS-,MPEG%2D2%20TS,find%20and%20parse%20timestamps%20to%20find%20segment%20start%20time%20in%20HLS,-WebVTT

Link to mux.js file https://github.com/videojs/mux.js/releases

joeyparrish commented 1 year ago

Yes, that's right. mux.js is required for TS content on most browsers/devices.

github-actions[bot] commented 1 year ago

Closing due to inactivity. If this is still an issue for you or if you have further questions, the OP can ask shaka-bot to reopen it by including @shaka-bot reopen in a comment.