Is avc1.66.31,mp4a.40.2 supported by the Chromecast device?

天大地大妈咪最大 提交于 2019-11-30 09:07:36

问题


I have an m3u8 file that looks like this:

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:BANDWIDTH=2048805,CODECS="avc1.66.31,mp4a.40.2",RESOLUTION=1280x720
chunklist_w517510829.m3u8

And I get the following error when trying to play it:

Uncaught NotSupportedError: Failed to execute 'addSourceBuffer' on 'MediaSource': The type provided ('video/mp2t; codecs="avc1.66.31,mp4a.40.2"') is unsupported.
player.js:1682 Uncaught TypeError: undefined is not a function

Strangely enough it plays fine on the Chromecast if I remove avc1.66.31,mp4a.40.2. I am using this sample as a player https://github.com/googlecast/Cast-Player-Sample

Thanks.


回答1:


Some builds of Chromecast reject "avc1.66.31" so it is recommendation to use "avc1.66.30" instead either by updating the playlist or using host.processManifest workaround

host.processManifest = function(manifest) {
  return manifest.replace(/CODECS=\"avc1.66.([0-9]*)/g, 'CODECS=\"avc1.66.30');
};

in a custom receiver.



来源:https://stackoverflow.com/questions/31256129/is-avc1-66-31-mp4a-40-2-supported-by-the-chromecast-device

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!