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 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 void
start()
Start casting to the Chromecast. abstract void
join()
Synchronise the local player with an active Chromecast session. abstract void
leave()
Leave the active Chromecast session. abstract void
stop()
Stop casting to the Chromecast. abstract void
setConnectionCallback(@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.
-
-
-
-