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.
Add the following lines to your dependencyResolutionManagement {...}
block
maven {
url "https://muxinc.jfrog.io/artifactory/default-maven-release-local"
}
Add the following lines to your project's build.gradle
allprojects {
repositories {
maven {
url "https://muxinc.jfrog.io/artifactory/default-maven-release-local"
}
}
}
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]'
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();
}
See full integration instructions here: https://docs.mux.com/docs/theoplayer-integration-guide.
All release notes can be found in our changelog
- Open this project in Android Studio, and let Gradle run to configure the application.
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
).
See our docs for more information.