Include the SPECT8-OTT Android dependency in your build file:
<dependency> <groupId>org.vaudience</groupId> <artifactId>spect8-ott-android</artifactId> <version>1.0</version> </dependency>
Add overlay component
To add the overlay component to one of your activities (containing the video player) follow these steps:
change layout xml
<net.vaudience.spect8ott.OverlayView> to add the OverlayView your layout.
configure overlay in actvitiy
In the Java/Kotlin source code of your activity (most likely in your
add the following code to bootstrap the overlay:
The code above obtains a reference to the
OverlayView instance and
registers an instance providing several callbacks:
getCurrentPositionreturns the videos current time signal as a UNIX timestamp (using seconds, not milliseconds) defining the current time of the video stream, which is required for synchronizing data received from some event feed API (e.g. goal scored)
fakeTouchThis method is called from the overlay. The overlay consumes all touch events so that no video controls are shown if a button etc is touched. But if an empty space is touched we want to show the controls so we call the fakeTouch method. In this method you have to implement a way to show your video players controls. The example above shows how the controls of a native android VideoView are shown.
getBroadcastIdreturns the unique identifier of the video content. Assuming a CMS renders out a page for each streamed video, this identifier would be embedded into that page by the CMS
getTenantIdreturns the id that identifies you as a tenant/customer (we give this to you)
getUserTokenreturns some token/session-attribute that identifies a user. This token will be parsed by a backend customization, which we implement as part of your tenant setup
getAppTypereturns the type of the application which useses the overlay. A mobile app would return "APP"