Skip to content

muxinc/mux-stats-sdk-theoplayer-android

Repository files navigation

Mux Stats SDK THEOPlayer

This is the Mux wrapper around THEOPlayer, built on top of Mux's core Java library, providing Mux Data performance analytics for applications utilizing THEOPlayer.

Setup and Usage

Add the Mux THEOPlayer SDK to your build

Using settings.gradle

Add the following lines to your dependencyResolutionManagement {...} block

maven {
  url "https://muxinc.jfrog.io/artifactory/default-maven-release-local"
}

Using build.gradle

Add the following lines to your project's build.gradle

allprojects {
    repositories {
        maven {
          url "https://muxinc.jfrog.io/artifactory/default-maven-release-local"
        }
    }
}

Add the SDK as a Dependency in your application

Add one the following lines to the dependencies block in your app module's build.gradle, depending on which THEOPlayer library you are using. The current version can be found in our Integration Guide

implementation 'com.mux.stats.sdk.muxstats:muxstatssdktheoplayer:[CurrentVersion]'

Monitor THEOPlayer using Mux Data

The Mux Data SDK for THEOPlayer can be used by creating a new instance of MuxStatsSDKTHEOPlayer with the desired configuration. The constructor requires a THEOplayerView, which Mux will observe for data events.

// Initialize with data about you, your video, and your app
CustomerPlayerData customerPlayerData = new CustomerPlayerData();
customerPlayerData.setEnvironmentKey("YOUR_ENVIRONMENT_KEY_HERE");
CustomerVideoData customerVideoData = new CustomerVideoData();
customerVideoData.setVideoTitle("VIDEO_TITLE_HERE");
CustomData customData = new CustomData();
customData.setCustomData1("YOUR_CUSTOM_STRING_HERE");
CustomerData customerData = new CustomerData(customerPlayerData, customerVideoData, null);
customerData.setCustomData(customData);

// Create a new Mux Stats monitor 
muxStatsSDKTHEOplayer = new MuxStatsSDKTHEOPlayer(this,
        theoPlayerView, "demo-view-player",
        customerData);

// Set the size of the screen
Point size = new Point();
getWindowManager().getDefaultDisplay().getSize(size);
muxStatsSDKTHEOplayer.setScreenSize(size.x, size.y);

You must also release the MuxStatsTHEOPlayer object when your component's lifecycle is ending. For example:

@Override
public void onDestroy() {
    muxStatsTHEOplayer.release();
    super.onDestroy();
}

Further Reading

See full integration instructions here: https://docs.mux.com/docs/theoplayer-integration-guide.

All release notes can be found in our changelog

Contributing

Developer Quick Start

  • Open this project in Android Studio, and let Gradle run to configure the application.

Style

The code in this repo conforms to the Google Java Style Guide. Run the reformatter on files before committing. The code was formatted in Android Studio/IntelliJ using the Google Java Style for IntelliJ. The style can be installed via the Java-style section of the IDE preferences (Editor -> Code Style - >Java).

Documentation

See our docs for more information.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 9