This article provides information on how to customize the look and feel of a Chromecast Sender application or a Chromecast Receiver Application.
The following topics are discussed:
This section provides background information on Google, THEOplayer SDKs, Sender apps and Receiver apps. Feel free to skip directly to the sections on Customizing a Sender Application or Customizing a Receiver application if you are already familiar with these background topics.
Google's point of entry to Chromecast is located at https://developers.google.com/cast/docs/developers. In this article, they write about sender applications and their three Cast APIs, and about receiver applications and their four options.
Google describes three Cast APIs: the Android API, the iOS API and the Chrome API. The THEOplayer SDKs integrate these Cast APIs and expose a wrapper API for developers to use instead.
Google describes four types of receiver applications:
The THEOplayer Chromecast Receiver SDK fits in the category of a "Custom Receiver". You integrate this THEOplayer SDK in your HTML5 Chromecast Receiver application.
When talking about customizing a Chromecast application, one needs to make a distinction between customizing a Sender application versus a Receiver application.
A Chromecast Sender application is the application on a "sender device" (e.g. smartphone, browser, ...) which initiates the Chromecast session. You use the Sender application to start (and stop) Chromecast playback, to pause the video or to mute it, to seek to a different position in the scrub bar, and so on. The unique UI components related to Chromecast in a Sender application are limited to a Chromecast button which starts/stops a Chromecast session. The default controls (e.g. play, pause, scrub bar) are used to control the Receiver application.
In a Sender application, you use either the THEOplayer Web, iOS or Android SDK.
A Chromecast Receiver application is the application which is loaded on your Chromecast-enabled device (e.g. Chromecast Ultra, Android TV, ...). The UI of a Receiver application is typically quite simple:
In a Receiver application, you use the THEOplayer Chromecast Receiver SDK.
If you are using the THEOplayer Web, iOS or Android SDK in your Sender application, confirm that the chromecast
module is enabled for your SDK.
This feature exposes a Chromecast API you can benefit from. Additionally, ensure that you include the Chromecast library.
Please refer to
"Connecting from custom Sender applications"
if you are not using THEOplayer's chromecast
feature.
Generally speaking, there are three types of user interfaces:
THEOplayer automatically inserts a Chromecast button in its default video player UI if you are using THEOplayer's default UI.
The UI of this button changes when the Chromecast state changes.
Please see below if you want to alter this default UI.
You are in charge of all UI components if you are using THEOplayer's Chromeless UI.
Typically, you want to insert a Chromecast button, and connect that button with our Cast API to start
(e.g. player.cast.chromecast.start()
) and stop (player.cast.chromecast.stop()
) a Chromecast session. Additionally, you might want to change the appearance of this
button when the state of your casting session transitions (e.g. player.cast.chromecast.addEventListener('statechange', function() {...});
).
Familiarize yourself with the above APIs if you want to change the appearance of your Chromeless UI and its relation to Chromecast.
If you are using THEOplayer's default UI, but want to use your own button instead, then you can hide THEO's default button, and insert a new one instead. You also need to use our Cast API described in the above "Chromeless UI" section.
Three Receiver application set-ups are common:
You can provide Chromecast metadata in all three set-ups. Providing Chromecast metadata will make your Receiver application show relevant info (e.g. a title, a thumbnail, ...) when your application is buffering or paused.
If you are connected to THEOplayer's default Receiver application, you cannot modify its appearance.
If you want to change the UI, you need to connect your sender application with a different Receiver application ID.
You can build a custom Receiver application by using our Chromecast Receiver SDK. Once you went through its Getting Started Guide, you'll notice that the UI is similar to the default UI. However, through this approach, you have the option to alter the UI as described by the Getting Started Guide.
You can connect your sender application with a custom Receiver application which does not use the THEOplayer Chromecast SDK. Naturally, you're responsibile for the look and feel of this custom Receiver application.
Identify whether you want to adjust the UI and UX of the Sender application or the Receiver application.
Then, decide which states and which components you want to customize. Finally, identify which THEOplayer APIs are relevant for your use-cases.