Skip to main content

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​

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:

  • 10000 default value if not set
  • 0 to 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 10000 the 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.