Squeeze back
What you learn
You're instantiating DIVA Player in your web front-end and relying on DIVA Back Office as the video streaming source.
The goal of this article is to build the simplest front-end 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 the DIVA Back Office instance you rely on is up and running.
- Ask your video engineers team the
<video id>and the related<settings URL>. - Ensure the videodata contains the squeezeBackTime property.
- Ensure the videodata contains the countdownToAutoplay and timeToDisableAutoplay properties.
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 App() function to read the VideoMetadataMap as in the following example, and set the squeezeBackTime property:
10000default value if not set0to set no 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
10000the squeezeback starts when remain 10 seconds to the video end).
"behaviour": {
"endOfPlay": {
"squeezeBackTime":10000 //milliseconds, default 10000, 0 or negative means disabled
},
}
Working sample code for overwriting Squeeze Back data (.tsx)
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.