Class: CastReceiverOptions



new CastReceiverOptions()



(number or undefined)

How far in advance we should preload the contents of an individual ad break, in seconds. This allows you to avoid preloading an ad break too far in advance, and thus confuse your ad metrics. If not provided, a default of 5 seconds is used.


non-null Object with non-null cast.framework.system.MessageType properties

Map of custom message namespaces and their types. Custom message namespaces must be initialized before the application starts, so they must be provided in the receiver options. (The default message type is JSON if not provided here).


(boolean or undefined)

If true, prevents the receiver from being closed when it becomes idle after active playback stops. This property should be used only for non-media apps.




If true, any media command that is not in the supportedCommands map will generate an error. The cast.framework.messages.ErrorReason will be set to NOT_SUPPORTED. Default value is false, which allows media commands to be executed without checking the map.


(string or undefined)

Sender ID used for local requests. Default value is 'local'.


(number or undefined)

Maximum time in seconds before closing an idle sender connection. Setting this value enables a heartbeat message to keep the connection alive. Used to detect unresponsive senders faster than typical TCP timeouts. The minimum value is 5 seconds; no upper bound is enforced, but it typically takes minutes before platform TCP timeouts come into play. Default value is 10 seconds.


(non-null HTMLMediaElement or undefined)

Media element to play content with. Default behavior is to use the first media element found in the page.


(non-null cast.framework.PlaybackConfig or undefined)

A playback configuration with custom parameters.


(boolean or undefined)

If true, a client-stitched break will play even if it was already watched.


(number or undefined)

The playback rate to use if unspecified in the load request. Allowable range is 0.5 to 2, with 1 being normal speed.


(string or undefined)

Language to use for the text track if the load request does not specify an active track.


(non-null cast.framework.QueueBase or undefined)

Custom queue implementation.


(non-null cast.framework.ShakaVariant or undefined)

Which build of Shaka Player should be loaded. Set to cast.framework.ShakaVariant.DEBUG to load a debug build.


(string or undefined)

Shaka version in the MAJOR.MINOR.PATCH format, for example "4.3.4" (the current default).

Supported versions are >=3.3.16 <5.0.0. Deprecated but still compatible versions are >=2.5.6 <3.3.16.

NOTE: Shaka Player versions older than the default are not recommended, as many bugs have been fixed in the latest versions. Newer versions may be specified here to opt-in to additional fixes or features that are not yet available by default. However, please be aware that future releases of the Web Receiver SDK may change the range of supported versions and force the use of a version other than what you specify here. This flag should be used only as a temporary measure, and under guidance from the Cast support team. ( Use at your own risk.


(boolean or undefined)

If true, prevents the receiver from loading the MPL player.


(boolean or undefined)

If true, prevents the receiver from loading the MPL or Shaka player libraries. Equivalent to setting both skipMplLoad and skipShakaLoad to true.


(boolean or undefined)

If true, prevents the receiver from loading the Shaka player.


(string or undefined)

Text that represents the application status. It should meet internationalization rules, as it may be displayed by the sender application.


(number or undefined)

A bitmask of media commands supported by the application. LOAD, PLAY, STOP, GET_STATUS must always be supported. If this value is not provided, then PAUSE, SEEK, STREAM_VOLUME, STREAM_MUTE, EDIT_TRACKS, and PLAYBACK_RATE are also assumed to be supported.

See also


(non-null cast.framework.ui.UiConfig or undefined)

UI Configuration.


(boolean or undefined)

If true, use MPL for DASH content.


(boolean or undefined)

If true, use Shaka Player for HLS content. Defaults to false.

NOTE: Shaka Player is not the default for HLS content because there are still missing features, and because we want to ensure that it is performant and broadly compatible with HLS receivers before making it the default. If you opt into Shaka Player for HLS before the official launch, we would ask that you please report any issues you encounter. ( Before the full launch of Shaka Player for HLS, we make no guarantees about Shaka Player compatibility for HLS, and we may advise you to revert this flag to its default setting if you encounter non-trivial issues.


(number or undefined)

An integer used as an internal version number to represent your receiver version. This number is used only to distinguish between receiver releases when collecting metrics. It should be incremented with each release and remain bound to that release in the event of a rollback.