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

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.

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');
};

Related

Microsoft Teams Deep Linking failing for Video and Audio calls

I'm writing a react webapp that exposes AD-Online contacts and provides the ability to deep link chat, audio, and video calls in the Teams application. I have written the following function (based on the MS documentation) to provide the url for the deep link.
const teamsDeepLink = (user, type) =>
`https://teams.microsoft.com/l/${type === "chat" ? "chat" : "call"}/0/0?users=${user}${type === "video" ? "&withvideo=true" : ""}`;
The output of this looks something like this:
Chat
https://teams.microsoft.com/l/chat/0/0?users=<user's email>
Audio
https://teams.microsoft.com/l/call/0/0?users=<user's email>
Video
https://teams.microsoft.com/l/call/0/0?users=<user's email>&withvideo=true
This works ok for chat, but fails with a There is a problem with the link message for audio and video links. Has anyone got this working and how?
I have researched this as thoroughly as I can. I have found a related but different SO question relating to bots, but I'm a step further on from that -- I have the URL from the documentation but I'm getting an unexpected error.
When we tried to repro this at our end, it worked fine on Microsoft Teams desktop but faced an issue on the Teams web application (as you mentioned).
For that, we have raised a bug and the concerned team is looking into it. We will get back to you once we have an update.

Cloudflare Steam video not working in firefox

Hi I have implemented cloudflare stream video service in one of the website I am developing. The video used to play just fine but since the last 2 days it is broken in Firefox. It works fine in Chrome but won’t work in firefox.
The console gives throws up the error -
Specified “type” attribute of “application/x-mpegurl” is not supported. Load of media resource https://videodelivery.net/6aaee8579a7a98ccad84660514efe586/manifest/video.m3u8 failed. (https://www.checkbayt.com/home)
Specified “type” attribute of “application/dash+xml” is not supported. Load of media resource https://videodelivery.net/6aaee8579a7a98ccad84660514efe586/manifest/video.mpd failed.
My website is located at https://www.checkbayt.com/ in case anyone wants to try it out. I have also tried to rule out issues that might be caused due to some other code in the website and did a simple html page that only has the video and nothing else. Once again this used to work fine previously and I ran the same html file in firefox and it no longer works and gives the same error.
Is this something that anyone in here also experienced? I guess this is something to do with firefox and will get resolved from their end? Or do I need to do something different?
Try keeping the stream script after the video. Not really sure why but i faced the same issue and render the script directly after the stream helped.
Note: the element should be loaded before the script as the script injects html elements into the stream tags.

Chromecast sample sender application CastHelloText-chrome ends with error when trying to get session

I have problem with launching Google-Cast application similar to sample CastHelloText-chrome. I slightly modified example code for my specific purposes. The goal for creating this application is to send and show image data directly in Chromecast device.
Particularly the difference between official sample and my code is in message format and its content, sent by sender application. Sender application took png image coded by base64 and send through message bus with custom namespace. Receiver application get this message and use this as data source for html object <img>.
Error appears when I do this steps:
Reload sender page, checking console if any device found.
Send the form by just pushing enter on input box (text is ignored).
Now a popup from Chromecast extension shows. Next there are two scenarios:
3a) I confirm casting to device by choosing one from the list, then I get this error message in console:
onError: {"code":"channel_error","description":"Error: Timeout","details":null}
3b) I just click somewhere else, I get this error:
onError: {"code":"cancel","description":"User closed popup menu","details":null}
Both of errors are caused by calling function chrome.cast.requestSession in chromehellotext.html at line 161, but what's really wrong I don't know.
When I step sender script I realize that function sessionListener is never called. I know that something go wrong when code try to call chrome.cast.requestSession, where described error raises. So I need help if I missed about right way to use Google-Cast API or If this problem has something to do with networking issues.
Receiver application is registered on Google Cast SDK Developer Console and I'm testing on registered device with some serial number. I'm using Google Chrome in version 42.0.2300.2 canary (64-bit) and Chrome version 40.0.2214.111 (current stable I suppose). For testing I also tried to turn off Windows Firewall entirely but with no luck.
Edit:
There were some syntactic errors that caused error message described above.
It seems like you are trying to use the data/control channel to send an image; please don't do that; that channel is not meant to be used for large data communications; in fact it cannot send anything which approaches or exceeds 64k. If your goal is to send images from your local machine, you would need to run a local web server on your local machine and serve images through the web server.
For and easiest tutorial you can have a look to this tutorial.
It is well explained in this tutorial.
Chromecast Sender application
There is no need to maintain session by yourself.
just add button and enjoy casting
mCastManager.addMediaRouterButton(mediaRoutebtn);
I found a source of my problem. There was something wrong in receiver code - syntactic and runtime errors, so I must admit that my code wasn't functional. Now its working in terms of launching application and getting session.
Unfortunate thing is that the error message generated by Chromecast extension didn't match the actual error - at least it was a bit confusing when I didn't know what's really happening on receiver side without ability to debug the code.

Is MediaProtocolCommand.Listener onCompleted called when it fails to load a video?

I am on purpose sending a video with a format that is not supported to my receiver app. I see the following message on the chromcast console:
[ 8.188s] [cast.receiver.ChannelOverWebSocket] Sending message:
["ramp",{"cmd_id":1,"type":"RESPONSE","status":{"event_sequence":10,"error":{"domain":"ramp","code":-2}}}]
from ws://localhost:8008/session?20
How do I receive that on my android app? I know onComplete for the MediaProtocolCommand.Listener is called when the video plays fine. The description makes it sound like it would also be called when it doesn't play or am I reading that wrong?
I've also tried looking into the MediaProtocolCommand returned by mMessageStream.loadMedia on a separate thread in an infinite loop and it never gets its hasError set to true. So what am I missing?
Thanks.
It appears that the Cast Android SDK isn't parsing these error messages correctly. In the sample Android client, the following exception is thrown with an invalid video URL:
MediaProtocolMessageStream(9088): error parsing message:
{"type":"RESPONSE", "cmd_id":1,"status":{"error":{"domain":"ramp","code":-2},
"event_sequence":377}} org.json.JSONException: No value for state
This looks like a bug and should be reported to Google.

YouTube iframe API official example gives errors

As of 2013-04-16 WEST, the official getting started example of the YouTube iframe API results in error messages when run in Chrome 25 on WinXP/SP3:
I am accessing the example hosted on a web server, i.e. not via the local file system.
Am I doing something wrong? Is the example / the API broken? Can you reproduce the issue?
This error message has been around for quite a while -- as this Google Group post explains, it's due to an unresolved (4-year unresolved!) bug in WebKit:
https://groups.google.com/forum/?fromgroups=#!topic/youtube-api-gdata/VKGl4ahBGyk
It shouldn't affect anything -- it certainly hasn't for our projects, and in visiting the demo URL you posted, it looks like it isn't affecting the API functionality there (i.e. in that demo, the video still stops after 6 seconds per what the code states). There was an SO question a while back that thought it might be affecting analytics:
youtube "Unable to post message to..." causing video analytics to not be tracked
But it was never confirmed as being relevant.
It will be interesting to see if Chrome's move to the new Blink fork of WebKit leads to the bug itself being resolved.

Resources