Interface: StreamModifierUtils

Global variable to provide external <script>s with a method of hooking into the Player to modify stream URLs

Hierarchy

  • StreamModifierUtils

Index

Properties

Properties

addParam

addParam: function

A helper function which safely adds the given query parameter to the given url.

Type declaration:

▸ (url: string, param: string): string

Parameters:

NameType
urlstring
paramstring

sendNewStreamsToConsole

sendNewStreamsToConsole: function

This method provides a simple way of injecting new streams into the Radioplayer after initialisation. This can allow for both the base url of the stream(s) to be changed and the stream(s) to be decorated with any parameters you require.

Type declaration:

▸ (streams: Stream[]): void

Parameters:

NameType
streamsStream[]

syncQueryParamsWithConsole

syncQueryParamsWithConsole: function

This method provides a simple way of injecting additional query parameters for Radioplayer to decorate the stream URL with. The object is converted to query parameters, e.g:

{
    "key": "value"
}

will be decorated onto the existing stream url as https://your.stream/RADIO?key=value

Type declaration:

▸ (queryParams: __type): void

Parameters:

NameType
queryParams__type

unlockPlay

unlockPlay: function

Signals to the Radioplayer console that the script has finished executing its task - note if you have multiple scripts to execute, you can set numberOfUnlockers to the number of scripts you expect to be executed. Calling unlockPlay at the end of each script will ensure they have all executed before playback can start.

Type declaration:

▸ (): void