A builder to create an instance of CastOptions
which is used to initialize the CastContext.
|
Builder()
|
| CastOptions |
build()
Builds and returns the
CastOptions
object.
|
| CastOptions.Builder |
setCastMediaOptions(CastMediaOptions
castMediaOptions)
Sets the
CastMediaOptions that will be used to configure the media session.
|
| CastOptions.Builder |
setEnableReconnectionService(boolean enableReconnectionService)
Sets whether
ReconnectionService should be enabled when needed to better handle
session recovery.
|
| CastOptions.Builder |
setLaunchOptions(LaunchOptions launchOptions)
Sets the receiver launch options to use when launching the application.
|
| CastOptions.Builder | |
| CastOptions.Builder |
setRemoteToLocalEnabled(boolean remoteToLocalEnabled)
Sets whether the sender application supports transferring a cast session from a
cast device to a local device.
|
| CastOptions.Builder |
setResumeSavedSession(boolean resumeSavedSession)
Sets whether the saved session should be resumed if it was dropped
unexpectedly.
|
| CastOptions.Builder |
setStopReceiverApplicationWhenEndingSession(boolean stopApp)
Specifies whether the receiver application should be terminated when a session
is ended by the user via the "Stop Casting" button in the media router dialog.
|
| CastOptions.Builder | |
| CastOptions.Builder |
setVolumeDeltaBeforeIceCreamSandwich(double volumeDelta)
This method is deprecated. Google Play services discontinued updates for
Jelly Bean (API levels 16, 17 & 18) since July 2021. This method will be
removed in the next release.
|
Builds and returns the CastOptions
object.
Sets the CastMediaOptions
that will be used to configure the media session.
| castMediaOptions | The
CastMediaOptions. |
|---|
Sets whether ReconnectionService
should be enabled when needed to better handle session recovery. The default value is
true.
| enableReconnectionService | true if the
ReconnectionService should be enabled, false if it should
not be enabled. |
|---|
Sets the receiver launch options to use when launching the application. The default
value is a default LaunchOptions.
| launchOptions | The LaunchOptions. |
|---|
Sets the receiver application ID. The default value is an empty string. Specifying null or an empty string indicates that the app does not want to discover receiver devices or launch a receiver application.
| applicationId | The receiver application ID that will be used to discover the receiver device and launch the receiver application. |
|---|
Sets whether the sender application supports transferring a cast session from a cast device to a local device.
| remoteToLocalEnabled | true if the sender application supports the switching from a cast
session to a local device |
|---|
Sets whether the saved session should be resumed if it was dropped unexpectedly. The
default value is true.
| resumeSavedSession | true if the saved session should be resumed, false if
the saved session should not be resumed. |
|---|
Specifies whether the receiver application should be terminated when a session is
ended by the user via the "Stop Casting" button in the media router dialog. The default
value is false.
| stopApp | true if the receiver application should be terminated when a
session ended by the user, false if the receiver application should
not be terminated in this case. |
|---|
Sets the list of supported namespaces. The default value is an empty list.
| supportedNamespaces | The list of supported namespaces that is used to filter discovered receiver devices. |
|---|
This method is deprecated.
Google Play services discontinued updates for Jelly Bean (API levels 16, 17 & 18) since
July 2021. This method will be removed in the next release.
Sets the amount of receiver device volume to increase or decrease when the physical
volume key is pressed on an Android device older than ICE CREAM SANDWICH. This value is
not used on Android devices running ICE CREAM SANDWICH or newer. The system honors the
system volume range of [0.0, 1.0]. If volumeDelta is set to
0.1, then every press of the "volume up" key will increase the volume by
10%.
| volumeDelta | The amount of volume delta. The default value is 0.05. |
|---|
| IllegalArgumentException | If volumeDelta is negative, zero or greater than
0.5. |
|---|