Squeeze back
What you learn​
You are instantiating DIVA Player in your Roku application and relying on DIVA Back Office as the video streaming source.
The goal of this article is to build the simplest Roku application to stream a video from the DIVA Back Office with, at the end, the activation of squeeze back in combination with end of play.
Before starting​
- Ensure
Diva Player lib
andDIVA Back Office Adapter lib
downloaded (Setup > Step 13). - Ask your video engineers team the
<video id>
and the related<settings URL>
. - Ensure the VideoMetadata contains the squeezeBackTime property.
Instantiation​
Write the Basic instantiation code. There's no additional code to write, unless you need to overwrite the autoplay behavior that the VideoMetadata contains.
Squeeze back configuration​
Write the observer on the field m.boAdapterNode.videoDataNode
to get the VideoMetadataMap as in the following example, and set the squeezeBackTime
property:
-
0
default value if not set, no squeeze back -
10000
to set the squeeze back -
A positive integer that specifies the number of milliseconds before the end of the video when the Diva Player starts the squeezeback. (eg: with
10000
the squeezeback starts when remain 10 seconds to the video end).
"behaviour": {
"endOfPlay": {
"squeezeBackTime":0 //milliseconds, default 0, 0 or negative means disabled
},
}
Working sample code for overwriting Squeeze Back data (.brs)​
sub launchBOAdapter(divaLaunchParams as object)
...
' Observe BO Adapter VideoMetaDataNode
m.boAdapterNode.observeField("videoDataNode", "onBOAdapterVideoDataNodeHandler")
...
end sub
sub onBOAdapterVideoDataNodeHandler(evt as dynamic)
data = evt.getData()
data.addFields({
"behaviour": {
"endOfPlay": {
"squeezeBackTime":10000 'milliseconds, default 10000, 0 or negative means disabled
},
}
})
' Setup Diva Player Metadata
m.dpUtilsNode.callFunc("setMetaData", data)
end sub
Dictionary​
No additional traslations needed.
Analytics events​
Find here the available analytics events for the Squeeze back.