NAV
     

Anvato Android SDK

This development guide shows you how to use the Anvato Player SDK to add the Anvato Player to your Android Application and play videos.

About Anvato Android SDK

Anvato Android SDK is a complete set of software that allows Android developers to rapidly create applications that can

Benefits of Anvato Android SDK

Aside from rapid development environment, the native Android player has the following limitations.

Features

Analytics

Anvato Android SDK provides several types of plugins for data tracking and analytics purposes. Following plugins are currently provided:

Monetization

Overview

Anvato Android SDK provides two types of monetization options using digital ads.

As Anvato, we strongly suggest server side ad-stitching over client side ads for the following reasons.

Client-Side Ads

Getting client side ads using either DFP or Freewheel is relatively simply. The application needs to provide an adTagURL using which the SDK will fetch VAST ads.

DFP Settings

Application can set DFP settings before using load to play video by using the APIs in the dfp namespace of the AnvatoConfig instance. Anvato Android SDK will use these settings in post object which is used to get video data from backend servers. setDFPParam function is used to set dfp parameters of config. setDFPClientParam function is used to set client side dfp parameters of config. setDFPClientCustomParam function is used to set client side dfp custom parameters for customer of config.

Freewheel Settings

AnvatoConfig.getInstance().plugin.enablePlugin( AnvatoConfig.Plugin.freewheel );
AnvatoConfig.getInstance().freewheel.setFWParam( AnvatoConfig.FWParam.ad_tag_url , "[YOUR_AD_TAG_URL]" );

For Freewheel, the application may simply pass an add tag URL using Anvato Config object.

Server-Side Ads

DFP Settings

Application can set DFP settings before using load to play video by using the APIs in the dfp namespace of the AnvatoConfig instance. Anvato Android SDK will use these settings in post object which is used to get video data from backend servers. setDFPParam function is used to set dfp parameters of config. setDFPClientParam function is used to set client side dfp parameters of config. setDFPClientCustomParam function is used to set client side dfp custom parameters for customer of config.

Freewheel Settings

AnvatoConfig.getInstance().plugin.enablePlugin( AnvatoConfig.Plugin.freewheel );
AnvatoConfig.getInstance().freewheel.setParam( AnvatoConfig.FWParam.server_url.toString() , "[SERVER_URL]" );
AnvatoConfig.getInstance().freewheel.setParam( AnvatoConfig.FWParam.network_id.toString() , "[NETWORK_ID]]" );
AnvatoConfig.getInstance().freewheel.setParam( AnvatoConfig.FWParam.video_asset_id.toString() , "[ASSET_ID]]" );
AnvatoConfig.getInstance().freewheel.setParam( AnvatoConfig.FWParam.site_section_id.toString() , "[SITE_SECTION_ID]" );
AnvatoConfig.getInstance().freewheel.setParam( AnvatoConfig.FWParam.profile_id.toString() , "[PROVIDE_ID]" );

Application can set Freewheel settings before loading video using AnvatoConfig instance.

Entitlement

Overview

The Anvato Entitlement services allows for entitlement checks to be conducted before or during media playback based on different metrics like user's max rating, location and authorization to watch the content . The application can use the accessConfig object of the Anvato Config to set the SDK to do an automatic entitlement check before loading the video or on program boundaries. The following outlines the different checks we can configure for checking if user is entitled to watch a video.

Successful authentication results in the SDK sending a ANV_DATA_EVENT_ADOBEPASS_AUTHZ_SUCCESS data event. If the authentication is unsuccessful, the SDK prompts with a ANV_DATA_EVENT_ADOBEPASS_AUTHZ_FAILURE data event which indicates the user is not allowed to watch the content.

Anvato also provides TV Everywhere check. This can be set using the onStartTVE and onTuneTVE config parameters of the accessConfig object. The TVE check allows the Anvato backend to analyze the users geolocation, home station and mvpd to determine if the user is allowed to watch th requested stream. On successful check, the SDK returns a ANV_DATA_EVENT_TVE_CHECK_SUCCESS data event and ANV_DATA_EVENT_TVE_CHECK_FAILURE on a failed TVE check. If the application is handling adobepass on its own, the application needs to provide the MVPD ID and location to the SDK. This can be done via the userInfo object of the AnvatoConfig. More information regarding how to configure the SDK to enable or disable these checks can be found on a later section dealing with Configuring the SDK.

Reliable Streaming

This section describes the fallbacks in case there is a network error.

Large Screen Support

This section describes large screen support.

Chromecast

The Anvato Android SDK can stream current playing content to chromecast devices. The SDK establishes a connection between android device and chromecast device. Moreover, the SDK handles events related with playback on chromecast so that application side will be notified.

More information regarding connecting and disconnecting to chromecast devices is covered in the Plugins-Chromecast section

Development Guide

This section describes all the mandatory steps to integrate Anvato Android SDK into your application.

  1. Importing the SDK to your workspace
  2. Handling dependencies
  3. Configuring Manifest File
  4. Adding Anvato UI Components
  5. Code Integration
  6. Load a Video

Importing the SDK

Integrate the SDK, please download the latest copy of AnvatoAndroidSDK-release.aar from the developer portal. This section explains how to include the SDK in your project.

Android Studio 1.3.1+

In order to import these projects(modules) into your project;

Android Studio 1.3.1

Dependencies

Depending on your application requirements there may be additional libraries that you have to include. The SDK is weak linked to those libraries, meaning that your application will compile even without those libraries however you will not experience the desired behavior if the appropriate third party dependencies are not included.

Project Settings

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.anvato.anvatorefapp">
  <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
  <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
  <uses-permission android:name="android.permission.INTERNET"/>
  <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
  <uses-permission android:name="android.permission.WAKE_LOCK"/>
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
  <application android:allowBackup="true" android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" android:theme="@style/AppTheme" >
    <!-- Enable if your application is going to use Adobe Pass  -->
    <service
      android:name="com.adobe.adobepass.accessenabler.api.AccessEnablerService"
      android:label="AccessEnabler service" />
    <!-- Enable if your application is going to use Chromecast Library  -->
    <meta-data android:name="com.google.android.gms.version"
      android:value="@integer/google_play_services_version"/>
    <!-- Enable if your application is going to use Chromecast Library  -->
    <service
      android:name="com.google.android.libraries.cast.companionlibrary.cast.reconnection.ReconnectionService"
      android:label="ReconnectionService service"/>
    <!-- User chooses an mvpd to login -->
    <activity
      android:name="com.anvato.androidsdk.data.adobepass.MvpdPickerActivity"
      android:configChanges="orientation|keyboard|keyboardHidden|screenSize|screenLayout|uiMode"
      android:theme="@style/AppTheme"
      android:windowSoftInputMode="stateHidden" >
    </activity>
    <!-- User gets authenticated using this one -->
    <activity
      android:name="com.anvato.androidsdk.data.adobepass.MvpdLoginActivity"
      android:configChanges="orientation|keyboard|keyboardHidden|screenSize|screenLayout|uiMode"
      android:theme="@style/AppTheme" >
    </activity>
  </application>
</manifest>

This section explains how to edit Android Manifest XMl file to use Anvato Android SDK. Changes are needed in the following sections:

Please note that, for the specific integration layer that you use, there can be more items that need to be configured.

Permission Definition
android.permission.ACCESS_FINE_LOCATION (optional) Allows applciations to access precise location from location sources. This is used for entitlement check processes.
android.permission.ACCESS_NETWORK_STATE Allows applications to access information about networks. This is used for network monitoring during playback.
android.permission.ACCESS_WIFI_STATE (OPTIONAL - Chromecast) Allows applications to access information about WIFI states. This is used for chromecast device monitoring.
android.permission.INTERNET Allows the application to use internet.
android.permission.READ_EXTERNAL_STORAGE Allows an application to read to external storage for caching.
android.permission.WAKE_LOCK Allows keeping the screen from locking or dimming during playback.
android.permission.WRITE_EXTERNAL_STORAGE Allows an application to write to external storage for caching.
Services Definition
AccessEnabler Allows the application to communicate with the AdobePass AccessEnabler service
ReconnectionService (OPTIONAL - Chromecast) Allows the application to handle reconnect flow of Chromecast.
VideoCastNotificationService (OPTIONAL - Chromecast) Allows the application to handle notification flow of Chromecast.
Activities Definition
MvpdLoginActivity The default activity that presents the AdobePass MVPD login page.
MvpdPickerActivity The default activity that presents the AdobePass MVPD picker page.

UI Components

<com.anvato.androidsdk.player.AnvatoPlayerUI
  android:id="@+id/anvatoPlayer"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:background="#FF000000" />

This section explains how to add Anvato Android SDK's UI component to your application. Anvato Player UI component consists of

Please note that, changes to individual UI components such as visibility change can be done via API calls which will be explained in the UI customization section. Open the layout xml file that Anvato Player is supposed to be in and place Anvato Android SDK's UI component where you would like to present the player UI.

Implementation

// STEP 3: AnvatoEventListener Interfaces
public class MainActivity extends Activity implements AnvatoVideoEventListener, AnvatoDataEventListener
{
// STEP 1: Define Anvato variable as class members.
String anvack;
String anvSeckey;
AnvatoConfig anvConfig;
AnvatoSDK anvSDK;
AnvatoPlayerUI anvPlayerUI;

@Override
protected void onCreate(Bundle savedInstanceState)
{
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  // STEP 1.1: Set your ANVACK & Seckey pair and init UI elements
  anvack = "YOUR_ANVACK_PROVIDED_BY_ANVATO";
  anvSeckey = "YOUR_SECKEY_PROVIDED_BY_ANVATO";
  anvPlayerUI = (AnvatoPlayerUI) findViewById(R.id.anvatoPlayer);
  try
  {
    // STEP 2: Init Anvato Config.
    anvConfig = AnvatoConfig.createNew(MainActivity.this, anvack, anvSeckey, new JSONObject());
    if (anvConfig == null)
    {
      AnvtLog.e(TAG, "Something went bad? Internet?");
      return;
    }
    // CUSTOMIZATION CODE WILL COME HERE
    // STEP 4: Creating anvato SDK
    anvSDK = AnvatoSDK.getInstance(this, this, this);
    // STEP 5: this is where we marry the UI components with the SDK.
    anvSDK.video.initPlayer(this, anvPlayerUI);
  }
  catch (AnvatoSDKException e)
  {
    AnvtLog.e(TAG, "Unable to initialize AnvatoSDK: " + e.getLocalizedMessage());
  }
}

// STEP 3: callback method for AnvatoDataEventListener
@Override
public boolean onDataEvent(SDKDataEvent event, Bundle extra, Object dataObject)
{
  if (event == SDKDataEvent.SDK_READY)
  {
  //SDK is in ready state. We can now load a video
    anvSDK.video.load("YourMCPVideoID", AnvatoVideoType.VIDEO_TYPE_MCP, AnvatoPlaybackOptions.getInstance());
  }
  return false;
}

// STEP 3: callback method for AnvatoVideoEventListener
@Override
public boolean onVideoEvent(VideoEvent videoEvent, Bundle extra)
{
  return false;
}

@Override
protected void onPause()
{
  // STEP 6 Activity Life-Cycle handling
  if (anvSDK != null)SDKDataEvent List
  {
    anvSDK.onPause();
  }
  super.onPause();
}

@Override
public void onResume()
{
  // STEP 6 Activity Life-Cycle handling
  super.onResume();
  if (anvSDK != null)
  {
    anvSDK.onResume();
  }
}
}

This section explains how to integrate Anvato Android SDK in your application code.

  1. Prepare Anvato initialization values.
  2. Initializing Anvato Configuration
  3. Creating event listeners
  4. Initializing Anvato Android SDK
  5. Registering Anvato Player UI Components with SDK
  6. Activity Life-Cycle handling

Before the application initialize the AnvatoSDK, it should already have two unique values anvack and anvSecKey. These are customer specific values that should be given to you by Anvato. They're used in AnvatoConfig initialization to retrieve your specific configuration from the backend. Also, AnvatoPlayerUI, the UI component, have to be declared in your activity's layout xml file.

Next step is to initialize the Anvato configuration. AnvatoConfig is the core class that holds configuration data of Anvato Android SDK. As mentioned above, it uses anvack and anvSeckey to create a instance that contains your specific configuration values. New AnvatoConfig instance could be created at any time and independently from Anvato Android SDK lifecycle. Moreover, the application can update and override any parameter of configuration data by calling related method in AnvatoConfig instance. For more information on AnvatoConfig, please refer to the configuration guide.

Next step is creating the event listeners. There are 2 types of events to be listened to in Anvato Android SDK, AnvatoVideoEvent and SDKDataEvent. AnvatoVideoEvent is related with video playback events and SDKDataEvent is mainly related with authentication, authorization, feed events. AnvatoVideoEvent can be listened to by implementing AnvatoVideoEventListener, SDKDataEvent can be listened to by implementing AnvatoDataEventListener interface. These event listener(interfaces) have to be implemented before SDK instantiation since they need to be passed to the SDK at creation time. To learn more about the events, please refer to the events section.

Now it's time to initialize the AnvatoSDK. Anvato Android SDK can be initialized by calling static getInstance function of AnvatoSDK class. It returns the AnvatoSDK instance and starts initializing the 3rd party libraries in a asynchronous thread. Because of the asynchronous creation phase, AnvatoSDK instance cannot be used right after the call has returned. Application should wait for the SDKDataEvent.SDK_READY to fire before using the AnvatoSDK instance. AnvatoSDK's getInstance function takes 3 parameters. First parameter is the Context of the application. Second parameter is AnvatoVideoEventListener interface implemetation. third parameter is the AnvatoDataEventListener interface implementation.

Next, the application needs to register the Anvato Player UI component with the SDK. The Player UI object needs be registered for the SDK to present video frames on a view, handle control bar functionality and present closed captions. Application has to call initPlayer API of the video namespace of the SDK instance created previously to register the Player UI Object. This API takes in two parameters. First parameter is the Context of the application. Second parameter is the AnvatoPlayerUI object which is declared in the activity layout xml file.

Finally, Anvato Android SDK needs to be informed about Activity's lifecycle events, particularly onPause and onResume calls. These events have to be relayed to the Anvato Android SDK using the similarly named onPause and onResume APIs of the SDK. Please be aware that for your specific integration layer, onDestory event may need to be relayed to the SDK in a similar fashion

Loading Video

This section explains how to load a video. Loading a video is a simple function call in Anvato Android SDK. Application just needs to call the load API of the video namespace of the Anvato Android SDK instance.

The API takes in three parameters. First parameter of the function is a String which is the videoID. Second parameter is an AnvatoVideoType object that represents the type of the video you try to play. Third parameter is an AnvatoPlaybackOptions object that provides information to customize playback for current stream and current user.

Configuring the SDK

AnvatoConfig

// Accessing to singleton instance of the Anvato Configuration Object
AnvatoConfig instance = AnvatoConfig.getInstance();

AnvatoConfig object provides an interface for the application for multiple purposes including:

Access Control

Access control allow the application to activate or disable the entitlements that are enforced while the video is being loaded and also during playback.

AnvatoConfig.getInstance().access.isAuthorizationEnabled(AuthParams.mvpd);
AnvatoConfig.getInstance().access.isAuthorizationEnabled(AuthParams.mvpdonstart);
AnvatoConfig.getInstance().access.isAuthorizationEnabled(AuthParams.tve);
AnvatoConfig.getInstance().access.isAuthorizationEnabled(AuthParams.tveonstart);
AnvatoConfig.getInstance().access.isAuthorizationEnabled(AuthParams.tvr);
AnvatoConfig.getInstance().access.isAuthorizationEnabled(AuthParams.tvronstart);

AnvatoConfig.getInstance().access.setAuthParams(AuthParams.mvpd, true);
AnvatoConfig.getInstance().access.setAuthParams(AuthParams.mvpdonstart, true);
AnvatoConfig.getInstance().access.setAuthParams(AuthParams.tve, false);
AnvatoConfig.getInstance().access.setAuthParams(AuthParams.tveonstart, false);
AnvatoConfig.getInstance().access.setAuthParams(AuthParams.tvr, true);
AnvatoConfig.getInstance().access.setAuthParams(AuthParams.tvronstart, true);

This can be configured by accessing the AuthConfig using access namespace. Moreover, supported authorization types can be accessed with AuthParams enum. Methods include isAuthorizationEnabled(AuthParams param) that checks if the parameter is enabled and setAuthParams(AuthParams param, boolean value) that sets the parameter value for authorization and authentication purposes.

Parameter Type Description
mvpd String If "Yes", the SDK will perform MVPD access check once the current program is resolved.
mvpdonstart String If "Yes", the SDK will perform MVPD access check while starting the video
tve String If "YES", the SDK will perform Anvato TVE check once the current program is resolved.
tveonstart String If "YES", the SDK will perform Anvato TVE check while starting the video.
tvr String If "YES", the SDK will perform authorization check using AdobePass plug'in once the current program is resolved.
tvronstart String If "YES", the SDK will perform authorization check using AdobePass plug'in while starting the video.

Video

AnvatoConfig.getInstance().video.gracePeriod = 30.0;
AnvaotConfig.getInstance().video.upidPeriod = 4.0;

This can be configured by accessing VideoConfig using video namespace. Attributes include gracePeriod(double) and upidPeriod(double). Default value for gracePeriod is 30.0(seconds).

Parameter Type Description
gracePeriod double Grace period
upidPeriod double Upid period

UserInfo

AnvatoConfig.getInstance.userInfo.setUserInfo(UserInfo.geoZip, "[geoZip]");
AnvatoConfig.getInstance.userInfo.setUserInfo(UserInfo.homezip, "[homezip]");
AnvatoConfig.getInstance.userInfo.setUserInfo(UserInfo.maxRating, "[maxRating]");
AnvatoConfig.getInstance.userInfo.setUserInfo(UserInfo.mvpdId, "[mvpdId]");
AnvatoConfig.getInstance.userInfo.setUserInfo(UserInfo.mvpdToken, "[mvpdToken]");

AnvatoConfig.getInstance.userInfo.getUserInfo(UserInfo.geoZip);
AnvatoConfig.getInstance.userInfo.getUserInfo(UserInfo.homezip);
AnvatoConfig.getInstance.userInfo.getUserInfo(UserInfo.maxRating);
AnvatoConfig.getInstance.userInfo.getUserInfo(UserInfo.mvpdId);
AnvatoConfig.getInstance.userInfo.getUserInfo(UserInfo.mvpdToken);

This can be configured by accessing UserInfoConfig using userInfo namespace. Methods include setUserInfo(UserInfo infoKey, String value) that sets the user information and getUserInfo(UserInfo key) that retrieves the user information. Supported user information types can be accessed with UserInfo enum.

Parameter Type Description
geoZip String Geo zip
homezip String Home zip
maxRating String Rating value
mvpdId String MVPD id
mvpdToken String MVPD token

UI

AnvatoConfig.getInstance().ui.isExternalCCActive = false;
AnvatoConfig.getInstance().ui.externalCCDisplayOffset = 0.0;

This can be configured by accessing UIConfig using ui namespace.

Parameter Type Description
isExternalCCActive boolean Check if the external CC is active
externalCCDisplayOffset double External CC display offset

Playback Options

Plugins

This section describes all the available plugins that can be configured and initialized using the Anvato Android SDK.

Plugin Configurations

Functions for plugin configuration:

Function Return Type Parameters Explanation
setPluginEnabled void isSet(boolean) Enable(isSet=true) and disable(isSet=false) the plugin
isActive boolean Check if the plugin is active
setParam void param(String), value(String) Set the parameter with the specific value
getParam String param(String) Get the value of the parameter

AdobePass

Overview

AdobePass is a plugin that allows users to access restricted content from their mobile devices using their subscription to TV providers such as AT&T, Comcast Xfinity, Optimum, etc. Anvato Android SDK, provides simple methods and fire events to fully facilitate AdobePass functionalities that are listed below.

  1. Initializing AccessEnabler
  2. Checking if user is authenticated
  3. Logging into an MVPD or using Temppass that provides temporary access
  4. Logging out
  5. Performing authorization checks

Initialization

The initialization is fully automated using the backend configuration. All you need to do is to pass the following information to the Anvato representative.

Parameter Name Description
Password Password that provided by your AdobePass representative.
Requestor The name of the entity that uses AdobePass services. (Username)
Server URL The URL of the AdodbePass server that the SDK will connect.
Resource The id of the resource (content) for which the SDK will perform authorization checks.

If AdobePass is configured, the SDK will notify the application about the initialization of the AdobePass plugin using onDataEvent method. In case the initialization is successful, ADOBEPASS_INIT_SUCCESS event will be fired. In case initialization fails, this will be notified using ADOBEPASS_INIT_FAILED event.

Checking Authentication

The application can check if the user is authenticated or not simply by calling the mAnvSDK.adobepass.checkAuthN() method. If the user is in authenticated, the method triggers ADOBEPASS_USER_AUTHENTICATED e​vent on data channel. Otherwise, it fires ADOBEPASS_USER_NOT_AUTHENTICATED event. If the user is authenticated, then the SDK also fires ADOBEPASS_AUTHN_MVPDID and provide additional authentication information in the bundle.

Bundle content for ADOBEPASS_AUTHN_MVPDID

Key Description
ID The ID of the MVPD, which the user is using.
Sample value "Comcast_SSO"
displayName Friedly name of the MVPD.
Sample value "Xfinity Comcast"
logoURL URL for which the SDK can use to render the logo of the MVPD.
Sample value "http://idp.optimum.net/idp.optimum.net/Optimum_color1_3.png"

Loging into an MVPD

Starting login sequence

mAnvSDK.adobepass.login();

Handling the picker and login view

 @Override
 public boolean onDataEvent(AnvatoGlobals.DataEvent dataEvent, String s, Bundle bundle) {
    if (dataEvent == AnvatoGlobals.DataEvent.ADOBEPASS_MVPD_PICKER_NEEDED) {
            Intent intent = new Intent(this, PickerActivity.class);
            intent.putExtras(bundle);
            startActivity(intent);
            return true;
    } else if (dataEvent == AnvatoGlobals.DataEvent.ADOBEPASS_LOGIN_VIEW_NEEDED) {
            Intent intent = new Intent(this, LoginActivity.class);
            intent.putExtras(bundle);
            startActivity(intent);
            return true;
    }
 }

If the user is not logged in, the application may initiate the login flow simply by calling the login method on the SDK. This triggers the start of the login process. The SDK communication with the AdobePass server and fires ADOBEPASS_MVPD_PICKER_NEEDED event. The bundle that is provided along with the event contains the list of mvpds in mvpds key which points to an Array of type MVPD. At this point, the application should present a picker view from which the user can choose an MVPD. Once this is done, the application should call mAnvSDK.adobepass.setSelectedMVPD() method to pass the mvpd ID that the user has selected. If the users dismisses the picker, the application should null value to the same method to explicitly indicate the login sequence has been interrupted.

Once, the selected MVPD is passed to the SDK, it fires another data event to notify the application about the address of the web page from which the user can login. The bundle that comes long with ADOBEPASS_LOGIN_VIEW_NEEDED event contains a URL object that points the web page. The application can render a custom login screen simply by starting a new activity, which extract login url from intent.

// retrieve the name of the MVPD from the intent that started the activity
Intent intent = getIntent();
String targetUrl = intent.getStringExtra("url");

Logging in using Temppass

In order to login with a temp­pass, the application simply call the 'mAnvSDK.adobepass.setSelectedMVPD()' using either short or long tempPass MVPD ID. This will still fire ADOBEPASS_LOGIN_VIEW_NEEDED event but the URL will simply lead to a web page that closes automatically.

Logging in using Temppass

mAnvSDK.adobepass.setSelectedMVPD("TempPass­LongTTL");
// you can also retrieve MVPDID from user info
String mvpdID = AnvatoConfig.getInstance().userInfo.getUserInfo( UserInfo.mvpdId );
// default it will return "", indicates the user info does not contain mvpdId info. Similiary, you can get geoZip, homezip, maxRating, mvpdToken from user info.
if (mvpdID.length() > 0)
    mAnvSDK.adobepass.setSelectedMVPD("TempPass­LongTTL");

Logging Out

Log out

mAnvSDK.adobepass.logout();

The application can simply call mAnvSDK.adobepass.logout() method to initiate the logout process. The application is notified with ADOBEPASS_USER_LOGGED_OUT when the operation is complete.

Performing authorization checks

The SDK authomatically performs authorization checks based on the configuration of AnvatoConfig.getInstance().access. The result is notified to the application using the data channel. If the authorization is successful then AUTHZ_SUCCESS event is fired. In case of failure, the application receives AUTHZ_ERROR event.

Disclaimer

Adobe Pass Plugin functionality is controlled by Adobe, Inc. ("3rd Party") Anvato does not accept any responsibility for the plugin. Any technical questions regarding the full functionality of the plugin must be directed to the 3rd Party. You must both have an account with the 3rd Party and enter into a license agreement with the 3rd Party to use this plugin.

Chromecast

Description

Chromecast is a media player dongle developed by Google. When connected through an HDMI port and configured for network connectivity, any mobile device can cast a video onto a large screen. Having Chromecast support in your application has a significant impact as it allows users to cast the high quality video onto their large screens, significantly enhancing the use experence. Moreover, multiple users can join the same session and alter the "playlist" as they like. This is a new way of enjoying video sharing with friends.

Chromecast requires two components, a sender application and a receiver application. Using Anvato player SDKs, you can easily turn your mobile application to a fully functional sender application. Anvato also provides Anvato Chromecast Receiver Framework (ACRF) using which you can easily create a receiver application customize the look and feel. When both Anvato Player SDK and ACRF are used together, they establish a secure channel that allows only your users to join the video session. Moreover, using the secure channel, sender and receiver application exchanges additional information. This allows you to monitor and monitize your content while users enjoy the large screen experience.

Configuration Parameters

The required configuration for enabling the Chromecast support is minimal.

public class UIConfig
{
    public boolean isChromecastActive = true;
}
Parameter Name Type Description
isChromecastActive boolean Determines chromecast feature is enabled

Configure Chromecast Feature

This section describes how the application can enable chromecast feature in Anvato SDK.

The plugin can be enabled by accessing UIConfig using ui namespace. 'isChromecastActive' parameter determines the enable state of chromecast feature.

//enable chromecast feature
AnvatoConfig.getInstance().ui.isChromecastActive = true;

Moreover, in application side, the application declared in manifest file must be overriden and VideoCastManager class must be initialized for correct usage.

public class MainApplication extends MultiDexApplication
{
    @Override
    public void onCreate()
    {
        super.onCreate();

        // initialize VideoCastManager
        // app_id is the receiver application id
        CastConfiguration.Builder castConfigurationBuilder = new CastConfiguration.Builder( getString( R.string.app_id ) );
        // urn:x-cast:com.anvato.chromecast is the namespace for Anvato data channel
        castConfigurationBuilder.addNamespace( "urn:x-cast:com.anvato.chromecast" );
        VideoCastManager.initialize( MainApplication.this, castConfigurationBuilder.build() );
    }
}
this.anvatoSDK.ui.controlBar.setMediaRouteButton( [MediaRouteButton] );

Google Chromecast sender application UI requirements mandate the Chromecast button, which is MediaRouteButton in support library, on top right corner at the application layer. Having MediaRouteButton on the control bar is not fully compliant with this requirement. Therefore, Anvato SDK provides an API for correct usage of MediaRouteButton. Application can place MediaRouteButton in layout and pass this button to Anvato SDK via ui.controlBar.setMediaRouteButton function.

Detecting Available Chromecast Receivers

Once created, the Anvato SDK automatically handles detecting device phase. MediaRouteButton, either from applcation or default one, is enabled if there is at least one available chromecast to connect.

Device Detection

Connecting to a Device

If user clicks a chromecast device to connect, the Anvato SDK handles connection process internally. The Anvato SDK notifies about application about the connection status using the following events.

Event Name Description
CHROMECAST_CONNECTED Connected to device
CHROMECAST_CUSTOM_DATA_RECEIVED Custom data received from the Anvato Chromecast Receiver Framework
CHROMECAST_DEVICE_SESSION_ESTABLISHED Connected to the Anvato Chromecast Receiver Framework
CHROMECAST_DISCONNECTED Disconnected from a device
CHROMECAST_ERROR Error occured

Video Playback

The application uses the same video API to start, stop, pause or resume the content. Moreover, the same video events will be fired regarding ad experience such as ad points. Basically, once the SDK establishes a secure connection, the details of the implementation for video functionalities are completely hidden from the application.

Disconnecting

If user clicks MediaRouteButton while an active connection is available to a chromecast. Active connection handling screen appears. 'Stop Casting' button triggers disconnection process.

Device Disconnect

Expected Behaviour

  1. Power a Chromecast device and configure it to be on the same network with the mobile device and connect it to a large screen.

  2. Enable and disable of MediaRouteButton is handled with CastCompanionLibrary.

  3. If user clicks MediaRouteButton, it will show available devices in customizable UI.

  4. Connect and disconnect process will be handled with CastCompanionLibrary.

  5. Playback flows and UI updates will be handled with Anvato SDK. Anvato SDK will fire related events to keep application updated about status.

Comscore

Description

The Anvato Android SDK implements the comScore library which enables it to send analytics data to the comScore server when this plugin is enabled. The SDK also allows the application to send additional data in these calls. The following sections describe how the comscore plugin can be enabled and how the application can pass data to the SDK to be inserted in the comScore calls.

Configuration Parameters

public enum ComscoreParam
{
    brandname,
    c2,
    c3,
    c4,
    publisher_secret
}
Parameter Type Description
brandname String Comscore brandname string
C2 String ComScore Client ID. It is a number with at least 7 digits.
C3 String Comscore C3 string
C4 String Comscore C4 string
publisher_secret String ComScore-supplied string

Application Parameters

//enable comscore plugin
AnvatoConfig.getInstance().comscore.setPluginEnabled(true);
//disable comscore plugin
AnvatoConfig.getInstance().comscore.setPluginEnabled(false);
//check if comscore plugin is active
AnvatoConfig.getInstance().comscore.isActive();
//set c2 to "[c2]"
AnvatoConfig.getInstance().comscore.setParam(AnvatoConfig.ComscoreParam.c2.toString(), "[c2]");
//get c2's value
AnvatoConfig.getInstance().comscore.getParam(AnvatoConfig.ComscoreParam.c2.toString());

//Sending additional data with comscore calls
AnvatoPlaybackOptions playbackOptions = AnvatoPlaybackOptions.getInstance();
JSONObject customData = new JSONObject();
JSONObject comscoreParams = new JSONObject();
try
{
    comscoreParams.put("c6", "cablevision");
    comscoreParams.put("c7", "fullscreen");
    customData.put("comscore",comscoreParams);
    playbackOptions.customData = customData;
}
catch (JSONException e)
{
    e.printStackTrace();
}

// Load video with playback options
anvatoSDK.video.load("mcpid", AnvatoGlobals.VideoType.VIDEO_TYPE_MCP, playbackOptions);

This section describes how the application can pass parameters to the SDK.

The plugin can be configured by accessing the ComscoreConfig using comscore namespace. Supported parameter values can be accessed with ComscoreParam enum. Functions available for plugin configuration can be found in the Plugin Configuration section.

The application can also send additional metadata in comscore calls by accessing the customData namespace of play back options in AnvatoSDK. This is demonstrated in the code alongside.

Expected behavior

  1. Filter the device log (e.g. using logcat) by ComScoreManager, all the results such as fired events and metadata should show up.

  2. From the logs (e.g. using HTTP proxy tool such as Charles Proxy), an HTTP request going to Comscore Server URL should be sent. Values of the query string parameters should match to those set by the application. An example of the log is shown below:

Comscore Log

Disclaimer

Comscore Plugin functionality is controlled by Comscore, Inc. ("3rd Party") Anvato does not accept any responsibility for the plugin. Any technical questions regarding the full functionality of the plugin must be directed to the 3rd Party. You must both have an account with the 3rd Party and enter into a license agreement with the 3rd Party to use this plugin.

Freewheel

Description

The Anvato Android SDK supports playback of client side and server side ads served from freewheel ad servers. By configuring the SDK with server side freewheel advertising parameters, the SDK will send the the values to the Anvato backend, which will insert the modified version of the advertisement into the original video asset and serve it to the player. Conversely, by using client side freewheel advertising parameters, the player will make an ad request and parse the VAST response by itself. The player will then play the video as a separate play item as part of a playlist. We suggest server side ad stitching over client side since ad blockers cannot block server stitched ads.

Client Side

Configuration Parameters

Parameter Type Description
ad_tag_url String The Ad url

Application Parameters

AnvatoConfig.getInstance().plugin.enablePlugin( AnvatoConfig.Plugin.freewheel );
AnvatoConfig.getInstance().freewheel.setFWParam( AnvatoConfig.FWParam.ad_tag_url , "[YOUR_AD_TAG_URL]" );

This section describes how the application can pass parameters to the SDK.

Server Side

Configuration Parameters

Parameter Type Description
network_id String The network id
profile_id String The profile id
server_url String The server url
site_section_id String The site section id
video_asset_id String The video asset id
Method Arguments Description
setFWCustomParam String, String Set the key-value pair of macros to be passed to the Anvato Backend.

Application Parameters

AnvatoConfig.getInstance().plugin.enablePlugin( AnvatoConfig.Plugin.freewheel );
AnvatoConfig.getInstance().freewheel.setParam( AnvatoConfig.FWParam.server_url.toString() , "[SERVER_URL]" );
AnvatoConfig.getInstance().freewheel.setParam( AnvatoConfig.FWParam.network_id.toString() , "[NETWORK_ID]]" );
AnvatoConfig.getInstance().freewheel.setParam( AnvatoConfig.FWParam.video_asset_id.toString() , "[ASSET_ID]]" );
AnvatoConfig.getInstance().freewheel.setParam( AnvatoConfig.FWParam.site_section_id.toString() , "[SITE_SECTION_ID]" );
AnvatoConfig.getInstance().freewheel.setParam( AnvatoConfig.FWParam.profile_id.toString() , "[PROVIDE_ID]" );

AnvatoConfig.getInstance().freewheel.setFWCustomParam("Key1", "Value1");
AnvatoConfig.getInstance().freewheel.setFWCustomParam("Key2", "Value2");

This section describes how the application can pass parameters to the SDK.

The plugin can be configured by accessing the FWConfig using freewheel namespace. Supported parameter values can be accessed with FWParam enum. Functions available for plugin configuration can be found in the Plugin Configuration section.

Additionally the Freewheel Plugin has another method to set custom parameters. setFWCustomParam() is an optional method that can be called to send key value pairs to the Anvato Backend such that the keys set in the ad tag URL can be replaced by their corresponding value. For eg. if an ad tag has this as part of the URL: ....&myKey1=[Key1]&myKey2=[Key2]&..., Key1 and Key2 will be replaced by the corresponding values in setFWCustomParam which will be sent at load time from the SDK. Sample code to send custom params is shown on the right.

Expected behavior

From the logs (e.g. using HTTP proxy tool such as Charles Proxy), an HTTP request going to Freewheel Server URL should be sent. An example of the log is shown below:

Freewheel Log

Disclaimer

Freewheel Plugin functionality is controlled by Freewheel, Inc. ("3rd Party") Anvato does not accept any responsibility for the plugin. Any technical questions regarding the full functionality of the plugin must be directed to the 3rd Party. You must both have an account with the 3rd Party and enter into a license agreement with the 3rd Party to use this plugin.

Heartbeat

Description

The SDK implements the Adobe Heartbeat library and if this plugin is enabled, it sends relevant video, chapter, ad and quality of service metrics. During video playback, heartbeat calls are sent which contains information regarding the video being played. The plugin also allows the application to piggyback custom metadata on heartbeat calls so as to gather additional information regarding the video experience. The following sections explain the various heartbeat configuration parameters, steps to enable heartbeat plugin as well as configuring the SDK to send custom metadata on heartbeat calls.

Configuration Parameters

public enum HeartBeatParams
{
    channel,
    is_chapter_enabled,
    job_id,
    ovp,
    publisher,
    sdk,
    tracking_server,
    video_playername
}
Parameter Name Type Description
channel String The heartbeat channel name.
is_chapter_enabled String Enable chapter settings.
job_id String The heartbeat job_id parameter.
ovp String The heartbeat ovp parameter.
publisher String The heartbeat publisher parameter.
sdk String The heartbeat sdk version.
tracking_server String Indicates the tracking server where the heartbeat calls are sent.
video_playername String The name of the video player to be seen in heartbeat calls.

Application Parameters

//enable heartbeat plugin
AnvatoConfig.getInstance().heartbeat.setPluginEnabled(true);
//disable heartbeat plugin
AnvatoConfig.getInstance().heartbeat.setPluginEnabled(false);
//check if heartbeat plugin is active
AnvatoConfig.getInstance().heartbeat.isActive();
//set tracking_server to "heartbeats.omtrdc.net"
AnvatoConfig.getInstance().heartbeat.setParam(AnvatoConfig.HeartBeatParams.tracking_server.toString(), "heartbeats.omtrdc.net");
//get tracking_server's value
AnvatoConfig.getInstance().heartbeat.getParam(AnvatoConfig.HeartBeatParams.tracking_server.toString());

//Sending additional data with heartbeat calls
AnvatoPlaybackOptions playbackOptions = AnvatoPlaybackOptions.getInstance();
JSONObject customData = new JSONObject();
JSONObject heartbeatParams = new JSONObject();
try
{
    heartbeatParams.put("videoMVPD", "cablevision");
    heartbeatParams.put("videoScreen", "fullscreen");
    customData.put("heartbeat",heartbeatParams);
    playbackOptions.customData = customData;
}
catch (JSONException e)
{
    e.printStackTrace();
}
// Load video with playback options
anvatoSDK.video.load("mcpid", AnvatoGlobals.VideoType.VIDEO_TYPE_MCP, playbackOptions);

This section describes how the application can pass parameters to the SDK.

The plugin can be configured by accessing the HeartbeatConfig using heartbeat namespace. Supported parameter values can be accessed with HeartBeatParams enum. Functions available for plugin configuration can be found in the Plugin Configuration section.

The application can also send additional metadata in heartbeat calls by accessing the customData namespace of play back options in AnvatoSDK. This is demonstrated in the code alongside.

Events and Heartbeat Data Information

This sections maps out the events that are tracked by the Heartbeat Plugin as well as the data we send with the corresponding event. Some events like Ad Break start, Chapter start allow us to pass a context metadata object along with the call. If the application passes additional data to be sent with heartbeat calls, it is attached to these objects.

Events tracked by Heartbeat

Event Name Description
Video Load Load the main video asset
Video Unload Unload the main video asset
Play Playback start
Pause Playback stop/pause
Seek Start Seek start
Seek Complete Seek complete
Buffer Start Buffer start
Buffer Complete Buffer complete
Complete Playback complete
Ad Start An ad starts
Ad Complete An ad completes
Chapter Start A new chapter starts
Chapter Complete A chapter completes
Bitrate Change A switch to another bitrate occurs
Session Start Autoplay is on, or user clicks play
Application Error An error occurs at the application level

Heartbeat data information

Video Information

Parameter Custom Metadata Description
playerName Yes The name of the video player that is playing back the main content
id Yes The ID of the video asset
name Yes The name of the video asset
length No The duration (in seconds) of the video asset. If streamType is set to vod , return the length of the video. For other video types, return -1 as the length.
playhead No The current playhead location (in seconds) inside the video asset (excluding ad content) at the moment this method was called.
streamType Yes The type of the video asset.

Ad Break Information

Parameter Custom Metadata Description
playerName Yes The name of the video player responsible with playing back the current advertisement break.
name Yes The name of the ad-break.
position No The position (index) of the pod inside the main content (starting with 1).
startTime No The offset of the ad-break inside the main content (in seconds). Defaults to the playhead inside the main content at the moment of the trackAdStart call.

Ad Information

Parameter Custom Metadata Description
id Yes The ID of the ad asset
length No The duration (in seconds) of the ad asset
position No The position (index) of the ad inside the parent ad-break (starting with 1)
name Yes The name of the ad asset (opaque string value)

Chapter Information

Parameter Custom Metadata Description
name Yes The name of the chapter (opaque string value)
length No The duration (in seconds) of the chapter
position No The position of the chapter inside the main content (starting from 1)
startTime No The offset inside the main content where the chapter starts

Qos Inormation

Parameter Custom Metadata Description
fps No Frames per second
bitrate No The number of bits that are conveyed or processed per unit of time
droppedFrames No Dropped frames
startupTime No Video start time

Expected behavior

  1. Filter the device log (e.g. using logcat) by AdobeHeartBeatManager, all the results such as fired events and metadata should show up.

  2. From the logs (e.g. using HTTP proxy tool such as Charles Proxy), an HTTP request going to Heartbeat Server URL should be sent. Values of the query string parameters should match to those set by the application.

A Video Start call is shown below. It has information related to the video being played such as video id, name, video type and video length and playhead.

HB Video

Similaryly an ad start call has relevant information regarding the current advertisement being played such as ad ID, ad Name, ad Length and position of that ad in the ad break. It will also carry the ad break information which the ad is a part of.

HB AD

Disclaimer

Adobe Heartbeat Plugin functionality is controlled by Adobe, Inc. ("3rd Party") Anvato does not accept any responsibility for the plugin. Any technical questions regarding the full functionality of the plugin must be directed to the 3rd Party. You must both have an account with the 3rd Party and enter into a license agreement with the 3rd Party to use this plugin.

Nielsen (DCR)

Description

Nielsen DCR (Digital Content Rating) enables the developers to measure online video playing, app launches, app crashes, advertisements, page views, etc. DCR measurement content is developed for digital-only or linear TV content with dynamic ad-model. Since Heartbeat SDK 1.6, Nielsen DCR service is provided by Heartbeat SDK.

Configuration Parameters

public enum HeartbeatNielsenParams
{
  adID,
  adLoadType,
  airDate,
  appID,
  appName,
  appVersion,
  assetID,
  channel,
  clientID,
  configKey,
  crossID1,
  crossID2,
  isFullEpisode,
  length,
  program,
  segB,
  segC,
  sfCode,
  title,
  type,
  vcID
}
Parameter Name Type Description
adID String Ad id
adLoadType String Ad load type
airDate String Original air date and time
appID String Unique ID assigned to the player/site and configured by product.
appName String The name of the application.
appVersion String The version of the application.
assetID String Asset id
channel String Channel name
clientID String Unique ID for the client used to enable VA Beacon measurement.
configKey String Configuration key
crossID1 String Standard episode ID
crossID2 String Content originator
isFullEpisode String Full episode flag
length String Length of content for VOD
program String Program name
segB String Segment B
segC String Segment C
sfCode String Unique identifier for the environment that the SDK should point to.
title String Episode title
type String Type of measurement
vcID String Unique ID for the client used to enable VA Beacon measurement.

Application Parameters

//enable nielsen DCR plugin
AnvatoConfig.getInstance().heartbeat.heartbeatNielsen.setPluginEnabled(true);
//disable nielsen DCR plugin
AnvatoConfig.getInstance().heartbeat.heartbeatNielsen.setPluginEnabled(false);
//check if nielsen DCR plugin is active
AnvatoConfig.getInstance().heartbeat.heartbeatNielsen.isActive();
//set adID to "[adID]]"
AnvatoConfig.getInstance().heartbeat.heartbeatNielsen.setParam(AnvatoConfig.HeartbeatNielsenParams.adID.toString(), "[adId]");
//get adID's value
AnvatoConfig.getInstance().heartbeat.heartbeatNielsen.getParam(AnvatoConfig.HeartbeatNielsenParams.adID.toString());

This section describes how the application can pass parameters to the SDK.

The plugin can be configured by accessing the HeartbeatNielsenConfig using heartbeatNielsen namespace defined inside HeartbeatConfig. Supported parameter values can be accessed with HeartbeatNielsenParams enum. Functions available for plugin configuration can be found in the Plugin Configuration section.

Expected behavior

No Expected Behavior for now.

Disclaimer

Nielsen DCR Plugin functionality is controlled by Nielsen, Inc. ("3rd Party") Anvato does not accept any responsibility for the plugin. Any technical questions regarding the full functionality of the plugin must be directed to the 3rd Party. You must both have an account with the 3rd Party and enter into a license agreement with the 3rd Party to use this plugin.

Nielsen (DTVR)

Description

Nielsen DTVR (Digital Television Ratings) is a product of Nielsen that measures live TV viewing up to seven days of broadcasting without change in National ads.

Anvato Android SDK, provides simple methods to fully facilitate Nielsen functionalities.

Configuration Parameters

public enum NielsenParam {
        app_id,
        app_name,
        app_version,
        sf_code,
}
Parameter Name Type Description
app_id String Unique ID assigned to the player/site and configured by product.
app_name String The name of the application.
app_version String The version of the application.
sf_code String Unique identifier for the environment that the SDK should point to.

Application Parameters

//enable nielsen tvr plugin
AnvatoConfig.getInstance().nielsenTVR.setPluginEnabled(true);
//disable nielsen tvr plugin
AnvatoConfig.getInstance().nielsenTVR.setPluginEnabled(false);
//check if nielsen tvr plugin is active
AnvatoConfig.getInstance().nielsenTVR.isActive();
//set appID to "[appID]"
AnvatoConfig.getInstance().nielsenTVR.setParam(AnvatoConfig.NielsenParam.appID.toString(), "[appID]");
//get appID's value
AnvatoConfig.getInstance().nielsenTVR.getParam(AnvatoConfig.NielsenParam.appID.toString());

This section describes how the application can pass parameters to the SDK.

The plugin can be configured by accessing the NielsenTVRConfig using nielsenTVR namespace. Supported parameter values can be accessed with NielsenParam enum. Functions available for plugin configuration can be found in the Plugin Configuration section.

Expected behavior

The Anvato SDK should get the nielsen opt-out url by calling [anvatoSDK.analytics.getNielsenUserOptOutUrl()].

Then click the opt-out button on the Webview of opt-out url, the nielsenTVR should opt-out.

After clicking the close button on the Nielsen opt-out webview, the webview should be dismissed.

Disclaimer

Nielsen DTVR Plugin functionality is controlled by Nielsen, Inc. ("3rd Party") Anvato does not accept any responsibility for the plugin. Any technical questions regarding the full functionality of the plugin must be directed to the 3rd Party. You must both have an account with the 3rd Party and enter into a license agreement with the 3rd Party to use this plugin.

Reference Guide

SDK

this.anvatoSDK = AnvatoSDK.getInstance(getApplicationContext(), this, this);

The SDK can be initialized by providing it with the listeners that will receive the Data and Video Events as described in the Event Flow section. This is demonstrated in the code alongside. The following APIs are available to the application.

getPlayerName()

AnvatoSDK.getPlayerName()

Get the Anvato SDK name.

getSDKVersion()

AnvatoSDK.getSDKVersion();

Get the Anvato SDK version.

getSDKVersionLong()

AnvatoSDK.getSDKVersionLong();

Get the Anvato SDK name and version.

Adobe API

checkAuthN()

anvSDK.adobepass.checkAuthN();

Allows the application to get the state of authentication process. SDKDataEvent.ADOBE_AUTHENTICATED event will be fired if the current AdobePass user is already authenticated, otherwise SDKDataEvent.ADOBE_NOT_AUTHENTICATED will be fired.

login()

anvSDK.adobepass.login();

Triggers authentication process. SDKDataEvent.ADOBE_PICKER_NEEDED event will be fired for authentication needed case.

Returns Type
If the login request is successful boolean

loginTempPass(String mvpd)

anvSDK.adobepass.loginTempPass("mvpd");

Triggers AdobePass Temporary Pass authentications process.

Parameters Type
MVPD Id String
Returns Type
If the login request is successful boolean

logout()

anvSDK.adobepass.logout();

Triggers AdobePass sign out process for the user. SDKDataEvent.ADOBE_LOGGED_OUT event will be fired for successful logout. Otherwise, it returns false

Returns Type
Whether logout is successful boolean

setSelectedMVPD(String mvpd)

anvSDK.adobepass.setSelectedMVPD("mvpd");

Sets the MVPD provider for AdobePass.

Parameters Type
MVPD Id String
Returns Type
Whether MVPD provider is set successfully boolean

Analytics API

getNielsenUserOptOutUrl()

anvSDK.analytics.getNielsenUserOptOutUrl();

Returns Opt-Out url for Nielsen.

Returns Type
Opt-Out url String

setNielsenUserOptOutUrl(String optOutUrl)

anvSDK.analytics.setNielsenUserOptOutUrl("optOutUrl");

Sets Opt-Out.

Parameters Type
Opt-Out url to be set String
Returns Type
Whether url set is successful boolean

Anvato API

getMCPFeed(ArrayList urls)

ArrayList urls = new ArrayList();
anvSDK.anvato.getMCPFeed(urls);

Use it to get the content list from MCP with a list of feed source URLs. SDKDataEvent.MCP_FEED_READY will be fired after the content list is successfully retrieved from MCP.

Parameters Type
The URL list for the feed source. ArrayList
Returns Type
Whether the getMCPFeed request is sent successfully boolean

getMCPFeed(String url)

anvSDK.anvato.getMCPFeed("url");

Use it to get the content list from MCP with a single feed source URL. SDKDataEvent.MCP_FEED_READY will be fired after successful operation.

Parameters Type
The URL for the feed source. String
Returns Type
Whether the getMCPFeed request is sent successfully boolean

CCast API

sendCustomMessage(String message)

anvSDK.ccast.sendCustomMessage("message");

Send custom message to chromecast remote media player. VideoEvent.EVENT_CAST_CUSTOM_DATA_RECEIVED can be fired after the message has been successfully sent.

Parameters Type
Message to be sent String
Returns Type
Whether sendCustomMessage is successful boolean

Network API

setUserAgent(String userAgent)

anvSDK.network.setUserAgent("userAgent");

Set the user agent for network operations

Parameters Type
User-Agent value to be set String

getDefaultUserAgent()

anvSDK.network.getDefaultUserAgent();

Get the default user agent

Returns Type
User Agent value String

Video API

initPlayer(Context context, AnvatoPlayerUI playerUI)

anvSDK.video.initPlayer( getApplicationContext(), this.playerUI );

Initializes the Anvato video player.

Parameters Type
Application context Context
Player UI object from the application layout AnvatoPlayerUI
Returns Type
Whether initialization is successful boolean

getStatus()

anvSDK.video.getStatus();

Returns current status of video playback.

Returns Type
Current status of video playback. JSONObject

Details of status JSONObject as follows:

Key Type Explanation
playerType String One of the following options:
nativePlayer
chromcast
playerName String AnvatoCoreSDK.getSDKVersionLong() value
state String State of player. One of the following options:
IDLE
ERROR
PAUSED
PLAYBACK_COMPLETE
PREPARING
PREPARED
STARTED
STOPPED
videoType String One of the following options:
vod
live
isAd Boolean Indicates current stream whether isAd or not.
playheadTime long Current position of stream. This value is only applicable for VOD streams.
duration long Duration of stream. This value is only applicable for VOD streams.
adInfo JSONObject Information about the ad. (available if isAd equals true)
numAds(in adInfo) int Number of ads in AdPod. (available if isAd equals true)
adIndex(in adInfo) int Index of ad in AdPod. (available if isAd equals true)
adPodDur(in adInfo) int Duration of AdPod. (available if isAd equals true)

goLive()

anvSDK.video.goLive();

Catches the live stream

Returns Type
Whether the initialization is successful boolean

load(String videoId, AnvatoGlobals.VideoType videoType)

anvSDK.video.load("videoId", AnvatoGlobals.VideoType.[TYPE]);

Loads given content.

Parameters Type
ID of the content to be played. It must be a correct value for the given videoType. String
Type of video to be played. AnvatoGlobals.VideoType
Returns Type
Whether load is successful boolean

load(String videoId, AnvatoGlobals.VideoType videoType, AnvatoPlaybackOptions videoPlaybackOptions)

anvSDK.video.load("videoId", AnvatoGlobals.VideoType.[TYPE], this.videoPlaybackOptions);

Loads given content with playback options.

Parameters Type
ID of the content to be played. It must be a correct value for the given videoType. String
Type of video to be played. AnvatoGlobals.VideoType
Playback options for video. AnvatoPlaybackOptions
Returns Type
Whether load is successful boolean

mute()

anvSDK.video.mute();

Mutes the volume for the current video session.

Returns Type
Whether mute is successful boolean

pause()

anvSDK.video.pause();

Call this method to pause the video playback.

Returns Type
Whether pause is successful boolean

resume()

anvSDK.video.resume();

Call this method to resume video playback.

Returns Type
Whether resume is successful boolean

seek(int val)

anvSDK.video.seek(50);

Call this method to seek in a vod playback.

Parameters Type
Value between 0-100, position of the seekTo point in terms of percentage. int
Returns Type
Whether seek is successful boolean

seek(float seekPointInSeconds)

anvSDK.video.seek(300);

Call this method to seek in a vod playback(in seconds).

Parameters Type
Value between 0 - duration of video. float
Returns Type
Whether seek is successful boolean

setVolume(float val)

anvSDK.video.setVolume(0.5);

Set the volume for the current video video playback.

Parameters Type
The audio level. The value should be between 0.0 and 1.0 float
Returns Type
Whether setVolume is successful boolean

stop()

anvSDK.video.stop();

Stops video playback. After this call, video cannot be resumed. For stopping the playback temporarily, use the video.pause() method.

Returns Type
Whether stop is successful boolean

unmute()

anvSDK.video.unmute();

Unmutes the volume for the current video playback.

Returns Type
Whether unmute is successful boolean

Event Flow

This document describes the events fired by Anvato Android SDK during its lifecycle. The events are divided into two types:

  1. SDKDataEvent
  2. VideoEvent

SDKDataEvent

SDKDataEvents contain events that are related to the data flow of the SDK such as entitlement. Please see DataEvent List. Application should implement the AnvatoDataEventListener interface to receive the callback correctly.

public interface AnvatoDataEventListener
{
    boolean onDataEvent( SDKDataEvent event, Bundle bundle, Object object );
}

VideoEvent

VideoEvent contain events related to video playback such as video start event, video paused event… Please see VideoEvent List. Some of the more advanced events that describes the type of the video is only available for MCP content. Application should implement AnvatoVideoEventListener protocol to receive the callback correctly.

public interface AnvatoVideoEventListener
{
    /**
    * Return true means, I have handled this event. Don't take any more action.
    */
    public boolean onVideoEvent(VideoEvent event, Bundle extra);
}

SDKDataEvent List

Event Description Bundle Info
SDK_READY Notifies the application that the SDK is ready to user Empty
NEW_PROGRAM_METADATA Notifies that the content metadata arrived [{metaDataString=metaDataJson}]
VIDEO_LOAD_SUCCESS Notifies that the video is loaded successfully [{ownerId=123, rating=5, seekTo=98989898, playURL=http://anvato.com, mcpid=45678, videoJson=jsonString}]
VIDEO_LOAD_FAILURE Notifies that the video load failed [{errorCode=2, errorType=2, message=error}]
VIDEO_FAILOVER_SUCCESS Notifies that the video failover is successful [{failoverchannel=xtygFood, mcpID=45678, seekTo=7893421, rating=6}]
VIDEO_FAILOVER_FAILURE Notifies that the video failover failed Empty
ADOBEPASS_INIT_SUCCESS Notifies that the adobepass init successfully Empty
ADOBEPASS_INIT_FAILED Notifies that the adobepass initialization failed Empty
ADOBEPASS_USER_AUTHENTICATED Notifies that the user is authenticated via AdobePass Empty
ADOBEPASS_USER_NOT_AUTHENTICATED Notifies that the user is not authenticated via AdobePass [{mvpdID=45678, authenticated=true}]
ADOBEPASS_USER_LOGGED_OUT Notifies that the user is logged out Empty
ADOBEPASS_MVPD_PICKER_NEEDED Notifies that the mvpd picker needed activity should be started Empty
ADOBEPASS_LOGIN_VIEW_NEEDED Notifies that login view should be started Empty
ADOBEPASS_AUTHN_MVPDID Notifies that MVPDID is authenticated by AdobePass [{mvpd_id=344}]
ADOBEPASS_LOGIN_CANCELLED Notifies that the AdobePass login is canceled Empty
AUTHZ_ERROR Notifies that the authz error occured [{authzErrorID=2}]
MCP_FEED_READY Notifies that the mcp feed is ready [{mcpFeed=test, url=http://www.test.com}]

SDKDataEvent Bundle Field

Bundle Field Type Description
metaDataString string json string which contains metaData
ownerId string video owner's id
rating string video rating
errorCode int video playback error code
errorType int video playback error type
mcpID string media content platform id
seekTo long seek to posistion
authzErrorID int authorization error code
mvpdID string multichannel video program distributor id
authenticated boolean boolean value, indicates whether user is authenticated or not
mvpd_id string multichannel video program distributor id
mcpFeed string media content platform feed
url string url address

VideoEvent List

VideoEvent Description Bundle Info
VIDEO_PREPARED Indicates that the video is buffered and ready to play. [{uuid=4175db66-ac5b, extra=Bundle[{def_title=home, rating=6, seekTo=123213, mcpFailoverChannel=xtygFood, upload_id=123}], curIsVod=true, curIsAd=true}]
VIDEO_PLAYHEAD Updates the application about the playhead position of the stream [{duration=23123, ts=1233, uuid=4175db66-ac5b, extra=Bundle[{def_title=home, rating=6, seekTo=123452, mcpFailoverChannel=xtygfood, upload_id=12345}], curIsVod=false, position=2, curIsAd=false}]
VIDEO_STARTED Indicates that the video started [{duration=213123, uuid=4175db66-ac5b, extra=Bundle[{def_title=home, rating=3, seekTo=2345345, mcpFailoverChannel=xtygfood, upload_id=12345}], curIsVod=false, curIsAd=true, loadingDelay=123456}]
VIDEO_PAUSED Indicates that the video paused [{uuid=4175db66-ac5b, extra=Bundle[{def_title=home, rating=5, seekTo=2345645, mcpFailoverChannel=xtygfood, upload_id=123456}], curIsVod=true, curIsAd=true}]
VIDEO_RESUMED Indicates that the video resumed [{uuid=4175db66-ac5b, extra=Bundle[{def_title=home, rating=2, seekTo=213452, mcpFailoverChannel=xtygfood, upload_id=123456}], curIsVod=true, curIsAd=true}]
VIDEO_ENDED Indicates that the video ended [{uuid=4175db66-ac5b, extra=Bundle[{def_title=home, rating=4, seekTo=213454, mcpFailoverChannel=xtygfood, upload_id=123456}], curIsVod=true, curIsAd=false}]
VIDEO_BUFFERING_COMPLETED Indicates that the video buffer completed [{uuid=4175db66-ac5b, extra=Bundle[{def_title=home, rating=5, seekTo=213454, mcpFailoverChannel=xtygfood, upload_id=123456}], curIsVod=true, curIsAd=false}]
VIDEO_BUFFERING_STARTED Indicates that the video buffering started [{uuid=4175db66-ac5b, extra=Bundle[{def_title=home, rating=3, seekTo=123456, mcpFailoverChannel=xtygfood, upload_id=123456}], curIsVod=false, curIsAd=false}]
VIDEO_PLAYBACK_ERROR Indicates that an error occured during playback [{err_extra=sad, canRetry=true, uuid=4175db66-ac5b, extra=Bundle[{def_title=home, rating=4, seekTo=1234564, mcpFailoverChannel=xtygfood, upload_id=1234}], curIsVod=true, message=test, curIsAd=false, err_what=123}]
VIDEO_PLAYLIST_COMPLETED Indicates that video play list completed [{uuid=4175db66-ac5b, extra=Bundle[{def_title=home, rating=4, seekTo=123345, mcpFailoverChannel=xtygfood, upload_id=12345}], curIsVod=false, curIsAd=false,message=test}]
STREAMINFO_CONTENT_STARTED Indicates that content streaming started [{blockdur=123123, uuid=4175db66-ac5b, block=test, extra=Bundle[{def_title=home, rating=3, seekTo=234234, mcpFailoverChannel=xtygfood, upload_id=12312}], blockStartTime=123123, curIsVod=false,curIsAd=false}]
STREAMINFO_ADPOD_LIST Indicates that adpod list started [{adlist=[D@fea3f47, uuid=, extra=Bundle[{def_title=, rating=2, seekTo=3245673, mcpFailoverChannel=xtygFood, upload_id=12345}], curIsVod=false, curIsAd=false}]
STREAMINFO_ADPOD_STARTED Indicates that adpod started [{numOfAds=5, adPodIndex=3, durations=1024, totalDur=78, contentTS=123533, type=ads, uuid=4175db66-ac5b, extra=Bundle[{def_title=, rating=, seekTo=, mcpFailoverChannel=xtygFood, upload_id=1234}], curIsVod=true, clientside=false, curIsAd=true}]
STREAMINFO_AD_STARTED Indicates that ad streaming started [{podDuration=2, numAds=3, companions=ads, dur=8767656, seq=23, adid=123, type=ad, uuid=4175db66-ac5b, extra=Bundle[{def_title=home, rating=2, seekTo=12312545, mcpFailoverChannel=xtygfood, upload_id=1234}], curIsVod=false, clientside=true, curIsAd=false, clickThroughURL=http://anvato.com}]
CHROMECAST_CONNECTED Indicates that the device is connected Empty
CHROMECAST_CUSTOM_DATA_RECEIVED Indicates that data is received Empty
CHROMECAST_DEVICE_SESSION_ESTABLISHED Indicates that session is established Empty
CHROMECAST_DISCONNECTED Indicates that chromecast is disconnected Empty
CHROMECAST_ERROR Indicats that an error occured Empty
VIDEOVIEW_TABBED Indicates that the video view is tapped [{uuid=4175db66-ac5b, extra=Bundle[{def_title=home, rating=10, seekTo=12312343535, mcpFailoverChannel=xtygfood, upload_id=123}], curIsVod=false, curIsAd=true}]
VIDEOVIEW_SIZE_CHANGED Indicates that the video view size has changed [{height=400, uuid=4175db66-ac5b, extra=Bundle[{def_title=home, rating=3, seekTo=345671, mcpFailoverChannel=xtygfood, upload_id=1234}], width=800, curIsVod=false, curIsAd=false}]
VIDEOVIEW_SWIPED Indicates that the video view is swiped [{dir=abc, uuid=4175db66-ac5b, extra=Bundle[{def_title=home, rating=2, seekTo=3456781, mcpFailoverChannel=xtygfood, upload_id=1234}], curIsVod=false, curIsAd=false}]
VIDEOVIEW_FULLSCREEN_ON_REQUESTED Indicates that the video should enter the full screen mode [{uuid=4175db66-ac5b, extra=Bundle[{def_title=home, rating=6, seekTo=123567, mcpFailoverChannel=xtygfood, upload_id=123456], curIsVod=true, curIsAd=true, isFullScreenOn=false}]
VIDEOVIEW_FULLSCREEN_OFF_REQUESTED Indicates that the video should exit the full screen mode [{uuid=4175db66-ac5b, extra=Bundle[{def_title=home, rating=4, seekTo=123456, mcpFailoverChannel=xtygfood, upload_id=123456}], curIsVod=false, curIsAd=false, isFullScreenOn=true}]

VideoEvent Bundle Field

Bundle Field Type Description
uuid string video event uuid
def_title string media title
rating string media rating
seekTo long media seekTo position
mcpFailoverChannel string mediat content platform failover channel
upload_id string video upload id
curIsVod boolean true or false, indicates it is vod or live
curIsAd boolean true or false, indicates it is ad or not
position long video current position
duration long video content duration
message string message information
err_what int err code
adlist double[] serialized ad list
isFullScreenOn boolean true or false, indicates it is fullscreen or not
width int video view width
height int video view height
numOfAds int number of ads
adPodIndex int the index of ad pod
totalDur long total duaration of the video
contentTS long content time stamp
type string video type
clientside boolean true or false, indicates client side ad or not
clickThroughURL string client side ad click through url
loadingDelay long loading delay time
adid int ad id number
seq int sequence number
companions string ad companions information
blockdur long block duration
block string block info
blockStartTime long the start time of the block
canRetry boolean whether the player will retry when play back error happened

UI Customization

This section explains how to customize SDK in UI perspective. Anvato Android SDK has the ui API to handle UI component customizations. This API has 3 sub-namespace for categorizing specific APIs related to UI.

Please note that, ui namespace can only be used after registering Anvato Player UI Components in SDK.

Player View Customizations

anvSDK.ui.player.addDebugMessage( "debug" );

anvSDK.ui.player.setMaxNumDebugMessages( 5 );

anvSDK.ui.player.getHeightVideo();

anvSDK.ui.player.getWidthVideo();

anvSDK.ui.player.setAdFullScreenButtonEnabled( true );

anvSDK.ui.player.setAdFullScreenButtonVisibility( [View.[VISIBILITY]] );

anvSDK.ui.player.setChannelLogo( [BITMAP], AnvatoPlayerUI.LogoPosition.[LOGO_POSITION], [SCALE] );

anvSDK.ui.player.setChannelLogoVisibility( [View.[VISIBILITY]] );

public enum OverlayButtonTypes { 
PLAY, 
PAUSE, 
ERROR 
}

anvSDK.ui.player.setOverlayButtonIcon( AnvatoPlayerUI.OverlayButtonTypes.[ICON], [DRAWABLE]] );
// if you want set PLAY OverlayButtonType's icon to drawable test, you can use the statement below
anvSDK.ui.player.setOverlayButtonIcon( AnvatoPlayerUI.OverlayButtonTypes.PLAY, getResources().getDrawable( R.drawable.test ));
// if you want change PLAY OverlayButtonType's icon to drawable production, you can use the statement below
anvSDK.ui.player.setOverlayButtonIcon( AnvatoPlayerUI.OverlayButtonTypes.PLAY, getResources().getDrawable( R.drawable.production ));
// if you want remove PLAY OverlayButtonType's icon, you can use the statement below
anvSDK.ui.player.setOverlayButtonIcon( AnvatoPlayerUI.OverlayButtonTypes.PLAY, null );

anvSDK.ui.player.setProgressBarIcon( [DRAWABLE] );

anvSDK.ui.player.setVideoViewSize( [WIDTH], [HEIGHT] );

anvSDK.ui.player.toggleDebugMenu();

addDebugMessage( String message ) function is used to print a new message to debug window.

setMaxNumDebugMessages( int value ) function is used to set maximum debug message number.

getHeightVideo() function is used to get the height of the video view.

getWidthVideo() function is used to get the width of the video view.

setAdFullScreenButtonEnabled( boolean value ) function is used to set the status of the full-screen button that appears in the right most corner when there is an ad.

setAdFullScreenButtonVisibility( int visibility ) function is used to set the visibility of the full-screen button that appears in the right most corner when there is an ad.

setChannelLogo( Bitmap bitmap, AnvatoPlayerUI.LogoPosition position, float scale ) function is used to set a bitmap image as the logo of the channel.

setChannelLogoVisibility( int visibility ) function is used to set the visibility of the channel logo button.

setOverlayButtonIcon( AnvatoPlayerUI.OverlayButtonTypes icon, Drawable drawable ) function is used to set OverlayButtonIcon's drawable.
The first parameter is OverlayButtonTypes, which will be PLAY, PAUSE or ERROR.
The second parameter will be overlay button's icon.

setProgressBarIcon( Drawable drawable ) function is used to set drawable icon of ProgressBar(SpinningWheel).

setVideoViewSize( int width, int height ) function is used to set video view size.

toggleDebugMenu() function is used to show/hide debug window.

Control Bar Customizations


anvSDK.ui.controlBar.getBottomView();

anvSDK.ui.controlBar.getTopView();

anvSDK.ui.controlBar.isButtonActive( AnvatoPlayerUI.ControlBarButtonIcons.[ANY_ICON] );

anvSDK.ui.controlBar.setAutoTitle( true );

// Disables auto-hide!
anvSDK.ui.controlBar.setAutoHide( false );

// Enables auto-hide!
anvSDK.ui.controlBar.setAutoHide( true );

anvSDK.ui.controlBar.setBackgroundColor( "#FF0000", 0.75f );
// Alternative usage for parameters as follows. Please find the detailed
// parameter explanation from 'API'.
// anvSDK.ui.controlBar.setBackgroundColor( "red", 0.75f );

anvSDK.ui.controlBar.setButtonActive( AnvatoPlayerUI.ControlBarButtons.[ANY_BUTTON], true );

anvSDK.ui.controlBar.setButtonIcon( AnvatoPlayerUI.ControlBarButtonIcons.[ANY_ICON] , [ICON_DRAWABLE] );

ArrayList<AnvatoPlayerUI.ControlBarButtons> leftButtons = new ArrayList<AnvatoPlayerUI.ControlBarButtons>();
leftButtons.add( AnvatoPlayerUI.ControlBarButtons.PLAY );
leftButtons.add( AnvatoPlayerUI.ControlBarButtons.GO_LIVE );
ArrayList<AnvatoPlayerUI.ControlBarButtons> rightButtons = new ArrayList<AnvatoPlayerUI.ControlBarButtons>();
rightButtons.add( AnvatoPlayerUI.ControlBarButtons.FULLSCREEN );
rightButtons.add( AnvatoPlayerUI.ControlBarButtons.TOTAL_TIME );
rightButtons.add( AnvatoPlayerUI.ControlBarButtons.BITRATE );
rightButtons.add( AnvatoPlayerUI.ControlBarButtons.CC );
anvSDK.ui.controlBar.setButtonOrder( leftButtons , rightButtons );

anvSDK.ui.controlBar.setButtonTextColor( AnvatoPlayerUI.ControlBarButtons.GO_LIVE , "#FF0000" );
// Alternative usage for parameters as follows. Please find the detailed
// parameter explanation from 'API Guide'.
// anvSDK.ui.controlBar.setButtonTextColor( AnvatoPlayerUI.ControlBarButtons.GO_LIVE , "red" );

anvSDK.ui.controlBar.setButtonVisibility( AnvatoPlayerUI.ControlBarButtons.[ANY_BUTTON] , View.INVISIBLE );

anvSDK.ui.controlBar.setChannelTitle( "title name" );

anvSDK.ui.controlBar.setTitleTextStyle( "red", Typeface.BOLD );

anvSDK.ui.controlBar.setVideoTime( 30, 1800 );

anvSDK.ui.controlBar.setVideoTitle( "title name", false );

anvSDK.ui.controlBar.setVideoTitlePosition( AnvatoPlayerUI.TitleBarPosition.BOTTOM );

anvSDK.ui.controlBar.setHideTimeoutDur( 10000 );

anvSDK.ui.controlBar.setMediaRouteButton( mediaRouteButton );

Anvato Android SDK's ui.controlBar API covers customizations of control bar.

getBottomView() function is used to get video control buttons' container of control bar.

getTopView() function is used to get title bar container of control bar.

isButtonActive( AnvatoPlayerUI.ControlBarButtons button ) function checks if the selected button is active.

setAutoTitle( boolean autoTitle ) function indicates that video title should be set by SDK from the beacon signal if it is available.

setAutoHide( boolean autoHide ) function is used to enable/disable default auto-hide of control bar.

setBackgroundColor( String colorString, float alpha ) function is used to set background color of title bar and control bar.

setButtonActive( AnvatoPlayerUI.ControlBarButtons button, boolean isActive ) function allows the application to set the initial state of a button in the control bar. Initially all button are not in active state (e.g. cc button is not highlighted).

setButtonIcon( AnvatoPlayerUI.ControlBarButtonIcons icon, Drawable iconDrawable ) function is used to set icons of the pre-defined control bar buttons.

setButtonOrder( ArrayList<AnvatoPlayerUI.ControlBarButtons> left, ArrayList<ControlBarButtons> right ) function is used to set the order of the pre-defined buttons in control bar. First parameter, ‘leftButtons’, indicates buttons to be placed in the left group. In other words, first element of this array is placed as left most element in the group aligned to the control bar’s left edge. Second parameter, ‘rightButtons’, indicated buttons to be placed in the right group. In other words, first element of this array is placed as right most element in the group aligned to the control bar’s right edge. Please note that if any button in either of the groups (left or right) is not visible due to visibility constraint (i.e. AnvatoPlayerUI.ControlBarButtons.GO_LIVE will not be visible in VOD content), button order will be re-arranged accordingly.

setButtonTextColor( AnvatoPlayerUI.ControlBarButtons button, String colorString ) function is used to set the text color of the given control bar button. Please note that if given button does not contain text element, the function will return false.

setButtonVisibility( AnvatoPlayerUI.ControlBarButtons controlBarButton, int visibility ) function is used to set the visibility of a control bar button. Please note that the buttons will be re-arranged after visibility change.

setChannelTitle( String title ) function is used to set current playing video channel title.

setTitleTextStyle( String colorString, int style ) function is used to set the style of video title.

setVideoTime( final long currentTime, final long totalTime ) function is used to set the video time.

setVideoTitle( final String title, boolean fromStream ) function is used to set the video title.

setVideoTitlePosition( AnvatoPlayerUI.TitleBarPosition position ) function is used to set video title position.

setHideTimeoutDur( int valInMs ) function is used to set the hide timeout value for the control bar.

setMediaRouteButton( MediaRouteButton mediaRouteButton ) function is used to set the MediaRouteButton for chromecast.

Closed Caption Customizations

anvSDK.ui.cc.setClosedCaptionBackgroundColor( "#FF0000" );
// Alternative usage for parameters as follows. Please find the detailed
// parameter explanation from 'Reference Guide'.
// playerUI.setClosedCaptionBackgroundColor( "red" );

anvSDK.ui.cc.setClosedCaptionBackgroundOpacity( 25 );

Anvato Android SDK’s ui.cc contains APIs for customizing the closed caption.

setClosedCaptionBackgroundColor( String colorString ) function is used to set background color for closed caption.

setClosedCaptionBackgroundColor

setClosedCaptionBackgroundOpacity( int backgroundOpacity ) function is used to change opacity of the background of the closed caption.

setClosedCaptionBackgroundOpacity

anvSDK.ui.cc.setClosedCaptionEdgeStyle( ClosedCaptionEdgeType.UNIFORM ,"#FF0000" );
// Alternative usage for parameters as follows. Please find the detailed
// parameter explanation from 'Reference Guide'.
// playerUI.setClosedCaptionEdgeStyle( ClosedCaptionEdgeType.UNIFORM , "red" );

setClosedCaptionEdgeStyle( ClosedCaptionEdgeType type, String color ) function is used to set edge style of the closed caption.

setClosedCaptionEdgeStyle

anvSDK.ui.cc.setClosedCaptionHighlightColor( "#FF0000" );
// Alternative usage for parameters as follows. Please find the detailed
// parameter explanation from 'Reference Guide'.
// playerUI.setClosedCaptionHighlightColor( "red" );

setClosedCaptionHighlightColor( String colorString ) function is used to set highlight color of the closed caption.

setClosedCaptionHighlightColor

anvSDK.ui.cc.setClosedCaptionHighlightOpacity( 60 );

setClosedCaptionHighlightOpacity( int backgroundOpacity ) function is used to change opacity of the highlight color of the closed caption.

setClosedCaptionHighlightOpacity

anvSDK.ui.cc.setClosedCaptionTextColor( "#FF0000" );
// Alternative usage for parameters as follows. Please find the detailed
// parameter explanation from 'Reference Guide'.
// playerUI.setClosedCaptionTextColor( "red" );

setClosedCaptionTextColor( String colorString ) function is used to change text color of the closed caption.

setClosedCaptionTextColor

anvSDK.ui.cc.setClosedCaptionTextOpacity( 40 );

setClosedCaptionTextOpacity( int textOpacity ) function is used to change opacity of the text of the closed caption.

setClosedCaptionTextOpacity

anvSDK.ui.cc.setClosedCaptionTextSize( 21 );

setClosedCaptionTextSize( int fontSize ) function is used to change the text size of the closed caption. SDK will map given the passed value as follows; If given size is greater than or equals to 24 (fontSize >= 24), TextAppearance_Large is used. If given size is greater than or equals to 18 (24 > fontSize >= 18), TextAppearance_Medium is used. If given size is less to 18 (fontSize > 18), TextAppearance_Small is used.

setClosedCaptionTextSize

anvSDK.ui.cc.setClosedCaptionTypeFace( Typeface.MONOSPACE );

setClosedCaptionTypeFace( Typeface typeface ) function is used to change typeface of the closed caption.

setClosedCaptionTypeFace

anvSDK.ui.cc.setClosedCaptionVisibitility( View.VISIBLE );

setClosedCaptionVisibitility( int visibility ) function is used to change visibility of the closed caption.

Release Notes

Version 5.0.27

NEW_PROGRAM_WILL_START

New Data Event Added

Added NEW_PROGRAM_WILL_START data event to signal program will start and allow the application the oppurtunity to update playback options and refresh data according to the upcoming program.

Version 5.0.26

Live Manifest Error not considered Fatal

Getting 403's/404's on manifest requests is no longer considerer FATAL for the Live stream and the player is more resilient to network/server errors.

IMA Enhancements

Enhancements were made so as to propagate events from the IMA SDK to the application layers when the SDK plays client side ads via IMA SDK.

Version 5.0.25

General bug fixes and enhancements performed.

Version 5.0.24

New Configuration parameters added for passing key values to DFP Server

AnvatoConfig.getInstance().dfp.setKeyValues("key1","value1");
AnvatoConfig.getInstance().dfp.setKeyValues("key2","value2");

The Application can now pass custom key value parameters to TKX using the setKeyValues() under the dfp namespace of the AnvatoConfig object.

Version 5.0.18

General Bug fixes and enhancements. Added error handling to reduce crashes.

Version 5.0.17

New Closed Captions Language List API

String[] captionsList = anvatoSDK.video.getCaptionsLanguageList();

Exposed APIs to display and select different closed caption tracks as declared in the master manifest. The setCaptionsLanguage API accepts a string that will enable the player to show a particular captions as long as the provided string is amongst the options returned in getCaptionsLanguageList method.