Streamhub Analytics plugin for Brightcove SDK for Android

To start tracking your videos from your Android OS based apps with
Streamhub, please follow these implementation instructions.

Build Configurations

1. Get the Streamhub Analytics plugin

Download and extract the archive from

2. Place the plugin project

Currently, since the plugin is not provided as a binary file, you just need to drop the plugin implementation files somewhere under your project structure.

3. Edit build configuration file

To compile the plugin into your app you need to add
StreamhubBrightcovePlugin into your build.gradle:

dependencies {

compile project(':StreamhubBrightcovePlugin')


4. Get your Streamhub analyticsId

Your analyticsId will be or has already been provided by Streamhub to you. Use this ID in the implementation steps described next.


What you need to do is very simple as following 2 steps:

1. Add import for the plugin


2. Initialise the plugin

public class MainActivity extends Activity {
    private final String TAG = this.getClass().getSimpleName();

    BrightcoveVideoView bcVideoView;

    protected void onCreate(Bundle savedInstanceState) {


        bcVideoView = 
                (BrightcoveVideoView) findViewById(;

        Catalog catalog = new Catalog("<Brightcove Catalogue ID>");
        catalog.findVideoByID("<Video ID>", new VideoListener() {
            public void onVideo(Video video) {

        // Initialise StreamhubAnalytics plugin for Brightcove
        // Arg1: Context
        // Arg2: BrightcoveVideoView
        // Arg3: playerId - Must be unique in your system and communicated to us
        // e.g. Use a UUID version 4
        // Arg4: analyticsId - this ID is provide by Streamhub
        new StreamhubAnalytics(this, bcVideoView, 

Confirm the plugin is integrated

Here is the ways to confirm the plugin is integrated properly into your app.

  1. You may see “StreamhubAnalytics” tag in logcat, if StreamhubAnalytics plugin is built into your app properly.
  2. The app requests to in the following cases:
    • every 5 seconds in the first 60 seconds position of the video
    • every 1 minute (after the first 60 seconds) afterwards


Streamhub Data Flow

Streamhub Data Flow

Figure: Streamhub Data Flow with external sources