Interface Chromecast
-
- All Implemented Interfaces:
-
com.theoplayer.android.api.event.EventDispatcher
public interface Chromecast implements EventDispatcher<E>
The chromecast API.
-
-
Method Summary
Modifier and Type Method Description abstract booleanisCasting()Returns whether THEOplayer is casting to a Chromecast. abstract CastErrorgetError()The last error that occurred while Chromecasting, if any. abstract StringgetReceiverName()The name of the Chromecast device that the player is casting to, if any. abstract PlayerCastStategetState()The state of the Chromecast. abstract voidstart()Start casting to the Chromecast. abstract voidjoin()Synchronise the local player with an active Chromecast session. abstract voidleave()Leave the active Chromecast session. abstract voidstop()Stop casting to the Chromecast. abstract voidsetConnectionCallback(@Nullable() ChromecastConnectionCallback chromecastConnectionCallback)Sets a listener for the Chromecast connection changes. -
-
Method Detail
-
isCasting
abstract boolean isCasting()
Returns whether THEOplayer is casting to a Chromecast.
-
getError
@Nullable() abstract CastError getError()
The last error that occurred while Chromecasting, if any. (Nullable)
-
getReceiverName
@Nullable() abstract String getReceiverName()
The name of the Chromecast device that the player is casting to, if any.
- Returns:
The receiver name. (Nullable)
-
getState
@NonNull() abstract PlayerCastState getState()
- Returns:
The cast state. (NonNull)
-
start
abstract void start()
Start casting to the Chromecast.
- A dialog will prompt to choose the device.
-
join
abstract void join()
Synchronise the local player with an active Chromecast session.
-
leave
abstract void leave()
Leave the active Chromecast session.
- Does not stop the session when other devices are connected.
- Use stop to fully stop the session.
-
stop
abstract void stop()
Stop casting to the Chromecast.
-
setConnectionCallback
abstract void setConnectionCallback(@Nullable() ChromecastConnectionCallback chromecastConnectionCallback)
Sets a listener for the Chromecast connection changes.
- Parameters:
chromecastConnectionCallback- The Chromecast state listener.
-
-
-
-