Squeeze back
What you learn​
You're instantiating DIVA Player in your app 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
<videoId>
,<settingsURL>
,<languageCountryCode>
,<userToken>
and<sharedKey>
. - 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 queezeBackTime property that the VideoMetadata/Endofplay contains.
Squeeze back configuration​
Write the App() function to read the VideoMetadataMap as in the following example, and set the squeezeBackTime
property:
0
default value if not set, no squeeze back10000
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​
private fun videoMetadataMapper(videoMetadata: VideoMetadata): VideoMetadata {
val endOfPlay = videoMetadata.behaviour.endOfPlay.copy(squeezeBackTime = 20000)
return videoMetadata.copy(behaviour = videoMetadata.behaviour?.copy(endOfPlay = endOfPlay))
}
Behaviour​
Ads and Squeeze Back Integration​
- If Squeeze Back is active, client-side ads will automatically be skipped.
- This feature does not apply to live video streams.
Video Playback​
- When no Squeeze Back time is set (0), the user is directed straight to the Endboard upon video completion.
- When Squeeze Back time is enabled (e.g., set to a non-zero value), the video playback is reduced in scale and moved to the top-right corner of the screen for the duration of the Squeeze Back period or until the video ends.
- For RTL (right-to-left) languages, the minimized video window will be positioned on the top-left of the screen.
- The Squeeze Back period is controlled by a specific value set in the VideoMetaData object, which represents the number of milliseconds before the video ends when the Endboard will appear.
- If the Squeeze Back threshold is reached, the video shrinks to a small window in the top right corner (or top left in RTL mode), and the Endboard appears. Users may continue watching the minimized video while engaging with the Endboard.
- If no Squeeze Back is set (e.g., Squeeze Back time = 0), the Endboard is displayed without reducing the video size.
- If Squeeze Back is enabled (e.g., 20 seconds before video ends), the video continues to play in a minimized window alongside the Endboard. Upon video completion, the window disappears and focus returns to the Endboard options.
Chromecast Support:​
- When casting to Chromecast, the Squeeze Back feature is disabled on the sender device.
Endboard Interaction​
- Users can interact with the minimized video window during Squeeze Back, allowing them to restore the video to full screen mode.
- Once the video ends, the minimized window is hidden, and the Endboard is fully presented, allowing users to navigate between post-video options (e.g., replay button).
Dictionary​
No additional traslations needed.
Analytics events​
Find here the available analytics events for the Squeeze back.