Search code examples
chromecastgoogle-cast

Google cast receiver throwing "Uncaught NotSupportedError: Failed to execute 'addSourceBuffer' on 'MediaSource'


We have successfully launched with chromecast support on our app and it was perfectly working fine, from the past few days it suddenly stopped working(the receiver was alway sending the buffering status to sender and it was continuously buffering), i have used the chrome debugging and able to find this exception in console "Uncaught NotSupportedError: Failed to execute 'addSourceBuffer' on 'MediaSource': The type provided ('video/mp2t; codecs="mp4a.40.2,avc1.77.31"') is unsupported." in the media_player.js file (on the 80th line - according to chrome debugger). not able to understand why suddenly this error is thrown, all our customers started complaining that chromecast support is not working.

can you please guide me through the problem.

Note: I have used the custom receiver sample from google cast github and modified the styling.

we are using HLS for streaming videos: here is the sample m3u8 file content:

#EXTM3U
#EXT-X-VERSION:1
## Created with Unified Streaming Platform(version=1.6.9)
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=323376,CODECS="mp4a.40.2,avc1.77.31",RESOLUTION=1024x576
707eb5bd-dcdf-4f84-b1a3-7cdbd0d4af89-audio=131072-video_eng=174000.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=510996,CODECS="mp4a.40.2,avc1.77.31",RESOLUTION=1024x576
707eb5bd-dcdf-4f84-b1a3-7cdbd0d4af89-audio=131072-video_eng=351000.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=722996,CODECS="mp4a.40.2,avc1.77.31",RESOLUTION=1024x576
707eb5bd-dcdf-4f84-b1a3-7cdbd0d4af89-audio=131072-video_eng=551000.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1078096,CODECS="mp4a.40.2,avc1.77.31",RESOLUTION=1024x576
707eb5bd-dcdf-4f84-b1a3-7cdbd0d4af89-audio=131072-video_eng=886000.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1415176,CODECS="mp4a.40.2,avc1.77.31",RESOLUTION=1024x576
707eb5bd-dcdf-4f84-b1a3-7cdbd0d4af89-audio=131072-video_eng=1204000.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1743776,CODECS="mp4a.40.2,avc1.77.31",RESOLUTION=1024x576
707eb5bd-dcdf-4f84-b1a3-7cdbd0d4af89-audio=131072-video_eng=1514000.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2068136,CODECS="mp4a.40.2,avc1.77.31",RESOLUTION=1024x576
707eb5bd-dcdf-4f84-b1a3-7cdbd0d4af89-audio=131072-video_eng=1820000.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2498496,CODECS="mp4a.40.2,avc1.77.31",RESOLUTION=1024x576
707eb5bd-dcdf-4f84-b1a3-7cdbd0d4af89-audio=131072-video_eng=2226000.m3u8

I did saw answer to this post: Is avc1.66.31,mp4a.40.2 supported by the Chromecast device? but as we have different version of avc codec - avc1.77.31 don't know, what's the best way to get it working.

Note: I have posted the same question on G+ community, will update the answer there if i find a working solution here. thanks.


Solution

  • Try replacing your codec with avc1.77.30

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