Sender App

When content is casting to a Cast receiver, the user must always be able to control it from the sender app.

Note: In accordance with the Google Cast SDK Additional Developer Terms of Service, a Cast media application must use the Play control APIs (Media Playback Messages) defined for the SDK to control media playback on the receiver.

Sender apps should provide Cast controls in these areas:

The sender app's Cast playback status and controls (for example, pause/play) across these areas must be in sync with playback changes happening on the receiver, even when not originated by the sender app. This will allow proper handling of both multi-sender commands and the playback control coming from the device’s remote controls, buttons, etc.

Android

Cast dialog controls

Mini controller

Notification controls

Lock screen controls

iOS

Cast dialog controls

Mini controller

Chrome

Cast dialog controls

Mini controller

 

  Sender volume controls

The sender app must allow users to control the volume of the content playing on the TV or speakers, using the hardware volume buttons and/or software volume slider on the sending device. These control either of the following:

  • The audio level sent to the TV for Google Cast devices like Chromecast
  • The actual native TV/speaker volume for Google Cast TVs and speakers

Required
  A   The sender app must allow users to control the volume of the content playing on the TV or speakers, using the hardware volume buttons and/or software volume slider on the sending device

  • Android: Support for both hardware buttons and software volume slider is mandatory
  • iOS: Software volume slider is mandatory. Support for hardware buttons is optional, but provides better experience
  • Web/Chrome: Support for the software volume slider is mandatory

  B   On the mobile device the software volume slider must be available in the Cast dialog, while casting
  C   The volume slider in the sender app must sync with the current receiver volume after connecting to the receiver and stay in sync (for example, track volume changes made on the receiver)
  D   The volume slider in the sender app must reflect volume changes made by other devices (i.e. other senders, or the Chromecast app remote control)
  E   Sender apps should never set volume to a predefined level they should only pass user-initiated volume changes
  F   Android only: When using the hardware buttons to change the volume level on the receiver, a visual volume slider (with a Cast icon to the left of it) must appear when the hardware volume buttons are pressed. Note: for Android Gingerbread (version 2.3), the Cast icon does not appear

Best practices

  • Volume increments:
    • Android: the framework increments the volume automatically.
    • iOS and Chrome: For hardware volume buttons, use increments of less than or equal to 5% of the receiver device's full volume range for audio/video devices, and increments equal to 2% of the receiver device's full volume range for audio-only devices.
  • Volume sliders: for software volume sliders, the Cast SDK will automatically limit the total amount of volume increase (for example, X% per update), to avoid blowing out speakers. If a user does increase the volume with the slider by a large increment, it automatically “rebounds” back to the actual volume that was set.

  Sender expanded controller

The sender app must provide an expanded controller for the content being cast.

Required
  A   Identify content being cast (for example, show content title or artwork)
  B   Before playback begins, display a loading indicator (for example, "Loading") and content title or artwork
  C   When content starts, identify the receiver & state (for example, "Casting to Receiver-Name")
  D   Provide relevant controls (for example, play/pause, next/prev)
  E   At the left end of the seek bar show the current playback time;
       at the right end show the total duration of the stream, if known (that is, if not a live stream)
  F   Hide controls not relevant to casting (for example, full-screen button)
  G   Do not disconnect or stop the cast when users navigate away from the expanded controller
  H   Provide an easy way back to the expanded controller when users navigate away

Best practices

  • Provide a playback position slider for media streams (for example, streaming movie)
  • Display other meaningful content-related artwork and metadata (for example, show music artist photo when playing an album)
  • Identify elapsed time and content duration for media streams (for example, streaming movie)

Android

Sender content loading

Receiver content loading

Sender content playing

Receiver playing content

iOS

Sender content loading

Receiver content loading

Sender content playing

Receiver playing content

Chrome

Sender content loading

Receiver content loading

Sender content playing

Receiver playing content

 

  Sender mini controller

A small, persistent control known as the mini controller should appear, while casting, when the user navigates away from the current content page or expanded controller to another view within the sender app. The mini controller is a visible reminder of the current cast and provides instant access to it.

Required
  A   A bar or box that shows what's casting appears near the bottom of the sender app. These controls persist while the user browses other content or sections of the app
  B   The controls work best when they are simple and communicate what is being cast (for example, show content title or artwork and play/pause)
  C   Available in all screens of the app (except the expanded controller page)
  D   Tapping on the content area opens the expanded controller
  E   Provide any other controls relevant to immediate action (for example, add to favorites)

Best practices
For the best user experience, provide controls in the Cast dialog in addition to the mini controller.

Android

Sender mini controller

Receiver content paused

iOS

Sender mini controller

Receiver content paused

Chrome

Sender mini controller

Receiver content paused

 

  Sender notification

Required (Android only)
  A   Display a notification only when the sender app casting is not currently in view (for example, notification for Play Movies is shown when casting from Play Movies while browsing YouTube)
  B   Use the app icon (not the Cast icon) for the notification in the status bar
  C   Identify which content is casting (for example, show content title or artwork)
  D   Identify which receiver is casting (for example, "Casting to Living Room")
  E   Provide basic content controls (for example, play/pause)
  F   Provide an "X" to stop casting and disconnect from the receiver, in the row of actions
  G   Tapping on the app logo, content title or artwork should open the sender app's expanded controller

Notes

  • Android only: it is not possible to implement notifications in iOS or Chrome.
  • In Android Gingerbread (version 2.3), notifications will only show the app icon and text, not play/pause or stop.
  • For more information, see adding media controls to notifications.

Android

Sender notification icon

Receiver playing content

Sender notification controls

Receiver playing content

 

  Sender lock screen

Required (Android only)
  A   Identify content casting using content title or artwork
  B   Identify which receiver is casting (for example, "Casting to Living Room") This is not required for Music apps
  C   Provide playback controls (for example, play/pause)
  D   Provide access to the volume control via hardware buttons

Required for Android 4.4 KitKat and later versions:

  • App icon
  • Artwork (for example, album cover)
  • Identify in text what content is casting (for example, "Tears of Steel")
  • Identify which receiver is casting (for example, "Living Room")

Required for Android 4.3 Jelly Bean:

  • Artwork (for example, album cover)
  • Identify in text what content is casting (for example, "Tears of Steel")
  • Identify which receiver is casting (for example, "Living Room")

Notes

  • Android only: it is not possible to implement notifications in iOS or Chrome.
  • The lock screen controls are required for Android 4.1 and later versions.
  • Different controls are available for different versions of the Android operating system, and the lock screen can accommodate only text fields. Generally, graphics and iconography more immediately describe the content than text
  • Volume control hardware buttons should adjust the volume on the sender app when the phone is locked
  • The control must use the framework component: MediaSession or MediaSessionCompat (for versions 4.4 and 4.3), or Notifications (for 5.0 and later)

Android

Sender lock screen controls

Receiver playing content

 

  Sender resumes cast

A connected sender app should restore its connected state after an implicit disconnect (such as a network drop, device going to sleep, or battery dying).

Required
  A   If the sender app implicitly disconnects (ie. the user did not explicitly stop casting or disconnect), then the casting content should continue playing on the receiver. When the app or connection is restarted, the sender app should restore the connection to the receiver, as long as the receiver session is still current
  B   The Cast button should be restored to the connected state
  C   If the user taps the Cast button before the sender reconnects, the list of receiver devices is shown. When the user selects the receiver currently casting, a mini or expanded controller should appear in the sender app

Notes
The receiver app may also disconnect and stop running, due to a power failure or some other out-of-context interruption. This is treated as an ordinary session end, as described in Sender stops cast.

Android

Selecting the app

Receiver playing content

Cast connection restored

Receiver playing content

iOS

Selecting the app

Receiver playing content

Cast connection restored

Receiver playing content

 

  Sender stops cast

Content which is cast to a TV continues playing until either a user chooses Stop Casting or a sender casts something new. When multiple senders are connected to the same receiver, each sender app should have a Disconnect button (instead of a Stop Casting button) in the Cast dialog.

Required
  A   When multiple senders are connected to a receiver, pressing Stop Casting from one sender app does nothing to the receiver and removes Cast controls and notifications from that sender device. The remaining connected sender device(s) stay connected with Cast controls available.
  B   When a sender app disconnects implicitly (for example, the sender device battery dies, or the sender device network connection to the receiver drops), it does nothing to the receiver, and removes the Cast controls and notifications from the sender device. The sender app should keep track of implicit disconnections and attempt to reconnect to a receiver when the sender app is opened again.

Android

Cast dialog, disconnect button

Receiver playing content

iOS

Cast dialog, disconnect button

Receiver playing content

Chrome

Cast dialog, disconnect button

Receiver playing content

 

 

Images used in this guide are courtesy of the Blender Foundation, shared under copyright or Creative Commons license.

  • Elephant's Dream: (c) copyright 2006, Blender Foundation / Netherlands Media Art Institute / www.elephantsdream.org
  • Sintel: (c) copyright Blender Foundation | www.sintel.org
  • Tears of Steel: (CC) Blender Foundation | mango.blender.org
  • Big Buck Bunny: (c) copyright 2008, Blender Foundation / www.bigbuckbunny.org