Skip to main content

Player Configuration

Setting Initial Playback Time

The initial time from which player should start playback. This property must be set on player prior to playback start.

Set initial playback time
' setting initial playback start position to 300 seconds (5 mins)
m.flPlayer.setField(m.flPlayerFields.INITIAL_PLAYBACK_TIME, 300)

Setting HTTP Redirect

The property is useful when dealing with URL redirects. A boolean value needs to be assigned to this property.

Set http redirect value
' setting http redirect boolean value to true
m.flPlayer.setField(m.flPlayerFields.STREAM_STICKY_HTTP_REDIRECTS, true)

Thumbnail Preview

Thumbnail Preview is a functionality that allows users to fetch a preview image of the content frames while seeking/trickplay for a given playhead position.

The FLPlayer supports custom keyframe thumbnail solution using sprite sheets with Quickplay Platform for VOD contents.

Setup Thumbnail Preview

The thumbnail configuration must be shared with the ASSET that is set on FLPlayer.

note

Since 2048 is the max bitmap resolution supported on roku, the maximum width of thumbnails are restricted to this limit.

Set Thumbnail configuration with Content

The configuration describes the dimensions and duration of each image of each sprite. In addition to the configuration, thumbnail end point must be set on the FLPlayer. The player generates complete sprite urls with endpoint and configuration, using which sprites are downloaded and thumbnails served.

Keyframe configuration
content.keyframe = {
name: '1629429659583-sprite-192x108-~index~.jpg',
frequency: 6,
width: 192,
height: 108,
rows: 10,
columns: 10,
};

' After player creation
m.flPlayer.setField(m.flPlayerFields.THUMBNAIL_ENDPOINT, thumbnailEndpoint)

NameTypeDescription
noOfcolumnsIntThe number of columns in each sprite image.
noOfRowsIntThe number of rows in each sprite image.
keyFrameDurationIntThe time (in seconds) that each thumbnail in each sprite image corresponds to.
thumbnailWidthIntThe width (in pixels) of each thumbnail in each sprite image.
thumbnailHeightIntThe height (in pixels) of each thumbnail in each sprite image.
note

An asset obtained upon authorization from Quickplay platform can be directly set to ASSET field as is for playback. The asset contains the keyframe configuration. However thumbnail endpoint must be set on player separately.

Implement Thumbnail Preview

Calling getThumbnail API

The preview image for a particular position can be obtained by calling the getThumbnail function on the FLPlayer node instance. The API returns the preview image url for the given position in the form as a string.

Get thumbnail image
' `seekTime` is the playhead position
' `callContext` is the context object from where the call is made. Most often this would be a SceneGraph component.
' `onThumbnailChange` is the handler that is executed on callback. Note this handler must be declared on `callContext` instance
m.flPlayer.callFunc(m.flPlayerFunctions.GET_THUMBNAIL, seekTime, callContext, "onThumbnailChange")

This function is typically called in tandem with a scrub bar listener attached to the FLPlayer which listens to all the seeking activity from the user.

Thumbnail Callback

The thumbnail callback is invoked with position and thubnail path by the player. This path can be set to the uri property of poster to render thumbnails.

Set thumbnail image
function onThumbnailChange(position as Integer, thumbailUrl as String)
if (thumbailUrl <> invalid)
' Set thumbnail to poster
end if
end function