Skip to content

Chromecast API v1 Resources

NOTE

This version is deprecated, use v2 docs instead.

When you want to cast content from The Radio Hub to a Chromecast connected to a tv, you can use the The Radio Hub Chromecast Receiver. You'll have to create a so called Chromecast Sender app to connect to the Custom Receiver Application we're providing.

Create Chromecast Sender App

Connect to a Chromecast and load the The Radio Hub Application before doing anything else.

Platform requirements

The Chromecast Sender apps use a special library provided by Google, and those are currently available for Android, iOS and the Chrome Webbrowser for computers and laptops. Other platforms are not supported.

Help URL

See https://developers.google.com/cast/docs/sender_apps for tips and requirements to get you started.

Parameters

ParameterRequiredDescription
application idRequiredThe id of the Custom Receiver Application from The Radio Hub is 7B0F09E0

Successfull connection

Once you are connected to a Chromecast, a The Radio Hub loading screen will show, displaying a message "waiting for stationdata". At this time you will need to create a CastMessageBus to send a message to the Chromecast with the "urn:x-cast:json" namespace.

The other items on this documentation page describe the possible actions for the Chromecast Receiver.

Play stream with nowplaying

Plays the radio stations' audio while showing the now playing information on screen.

Requirements

You will need a connection to a Chromecast, and the possiblity to send messages via a CastMessageBus with the "urn:x-cast:json" namespace.

Message

json
{
    "message": stationid,
    "action": "stream"
}

Parameters

ParameterRequiredDescription
messageRequiredThe The Radio Hub id of the radiostation you want to start casting for. This makes sure the Chromecast app is displayed in the customized style for this radio station, and the data needed to perform the requested action will be retreived from this radio stations account.
actionRequiredthe "stream" action opens an audio player on the Chromecast which plays the stream url set by a radio station in it's The Radio Hub Dashboard. Also, now playing information with cover art and a news ticker are displayed on the screen.

Play videoplaylist

Shows a fullscreen videoplaylist, with radio station branding.

Requirements

You will need a connection to a Chromecast, and the possiblity to send messages via a CastMessageBus with the "urn:x-cast:json" namespace.

Message

json
{
    "message": stationid,
    "action": "videoplaylist",
    "videoplaylist": ["videoid1", "videoid2", "videoid3"]
}

Parameters

ParameterRequiredDescription
messageRequiredThe The Radio Hub id of the radiostation you want to start casting for. This makes sure the Chromecast app is displayed in the customized style for this radio station, and the data needed to perform the requested action will be retreived from this radio stations account.
actionRequiredthe "videoplaylist" action opens a video player on the Chromecast which plays the videos provided in the videoplaylist-parameter, one after another, in a fullscreen interface with a station logo on top.
videoplaylistRequiredthe "videoplaylist" parameter needs to contain an array of Youtube-video id's.