Skip to main content

Live Playback

To play a live stream from Quickplay Platform, follow the steps described in Secure Playback, and update the platform asset to indicate you are trying to play a Live stream.

A PlatformAsset for playing a Live Stream could be constructed with APIs from ContentAuthorizer by providing the following:

  • Content Id: Unique identifier of the content
  • Media Format: HLS | DASH
  • DRM: Widevine | Playready
  • Content Type: Live
  • Catalog Type: channel | event | sportsliveevent
  • Playback Mode: Live | Restart | Catchup
  • Start Time: Start time of the Live Program
    • Required for playback modes restart and catchup, optional otherwise
  • End Time: End time of the Live Program
    • Required for playback mode catchup, optional otherwise
Create live asset
ssaiDisabled = true
' create live streaming asset
platformAsset = FLContentAuthorizerFactory().liveAsset(contentId, catalogType, FLMediaFormat().DASH, FLDrmTypes().WIDEVINE, ssaiDisabled)

Playback Modes

Restart

If you are looking to offer Restart or Play from Beginning feature for your users, setup the asset as shown below.

Create live restart asset
ssaiDisabled = true
' create live streaming asset
platformAsset = FLContentAuthorizerFactory().liveRestartAsset(contentId, catalogType, FLMediaFormat().DASH, FLDrmTypes().WIDEVINE, ssaiDisabled, startTime, endTime)

Catchup

If you are looking to offer Catchup on an already ended Live program for your users, setup the asset as shown below. The startTime and endTime indicate the program start time and end time respectively and these are mandatory when trying to play in catchup mode.

Create live catchup asset
' create live streaming asset
platformAsset = FLContentAuthorizerFactory().liveCatchupAsset(contentId, catalogType, FLMediaFormat().DASH, FLDrmTypes().WIDEVINE, ssaiDisabled, startTime, endTime)
note

seekToLiveEdge API would be a no-op while playing catchup stream. If you are looking to jump to current live edge of a Catchup playback, you must re-authorize the playback in live playbackMode and setup a new player instance.

Seeking in live streams

When playing a Live stream, the player always starts playing from the Live Edge. To seek anywhere within the live window, you can use the standard seek APIs, refer to Basic Playback. The seek position is always relative to the start of the live window. The player will try to maintain the same live offset after a seek.

To force the player to play from Live Edge of the current Live Window, use the seekToLiveEdge API. The currentOffsetFromLiveEdge API can be used to determine if the player is currently playing at or beginning the Live Edge.

Listening to live program end

When playing a live program or event, Quickplay platform authorizes the playback for the current action program/event. program/event should be re-authorized again.

When the current live program (restart, live modes) ends, player emits an event with eventName as FLLiveEvents().LIVE_PROGRAM_END. The event can be observed by registering field observer on FLPlayer field LIVE_EVENT.

Listening to live events from player
sub initializeFLPlayer()
...

m.flPlayer.observeField(m.flPlayerFields.LIVE_EVENT, "onLiveEvent")

...
end sub

sub onLiveEvent(event as Object)
? "Live Event: ", event.getData()
end sub

Live Event Object

A live event object is an assocarray containing name of the event, suggested action and associated metadata if any.

KeyTypeValue
NamestringName of the event(liveProgramStart, liveProgramEnd, liveEventStart, liveEventEnd, overflowEventEnd, blackout or gameEvent)
SuggestedActionstringNone, StartPlayback or StopPlayback
MetadatadynamicMetadata if any associated with the event