How to debug streams on Chromecast devices
Overview
Troubleshooting streams on Chromecast seems challenging. What if Chromecast just runs a browser playing a stream? Let’s see the steps needed to troubleshoot/debug VOD and Live streams on Chromecast.
Requirements
Please take note of the Sender/Receiver definition, which will be used along with this tutorial.
-
Player Sender - Bitmovin Player set up on a platform that supports casting to a Chromecast Device. Please see: https://bitmovin.com/demos/chromecast. Cast to a Cast Application Framework (CAF) compatible receiver.
-
Player Receiver -The Chromecast receiver application is deployed on the Google Cast SDK Developer Console. Link to the CAF receiver example: bitmovin/bitmovin-player-caf-receiver
Known Limitations
This troubleshooting tutorial is for applications using the Cast Application Framework (CAF) compatible receiver.
Step 1 - Supported Media
There are several issues that can affect a playback while it’s being handled by Chromecast, such as stream, player or application issues. Prior to analyzing these components, it’s important to verify if the device itself supports the stream’s video & audio codec. Google provides a webpage with the Supported Media list for Google Cast:
Supported Media for Google Cast | Google Developers
If the video/audio codec is not on the list or you would like to confirm the support, it’s provided an API to verify if a specific codec is supported. Please run this snippet of code on the Receiver and deploy it to Chromecast:
const context = cast.framework.CastReceiverContext.getInstance();
context.canDisplayType('audio/mp4', 'mp4a.40.5'); //returns true
_
If it returns true, the video or audio codec is supported. Let’s move to the second step.
Step 2 - CORS Configuration.
The CORS (Cross-Origin Resource Sharing) issue happens when Chromecast is not able to reach the stream provided for playback. While the stream still works at the Sender, i.e the Player on the Web Browser, it won’t start on Chromecast. This issue happens when Storage/CDN CORS settings won’t allow requests from a specific domain to download the manifest/segments. The domain for the Chromecast receiver is located at the following path where it’s deployed at the Google Developer console:
Google Cast SDK Developer Console → Select Receiver → Receiver Application URL.
Please request/change the CORS validation to allow the domain where your Receiver is deployed to request the stream manifest/segments. See this FAQ for additional details: Bitmovin Docs - Player FAQ - How do I enable CORS on my web server / cloud storage?. If the CORS configuration allows the requests from the Receiver and you are still facing some issues, let’s debug the application.
Step 3 - Debugging the application.
To debug the Chromecast Application, please execute the following steps in order:
- Make sure that the Sender’s device (laptop, mobile device) is connected to the same network where Chromecast is connected.
- Add your Chromecast device's serial number to the Google Cast website: Google Cast SDK Developer Console → Overview → Cast Receiver Devices → Add New Device.
- Cast your stream to the Chromecast device.
- Go to the following URL in Chrome browser: chrome://inspect/#devices:
- You will see your Chromecast device and inspect action it below the URL.
- Click on inspect to debug your receiver application.
- A Chrome’s browser window should open showing the Chromecast Receiver’s application.
Chromecast Debug Window
- If the video is casting but you are unable to find the device in chrome://inspect/#devices then it is probably because of your network. Try reconnecting your device to the network.
- Please verify the console for any issues that may affect the application/playback or navigate through the Network tab to analyze how the Chromecast requests/receives with the manifest/segments.
- If you were able to navigate the prior steps and there’s one issue, you will see the errors at the Console and Network tab. In the example below the manifest doesn’t exist. In this case, the Network Tab shows the HTTP 404 error and at the console, the messages related to it.
Error where the manifest doesn’t exists
Updated 12 months ago