Embedded Player Context and Provider
The business logic for controlling the audio stream is abstracted into it's own context and provider.
Properties
Property | Type | Details |
---|---|---|
rpId | string | The ID of the radio station |
showDockedPlayer | boolean | If the docked player has been called into view (if yes then embedded play button controls play back) |
dockedPlayerContent | PlayerContent | Controls what the embedded player is currently displaying (Hidden or Menu or a selection from the Menu) |
videoAdPlaying | boolean | If a video advert is currently playing |
primaryColor | string | The primary colour hex code (Base colour) |
secondaryColor | string | The secondary colour hex code (Text and Icon colour) |
dockRight | boolean | If the player should be docked in the alternate position on the right of the screen |
showStart | number | The time the current programme started relative to the audio stream |
showEnd | number | The time the current programme ends relative to the audio stream |
start | number | The time the current programme should start playing from |
paused | boolean | If the audio stream is currently paused |
end | number | The time the audio stream ends (infinity if live stream) |
time | number | The current time of playback |
live | boolean | If it's a live audio stream rather than OD content |
seekable | boolean | If the user can change the time of playback using the Scrubber |
stalled | boolean | If playback has stalled |
nowPlaying | NowPlaying or OnDemandItem | The metadata for the current audio stream (Name or description ect) |
pulsate | boolean | If the play button should pulsate |
volume | number | The current volume of the stream |
consoleUrl | string | The url used to open the radio in a popout window |
stationLogo | string | The logo image of the current radio station. |
stations | StationList | The comprehensive list of all stations (Used predominantly for comparing fave rpIds stored in cookies) |
recommendations | Recommendation[] | The list of stations returned from the recommendations endpoint |
relatedStations | RelatedContent[] | The list of stations returned from the related endpoint |
programmes | OnDemandInformation[] | The list of on demand content returned from the on demand endpoint |
streams | Stream[] | The stream data used by the audio engine. |
availableApps | AvailableAppLinks | The data used to display links to a third party stations app store |
onDemand | OnDemandItem | The data required to play back an on demand item |
setShowDockedPlayer | function | Used to switch whether the docked player should be shown or hidden |
setDockedPlayerContent | function | Used to change the content being shown in the player content panel (see dockedPlayerContent above) |
requestPlay | function | Triggers a change in playback of the audio stream (takes a boolean param) |
requestSeek | function | Triggers a change in the time of playback (takes a number param) |
skipBack | function | Rewinds the stream by a given number of seconds - default 10 (takes a number param) |
skipForward | function | Fast forwards the stream by a given number of seconds - default 10 (takes a number param) |
skipToLive | function | Skips forward to live playback |
skipToStart | function | Skips back to the beginning of the stream |
doSetVolume | function | Sets the volume (takes a number param) |
onPlayStatusChanged | function | A callback function which monitors the playback status - used for determining advert playback |
onTimeUpdated | function | A callback function which monitors the user skipping through the stream - used for determining advert playback |
changeStream | function | A function which switches the playback from one station to another |
openPopout | function | Opens the requested station in a popout player (uses consoleUrl) and hides the embedded player |
loadPopoutContent | function | If a related station does not have "streams" meta then simply opens the station in a popout |
loadODContent | function | Loads the selected on demand item into the Embedded Player |