CONNECT Player SDK 5 for Android

Unified API Example Code Quick Start

Use this guide to demonstrate Unified Player Interface (UPI) features and view the example code.

The Unified Player Interface (UPI) provides a different set of APIs, which are aligned with similar APIs on other CONNECT player platforms (Android, Apple iOS/tvOS, Browsers, Connected TV, HbbTV, React Native). At the heart of this API, a player based on the IOTVUPIPlayer interface rather than the traditional OTVVideoView. See API documentation around the nagra.otv.upi package.

Prerequisites

Make sure you have the latest Android Studio  installed, including:

  • Android SDK - install the latest version from Android Studio (2021.1.1). You may also need to install Android SDK Tools.

  • Gradle - use the latest version as recommended by Android Studio.

  • JDK - use the version provided with Android Studio.

Download the Android SDK, which supplies all the files needed to launch the player and start streaming content.

  • opy-sdk-android-5.20.x-example-code-upi.zip
    This package demonstrates how to work with the UPI interface.

  • opy-sdk-android-5.20.x-sdk-integration.aar
    The no-PRM version of the SDK binary file used for integration purposes.

You will also need a device running Android 5.x (Lollipop) onwards with debugging enabled; the player cannot run on an Android Studio simulator.

Procedure

  1. Extract the opy-sdk-android-5.20.x-example-code-upi.zip to your desktop.

  2. Go to opy-sdk-android-5.20.x-example-code-upi > common, and place the opy-sdk-android-5.20.x-sdk-integration.aar file in the libs folder.

  3. Open Android Studio, select Open an Existing Project and locate the opy-sdk-android-5.20.x-example-code-upi folder.

  4. When the project has built, select the required project from the dropdown menu (not the side file list); see the example projects below.

  5. Connect an Android device to your development machine via USB and run the application.

Example projects

  • basic-playback-upi - Basic playback functionality with no encryption.

  • basic-playback-upi-kt - Basic playback functionality with no encryption, Kotlin version.

  • encrypted-playback-upi - Shows how to get playback of Widevine-encrypted streams.

  • ssm-encrypted-playback-upi - Shows how to get playback of Widevine-encrypted streams with Session Management.

  • track-selection-upi - Shows how to detect and select tracks in streams with subtitles, multi-audio and multi-video.