Giter VIP home page Giter VIP logo

mux-stats-sdk-theoplayer-android's Introduction

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

// Use this line for the minApi 16 version of Theoplayer
implementation 'com.mux.stats.sdk.muxstats:muxstatssdktheoplayer_minapi16:[CurrentVersion]'
// Use this line for the minApi 21 version of Theoplayer
implementation 'com.mux.stats.sdk.muxstats:muxstatssdktheoplayer_minapi21:[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.

Theoplayer Version Support

Version 0.1.x of the Mux THEOPlayer SDK has been tested against 3.x and 2.x versions of the THEOPlayer SDK

Releases

The current version of the SDK is v0.1.2, as of 3/7/2022

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.
  • Build variants can be selected to support different versions of THEOPlayer. There is a separate MuxStatsTHEOPlayer implementation for each variant, though they inherit from a common base class

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).

Known Limitations

  • No supported version of THEOPlayer can be specified in the package metatdata. Version-specific library flavors are planned for v1.0.0

Documentation

See our docs for more information.

mux-stats-sdk-theoplayer-android's People

Contributors

daytime-em avatar jsanford8 avatar com6056 avatar nbirkenshaw-mux avatar tomkordic avatar ulyssesdotcodes avatar bardiaalavi-2020 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.