logo

How to configure a different stream to Chromecast

Some streaming set-up require you to cast a different stream to a Chromecast Receiver device than the one playing on a Chromecast Receiver device.

Example

On an iOS application, a FairPlay-protected HLS stream is playing on a sender device, but a matching Widevine-protected MPEG-DASH stream is required to play on the receiver device, because a Chromecast receiver has no support for Fairplay.

THEOplayer's Cast API allows you to configure a different SourceDescription for your Chromecast session.

Table of Contents

SDKs

Web SDK Android SDK iOS SDK tvOS SDK Android TV SDK Chromecast SDK
Yes Yes Yes N/A N/A N/A

Code examples

The below code examples demonstrate how you can configure a different SourceDescription for a Chromecast Session.

Web SDK

The Chromecast API allows you to configure a different SourceDescription to be Chromecasted.

player.cast.chromecast.source = sourceDescription;
Android SDK

The Chromecast API allows you to configure a different SourceDescription to be Chromecasted.

tpv.getCast().getChromecast().setSource(sourceDescription);
iOS SDK

The Chromecast API allows you to configure a different SourceDescription to be Chromecasted.

self.theoplayer.cast?.chromecast!.source = SourceDescription(
    source: TypedSource(
        src: stream,
        type: "application/dash+xml",
        drm: WidevineDRMConfiguration(licenseAcquisitionURL: laurl)
    )
)
github
Make sure to follow us on GitHub!
THEO-logo-white
twitter
facebook
linkedin
Copyright © 2020. All Rights Reserved.
Leuven
New York
San Francisco
Singapore
Barcelona