# cast.[framework](https://developers.google.com/cast/docs/reference/web_receiver/cast.framework).CastReceiverOptions

class static

Cast receiver context options.
All properties are optional.

## Constructor

### CastReceiverOptions

new
CastReceiverOptions()

## Properties

### adBreakPreloadTime

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

### customNamespaces

non-null Object with non-null [cast.framework.system.MessageType](https://developers.google.com/cast/docs/reference/web_receiver/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).

### disableIdleTimeout

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

### enforceSupportedCommands

constant

boolean

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.

### localSenderId

(string or undefined)

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

### maxInactivity

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

### mediaElement

(non-null HTMLMediaElement or undefined)

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

### playbackConfig

(non-null [cast.framework.PlaybackConfig](https://developers.google.com/cast/docs/reference/web_receiver/cast.framework.PlaybackConfig) or undefined)

A playback configuration with custom parameters.

### playWatchedBreak

(boolean or undefined)

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

### preferredPlaybackRate

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

### preferredTextLanguage

(string or undefined)

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

### queue

(non-null [cast.framework.QueueBase](https://developers.google.com/cast/docs/reference/web_receiver/cast.framework.QueueBase) or undefined)

Custom queue implementation.

### shakaVariant

(non-null [cast.framework.ShakaVariant](https://developers.google.com/cast/docs/reference/web_receiver/cast.framework#.ShakaVariant) or undefined)

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

### shakaVersion

(string or undefined)

Shaka version in the MAJOR.MINOR.PATCH or MAJOR.MINOR.PATCH-SUFFIX
format, for example "4.15.56" (the current default).

Supported versions are \>=4.15.56 \<6.0.0.
Deprecated but still compatible versions are \>=2.5.6 \<4.15.56.

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. (https://developers.google.com/cast/support) Use at
your own risk.

### skipMplLoad

(boolean or undefined)

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

### skipPlayersLoad

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

### skipShakaLoad

(boolean or undefined)

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

### statusText

(string or undefined)

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

### supportedCommands

(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
:   [cast.framework.messages.Command](https://developers.google.com/cast/docs/reference/web_receiver/cast.framework.messages#.Command)

### uiConfig

(non-null [cast.framework.ui.UiConfig](https://developers.google.com/cast/docs/reference/web_receiver/cast.framework.ui.UiConfig) or undefined)

UI Configuration.

### useLegacyDashSupport

(boolean or undefined)

If `true`, use MPL for DASH content.

### useShakaForHls

(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.
(https://developers.google.com/cast/support) 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.

### versionCode

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