Interface GoogleCast.Provider

Enclosing class:
GoogleCast

public static interface GoogleCast.Provider
A platform Google Cast implementation. The Android build registers one; applications do not normally implement this.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns
    boolean
    load(String url, String contentType, String title, String subtitle, String imageUrl, long startMillis)
    Loads media on the receiver.
    boolean
    Returns
    boolean
    Returns
    boolean
    seek(long millis)
    Seeks the receiver.
    void
    Installs the listener the provider reports session states to, from any thread, as Cast.STATE_* values.
    boolean
    Shows a device chooser and connects to the chosen device.
    boolean
    Stops playback and ends the session.
  • Method Details

    • setStateListener

      void setStateListener(SuccessCallback<Integer> listener)

      Installs the listener the provider reports session states to, from any thread, as Cast.STATE_* values.

      Parameters
      • listener: receives state changes
    • showRoutePicker

      boolean showRoutePicker()

      Shows a device chooser and connects to the chosen device.

      Returns

      true when the chooser was shown

    • isSessionActive

      boolean isSessionActive()
      Returns

      true while connected to a receiver

    • load

      boolean load(String url, String contentType, String title, String subtitle, String imageUrl, long startMillis)

      Loads media on the receiver.

      Parameters
      • url: the media URL
      • contentType: the MIME type, or null
      • title: the title, or null
      • subtitle: the subtitle, or null
      • imageUrl: an artwork URL, or null
      • startMillis: the start position
      Returns

      true when the request was sent

    • play

      boolean play()
      Returns

      true when the request was sent

    • pause

      boolean pause()
      Returns

      true when the request was sent

    • seek

      boolean seek(long millis)

      Seeks the receiver.

      Parameters
      • millis: the position
      Returns

      true when the request was sent

    • stop

      boolean stop()

      Stops playback and ends the session.

      Returns

      true when the request was sent