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 against which bookmarking is done
m.bookmarksManager = FLBookmarksFactory().bookmarksManager(config, platformAuthorizer, contentId, seasonId, episodeId)

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