Embedded Player Context and Provider

The business logic for controlling the audio stream is abstracted into it's own context and provider.

Properties

PropertyTypeDetails
rpIdstringThe ID of the radio station
showDockedPlayerbooleanIf the docked player has been called into view (if yes then embedded play button controls play back)
dockedPlayerContentPlayerContentControls what the embedded player is currently displaying (Hidden or Menu or a selection from the Menu)
videoAdPlayingbooleanIf a video advert is currently playing
primaryColorstringThe primary colour hex code (Base colour)
secondaryColorstringThe secondary colour hex code (Text and Icon colour)
dockRightbooleanIf the player should be docked in the alternate position on the right of the screen
showStartnumberThe time the current programme started relative to the audio stream
showEndnumberThe time the current programme ends relative to the audio stream
startnumberThe time the current programme should start playing from
pausedbooleanIf the audio stream is currently paused
endnumberThe time the audio stream ends (infinity if live stream)
timenumberThe current time of playback
livebooleanIf it's a live audio stream rather than OD content
seekablebooleanIf the user can change the time of playback using the Scrubber
stalledbooleanIf playback has stalled
nowPlayingNowPlaying or OnDemandItemThe metadata for the current audio stream (Name or description ect)
pulsatebooleanIf the play button should pulsate
volumenumberThe current volume of the stream
consoleUrlstringThe url used to open the radio in a popout window
stationLogostringThe logo image of the current radio station.
stationsStationListThe comprehensive list of all stations (Used predominantly for comparing fave rpIds stored in cookies)
recommendationsRecommendation[]The list of stations returned from the recommendations endpoint
relatedStationsRelatedContent[]The list of stations returned from the related endpoint
programmesOnDemandInformation[]The list of on demand content returned from the on demand endpoint
streamsStream[]The stream data used by the audio engine.
availableAppsAvailableAppLinksThe data used to display links to a third party stations app store
onDemandOnDemandItemThe data required to play back an on demand item
setShowDockedPlayerfunctionUsed to switch whether the docked player should be shown or hidden
setDockedPlayerContentfunctionUsed to change the content being shown in the player content panel (see dockedPlayerContent above)
requestPlayfunctionTriggers a change in playback of the audio stream (takes a boolean param)
requestSeekfunctionTriggers a change in the time of playback (takes a number param)
skipBackfunctionRewinds the stream by a given number of seconds - default 10 (takes a number param)
skipForwardfunctionFast forwards the stream by a given number of seconds - default 10 (takes a number param)
skipToLivefunctionSkips forward to live playback
skipToStartfunctionSkips back to the beginning of the stream
doSetVolumefunctionSets the volume (takes a number param)
onPlayStatusChangedfunctionA callback function which monitors the playback status - used for determining advert playback
onTimeUpdatedfunctionA callback function which monitors the user skipping through the stream - used for determining advert playback
changeStreamfunctionA function which switches the playback from one station to another
openPopoutfunctionOpens the requested station in a popout player (uses consoleUrl) and hides the embedded player
loadPopoutContentfunctionIf a related station does not have "streams" meta then simply opens the station in a popout
loadODContentfunctionLoads the selected on demand item into the Embedded Player