In the next release of the Web Receiver SDK, expected in late 2020, Shaka Player will be upgraded from v2.5 to v3.0. This change only affects DASH playback; HLS and Smooth Stream playback are unaffected.
In advance of the release, we are making an early preview version of the new release available to developers so you can test your receiver with Shaka v3 prior to release. Note that the preview version should ONLY be used for testing, and should not be used in production.
You should ensure that your receiver is compatible with both Shaka v2.5 and
Shaka v3 (see the Shaka player upgrade guide
for details). You can test your receiver against the preview URL for the new
in advance of the release.
If you find any problems, please let us know as soon as possible so we can investigate and fix.
Web Receiver Overview
Web Receiver application
- Provides an interface to display the app's content on the TV.
- Handles messages from the sender application to control content on the Web Receiver device.
- Handles custom messages from the sender application that are application-specific.
The Web Receiver provides additional functionality.
Web Receiver SDK
The Web Receiver SDK also comes with a built-in media player, which provides a seamless and easy playback experience. It also allows you to customize the player UI and provides your Web Receiver with the ability to intercept and override messages and methods to execute your custom business logic.
You can implement your Web Receiver application in the following ways:
- Use the Styled Media Receiver: This is a pre-built Web Receiver application that provides a media player UI for audio and video content. It provides a default UI for the Web Receiver application, but you can customize several elements in the UI with a CSS file.
- Develop a Custom Receiver: This is a custom built HTML5 app that you must host to handle the display of your app content on the TV. You may need to create a Custom Receiver if your app wants to display content other than audio/video media or if the Styled Media Receiver does not support the media types your app requires.
If you choose not to implement a Web Receiver, your application can use the Default Media Receiver.
Choose a Web Receiver
Styled Media Web Receiver
The Styled Media Web Receiver is a pre-built Web Receiver application hosted by Google that is designed for streaming audio and video content. You can style the interface with your own colors and branding assets using a CSS file.
To use the Styled Media Web Receiver, select Styled Media Web Receiver when registering a new application and (optionally) provide the URL to a CSS file that defines a custom look for the Web Receiver application's UI.
For details about the CSS styles that allow you to customize the Web Receiver application's UI, see the Styled Media Receiver guide.
Custom Web Receiver
For details about how to build your Web Receiver application with the Web Receiver API, see the Create a Basic Web Receiver guide.
Default Media Web Receiver
A third option available is the Default Media Web Receiver. This is a pre-built Web Receiver application hosted by Google that is designed for streaming your audio and video content. It does not require you to register with the Google Cast SDK Developer Console, but you cannot customize any of the UI in the Default Media Web Receiver.
Instead of registering with the developer console to receive an app ID, you can use the Default Media Web Receiver with the default app ID:
- For Android apps:
- For Chrome apps:
- For iOS apps:
From your sender app, you start the Default Media Web Receiver app on the Cast device and then use it to load the URL to your media.
Web Receiver features overview
Queueing is a major feature introduced as part of Web Receiver. The earlier Receiver v2 implementation carries a basic sender-initiated queue while the new queueing implementation in Web Receiver introduces receiver-implemented queueing.
Queueing provides the following features:
- Support of Google's cloud queue implementation so an externally stored and created queue can be directly loaded into Cast devices.
- Mechanisms that allows pagination of items in the queue rather than loading everything at once, solving our v2 message size limit issue.
- Support for new messaging such as going to the next item, the previous item, fetching a window of items, as well as getting media information related to a set of queue items.
- Better integration with the Cast eco-system such as Google Home through new queueing data.
- An easy to use QueueManager API that allows insertion, removal, and update of queue items.
The Web Receiver SDK allows your receiver app to handle player events. The event
handler takes a
parameter (or an array of these parameters) that specifies the event that should
trigger the listener.
The Web Receiver SDK allows your receiver app to intercept messages and execute custom code at that point of interception. Message interception can be especially useful if you want do things like customizing the load request data.
The Web Receiver SDK supports embedding ads within a given media stream; it provides two ways to incorporate ad breaks to the receiver: client-side and server-side stitching using breaks and break clips.
Audio track selection in the new Web Receiver SDK has an
class that simplifies and streamlines track selection, giving you more control
and better access to properties, such as name, URL and language.
Closed captions (subtitles)
Closed caption track selection in the new Web Receiver SDK has a
class that simplifies and streamlines track selection, giving you more control
and better access to properties, such as name, URL and language (much like Audio
Message exchange is the key interaction method for receiver applications. A sender can send a message to the receiver and vice versa. A receiver application may choose to listen for messages on a specified namespace. It is then up to any connected senders wishing to communicate on that namespace to use the appropriate protocol.
Styling the player
The Web Receiver SDK provides a built-in player UI. In order to use the built-in player UI you need to add cast-media-player element to your HTML. CSS-like styling allows setting various things including background-image, splash-image, font family and other things. This functionality allows for better branding and overall customization.
Custom UI data binding
Custom UI data binding allows you to use your own custom UI element and use the
class to bind the UI to the player state. The binder also supports sending
events for data changes, if the app does not support data binding.
Web Receiver supports preloading of media items after the current playback item in the queue. The preload operation pre-downloads several segments of the upcoming items. Preloading will work for HLS and Smooth streaming content by default. For regular MP4 video and audio files such as MP3, those will not be preloaded, as Cast devices support one media element only and cannot be used to preload while an existing content item is still playing.
With the introduction of smart displays, the Web Receiver SDK now adds support to enable touch controls on your receiver app when launched on these devices. The Web Receiver SDK provides a default UI experience with additional customization of the player controls.
By default, the Web Receiver handles most incoming voice commands from Assistant-enabled devices. Common media commands enable and display the same UI that is used for normal operation (touch and non-touch).
Web Receiver supports stream transfer, where users can move audio and video streams across devices using voice commands. Stream transfer for audio is supported by default and no additional development is necessary. Stream transfer for video requires enabling the stream transfer media command and optional overriding of the media session state.