Package com.theoplayer.android.api.cast
Interface CastIntegration
-
- All Implemented Interfaces:
-
com.theoplayer.android.api.Integration
public interface CastIntegration implements Integration
The Cast Integration API.
-
-
Method Summary
Modifier and Type Method Description abstract Boolean
isCasting()
Returns whether THEOplayer is casting to a Chromecast. abstract CastError
getError()
The last error that occurred while Chromecasting, if any. abstract String
getReceiverName()
The name of the Chromecast device that the player is casting to, if any. abstract PlayerCastState
getState()
The state of the Chromecast. abstract Unit
start()
Start casting to the Chromecast. abstract Unit
join()
Synchronise the local player with an active Chromecast session. abstract Unit
leave()
Leave the active Chromecast session. abstract Unit
stop()
Stop casting to the Chromecast. abstract Unit
setConnectionCallback(ChromecastConnectionCallback chromecastConnectionCallback)
Sets a listener for the Chromecast connection changes. -
-
Method Detail
-
getError
abstract CastError getError()
The last error that occurred while Chromecasting, if any. (Nullable)
-
getReceiverName
abstract String getReceiverName()
The name of the Chromecast device that the player is casting to, if any.
- Returns:
The receiver name. (Nullable)
-
getState
abstract PlayerCastState getState()
The state of the Chromecast.
For possible values, see PlayerCastState.
Default: PlayerCastState.UNAVAILABLE
- Returns:
The cast state. (NonNull)
-
start
abstract Unit start()
Start casting to the Chromecast.
A dialog will prompt to choose the device.
-
leave
abstract Unit leave()
Leave the active Chromecast session.
Does not stop the session when other devices are connected. Use CastIntegration.stop to fully stop the session.
-
setConnectionCallback
abstract Unit setConnectionCallback(ChromecastConnectionCallback chromecastConnectionCallback)
Sets a listener for the Chromecast connection changes.
- Parameters:
chromecastConnectionCallback
- The Chromecast state listener.
-
-
-
-