Version: 2.67.0

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.

SDK

Web SDKAndroid SDKiOS SDKtvOSAndroid TV SDKChromecast SDK
YesYesN/AYesN/AN/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)
)
)