Skip to main content

Cloud Bookmarks

The bookmarks library is a personalization library that provides bookmarking service for Continue Watching feature. The library facilitates bookmarking any content at different stages of playback and also provides API to retrieve the bookmarked offset time to start playback from last watched position.

The FLBookmarkService is the interface for bookmarking contract which has all the APIs to perform different bookmarking operations (Put, Delete & Get bookmark records). The FLBookmarksManager is composed on bookmark service to manage bookmarking with FLPlayer.

Usage

Create BookmarkService

Create bookmark service
bookmarkService = FLBookmarksFactory().bookmarkService(endPoint, platformAuthorizer)

Create BookmarksManager

Create bookmarks manager
syncInterval = 5000
threshold = 0.95
config = FLBookmarksFactory().bookmarkConfiguration(endPoint, syncInterval, threshold)

' contentId is the unique id of next content against which bookmarking is done
' seasonId is the unique id of next content season applicable only for episodic content
' episodeId is the unique id of next content episode applicable only for episodic content
' mode is the unique identifier of the mode of a next content. values - series, episode or musicvideo
nextEpisodeAssets =FLBookmarksFactory().bingeWatchAsset(contentId, seasonId, episodeId, mode)

' contentId is the unique id against which bookmarking is done
' seasonId is the unique id of season applicable only for episodic content
' episodeId is the unique id of episode applicable only for episodic content
' mode is the unique identifier of the mode of a content. values - series, episode or musicvideo
' nextEpisodeAssets is the asset details or next episode. Default - invalid
' musicId is the unique identifier of music video
m.bookmarksManager = FLBookmarksFactory().bookmarksManager(config, platformAuthorizer, contentId, seasonId, episodeId, mode, nextEpisodeAssets, musicId)

Bookmark Content

The FLBookmarksManager has methods to process bookmarking at different stages of playback. These methods should be invoked on FLPlayer's value change on fields PLAYBACK_STATE and CURRENT_TIME.

Process state change and progress change with bookmark manager

sub initializeFLPlayer()
...

m.flPlayer.observeField(m.flPlayerFields.PLAYBACK_STATE, "onPlaybackStateChanged")
m.flPlayer.observeField(m.flPlayerFields.CURRENT_TIME, "onPlayheadPositionChanged")

...
end sub

sub onPlaybackStateChanged(event as Object)
if m.bookmarksManager <> invalid
' Perform bookmarking only for VOD
if not flPlayer.callFunc(flPlayerFunctions.IS_LIVE) then m.bookmarksManager.processPlaybackStateChange(m.flPlayer)
end if
end sub

sub onPlayheadPositionChanged(event as Object)
if m.bookmarksManager <> invalid
if not flPlayer.callFunc(flPlayerFunctions.IS_LIVE) then m.bookmarksManager.processProgressChange(m.flPlayer)
end if
end sub