Class CastPlayer

  • All Implemented Interfaces:

    public final class CastPlayer
    extends BasePlayer
    Player implementation that communicates with a Cast receiver app.

    The behavior of this class depends on the underlying Cast session, which is obtained from the injected CastContext. To keep track of the session, isCastSessionAvailable() can be queried and SessionAvailabilityListener can be implemented and attached to the player.

    If no session is available, the player state will remain unchanged and calls to methods that alter it will be ignored. Querying the player state is possible even when no session is available, in which case, the last observed receiver app state is reported.

    Methods should be called on the application's main thread.