• How to stream to Google Chromecast using an Android device and Wowza Streaming Engine

    This article explains how to cast an Apple HLS or MPEG-DASH stream from an Android device to a Google Chromecast device using a Wowza Streaming Engine™ media server.

    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.

    Set up Wowza Streaming Engine 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 How to enable cross-origin resource sharing (CORS) for HTTP-based connections.
    To set up a streaming application for casting:

    1. Set up an application for live or video on demand streaming by following one of our streaming tutorials. In this example, we will use vod as the application name.

    2. In Wowza Streaming Engine Manager, click the Applications tab and then click your application (vod) in the contents pane.

    3. 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.
    4. In the Custom area, click Edit.

    5. 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

    6. Click Save, and then restart the application.

    Webpage setup

    Create an HTML5 webpage for streaming. For this example we will use Apple HLS to cast a video on demand 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>
    For an Apple HLS live 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 Apple HLS video on demand 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 new webpage in the Chrome browser on your Android device. Click the Google Cast icon in the lower right corner of the video player to immediately cast the stream to your Chromecast device.

    Originally Published: For Wowza Streaming Engine on 03-26-2014.
    Updated: 06-02-2016.

    If you're having problems or want to discuss this article, post in our forum.