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 (Apple iOS/tvOS, Browsers, Connected TV, HbbTV, React Native). At the heart of this API is a player based on the IOTVUPIPlayer
interface rather than the traditional OTVVideoView
. See the nagra.otv.upi
package API documentation.
For the development tools, current dependencies and minimum build configuration required, see Prerequisites and dependencies.
Download the Android SDK, which supplies all the files needed to launch the player and start streaming content.
- opy-sdk-android-5.24.x-example-code-upi.zip
This package demonstrates how to work with the UPI interface. - opy-sdk-android-5.24.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
Extract the opy-sdk-android-5.24.x-example-code-upi.zip to your desktop.
- Go to opy-sdk-android-5.24.x-example-code-upi > common, and place the opy-sdk-android-5.24.x-sdk-integration.aar file in the libs folder.
- Open Android Studio, select Open an Existing Project and locate the opy-sdk-android-5.24.x-example-code-upi folder.
- When the project has built, select the required project from the dropdown menu (not the side file list); see the example projects below.
- 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 playback Widevine-encrypted streams.
- ssm-encrypted-playback-upi - Shows how to playback Widevine-encrypted streams with Secure Session Management.
- track-selection-upi - Shows how to detect and select tracks in streams with subtitles, multi-audio and multi-video.
- resolution-capping-upi - Playback of clear streams with resolution capping.
- thumbnails-upi - Playback of clear streams with DASH-IF thumbnail previews.