ExoPlayer (Android)

Getting started

Gradle

Gumlet insights integration with Exoplayer for Android native application helps to collect video
insights using Gumlet platform.

Follow below steps to integrate gumlet-insights-sdk-exoplayer in your android application.

Step 1: Add Gumlet Insights SDK dependency

To use "Gumlet Exoplayer Collector" add below line inside your main project (app) build.gradle

dependencies {
    implementation 'com.gumlet.gumlet-insights-sdk-exoplayer:collector-exoplayer:1.0.3'
}

Step 2: Initialise the Gumlet SDK

// Add an import for Gumlet Insights library
import com.gumlet.insights.GumletInsightsConfig;
import com.gumlet.insights.exoplayer.ExoPlayerCollector;

// Initialize the Exoplayer
SimpleExoPlayer.Builder exoBuilder = new SimpleExoPlayer.Builder(this);
exoBuilder.setBandwidthMeter(bandwidthMeter);
player = exoBuilder.build();
player.addListener(this);

// Create Gumlet Insights config object
gumletInsightsConfig = new GumletInsightsConfig("<PROPERTY-ID>",this);

// Create Gumlet Insights Collector object
gumletAnalytics = new ExoPlayerCollector(gumletInsightsConfig, MainActivity.this);

// Attach ExoPlayer to Gumlet Inightss Collector object
gumletAnalytics.attachPlayer(player);

// Attach the media to the player and call the play function for ExoPlayer