Android Integration


Include the SPECT8-OTT Android dependency in your build file:

Maven (pom.xml):


Gradle (build.gradle):

compile "org.vaudience:spect8-ott-android:1.0"

Add overlay component

To add the overlay component to one of your activities (containing the video player) follow these steps:

change layout xml

Add <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 onCreate() method) add the following code to bootstrap the overlay:

// configure Overlay
val overlayView = findViewById<OverlayView>(
overlayView.callbacks = object : OverlayCallbacks {
    override fun getCurrentPosition(): Long {
        return videoView.currentPosition
    override fun fakeTouch() {
    getBroadcastId: function () {
        return "the-broadcast-id"; 
    getTenantId: function () {
        return "your-tenant-id";
    getUserToken: function () {
        return "some-token-from-your-infrastructure-identifying-the-user";
    getAppType: function () {
        return "type-of-app-that-integrates-the-overlay";

The code above obtains a reference to the OverlayView instance and registers an instance providing several callbacks:

  • getCurrentPosition returns 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)
  • fakeTouch This 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.
  • getBroadcastId returns 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
  • getTenantId returns the id that identifies you as a tenant/customer (we give this to you)
  • getUserToken returns 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
  • getAppType returns the type of the application which useses the overlay. A mobile app would return "APP"