This article explains how to cast an Apple HLS or MPEG-DASH stream from an Android device to a Google Chromecast device using Wowza Streaming Engine™ media server software.
Set up the Android device
On your Android device, install Chrome and the Google Cast application, and then follow the in-app instructions for configuring your Chromecast device. Test to be sure the device is working properly using Youtube, Netflix, or other Chromecast-supported application.
Configure a Wowza Streaming Engine app to cast to Google Chromecast
Note: CORS headers must be enabled if casting an Apple HLS stream to a Chromecast device. For more information, see Enable cross-origin resource sharing in Wowza Streaming Engine.
- Set up an application for live or video-on-demand (VOD) streaming in Wowza Streaming Engine Manager. In this example, we will use vod as the application name.
- In Wowza Streaming Engine Manager, click the Applications tab and then click your application (vod) in the contents panel.
- In the application details page, click the Properties tab and then click Custom in the Quick Links bar.
Note: Access to the Properties tab is limited to administrators with advanced permissions. For more information, see Manage credentials. - In the Custom area, click Edit.
- Click Add Custom Property, specify the following settings in the Add Custom Property dialog box, and then click Add:
- Path - Select /Root/Application/HTTPStreamer.
- Name - Enter: httpUserHTTPHeaders
- Type - Select String.
- Value - Enter: Access-Control-Allow-Origin:*|Access-Control-Allow-Credentials:true|Access-Control-Expose-Headers:Date|Access-Control-Allow-Methods:HEAD, GET, POST|Access-Control-Allow-Headers:Overwrite, Destination, Content-Type, Depth, User-Agent, X-File-Size, X-Requested-With, If-Modified-Since, X-File-Name, Cache-Control, Range
- Path - Select /Root/Application/HTTPStreamer.
- Click Save, and then restart the application.
Set up an HTML5 webpage
Create an HTML5 webpage for streaming. For this example, we'll use Apple HLS to cast a VOD stream to Android and the Chromecast device. Here is an example HTML5 webpage (substitute the IP address of your Wowza Streaming Engine into the URL below):
<html> <head> <title>Wowza Streaming Engine Chromecast Streaming</title> </head> <body> <video id="movie" src="http://192.168.1.22:1935/vod/sample.mp4/playlist.m3u8" preload controls autoplay width="640" height="360"></video> </body> </html>
http://192.168.1.22:1935/live/myStream/playlist.m3u8
For an Apple HLS VOD stream, the src URL in the <video> tag should have the following format:
http://192.168.1.22:1935/live/myStream/playlist.m3u8
For an MPEG-DASH live stream, the src URL in the <video> tag should have the following format:
http://192.168.1.22:1935/live/myStream/manifest.mpd
For an MPEG-DASH video on demand stream, the src URL in the <video> tag should have the following format:
http://192.168.1.22:1935/vod/sample.mp4/manifest.mpd
Stream to the Chromecast device
Open your webpage in Chrome on your Android device. Click the Google Cast icon in the lower-right corner of the video player to cast the stream to your Chromecast device.