Skip to main content

End of play

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, some additional content.

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.

End of play configuration​

End of play screen content:

End of play screen is display:

PlayerDelegate {
companion object {
const val PLAYBACK_END_ERROR_MARGIN = 500
}
}

Working sample code for overwriting End Of Play data (.tsx)​

{
val conf = DivaExtraParamsMobile(
videoMetaDataMap = this::videoMetadataMapper
)


private fun videoMetadataMapper(videoMetadata: VideoMetadata): VideoMetadata {
return videoMetadata
.copy(image = imageUrl, title = "Game of Thrones", subtitle = "E3-S5")
}
}

Dictionary​

Ensure the dictionary file contains the relevant keys.

Analytics events​

Find here the available analytics events for the End of Play.