# Android SDK documentation

Version: 4.5.0.rc2

## About

This is the Documentation for the PRESTOplay SDK for Android version 4.5.0.rc2.

The PRESTOplay SDK for Android provides the necessary components for partners and companies to implement their own player application for Android. This document specifically describes the capabilities of the PRESTOplay SDK for Android on the Android mobile platform.

Castlabs has developed and maintains a Java Android library called the PRESTOplay SDK for Android, which is distributed in the form of a AAR (Android Archive file). The SDK is based internally in Google’s open source ExoPlayer and provides extra functionality in form of plugins.

The main features of the SDK and the plugins bundled with the SDK are:

> - Playback of MPEG-DASH, SmoothStreaming, HLS, and MP4 content.

> - Playback of streaming and local content.

> - Playback of DRM protected content using Widevine or PlayReady.

> - Live, event, and video-on-demand support.

> - Extended subtitles support.

> - Background playback using a Service.

> - Secondary screen handling.

> - Offline license key storage.

The PRESTOplay SDK for Android core and it main components, plugins, and extension points.

## Table of Content

- Project Setup
  - Requirements
  - Project Configuration
  - License Loading
    - User Id
  - Third party re-signing conflicts
    - Protection tools
    - Amazon App Store
  - Variant Builds
  - Split APK Builds
  - Proguard Configuration
  - Protocol buffer dependencies
- Player Basics
  - Activity and Layout
  - Starting Playback
  - Starting Playback from a `PlayerConfig`
  - Starting Playback from an `Intent`
    - Playback Local Content
  - Mandatory Callbacks
  - Background Playback
  - Audio Focus
    - Disabling Audio Focus Management
    - Callback for Audio Focus loss
- Advanced Setup
  - Live Playback
    - LiveConfiguration
    - Low latency
    - Staying inside the Live Window
  - Fast playback or Trickplay
    - Setup and usage
    - TrickplayConfiguration
  - Custom SSL key store
  - DASH adaptations grouping
  - Live Edge Catchup
    - Live Edge Catchup Types
    - Time reference
    - Thresholds behaviour
    - Configuration
    - Callback
  - Connected HDMI display
    - HDMI cable connection
    - HDMI display on and off
    - HDCP exception timeout
  - Decoder selection and fallback
  - HLS Clearkey caching
  - Video quality blocklist upon frame drops (experimental)
  - SDK and PlayerController initialization
    - Initialization Behavior
    - DRM capabilities detection
    - Common Media Client Data(CMCD)
    - Recommendations
  - Workarounds
- The Player Controller
  - Basic Controls
  - Player Callbacks
  - Player States
  - Error Handling
  - Video Resolution Filters
  - Player Model and Track Selection
  - Video track selection
  - Video tracks merging option
  - Audio track selection
  - Adaptive Bitrate Switching
    - ABR Log Statements And Parameters
    - Common Media Server Data (CMSD) header
  - Additional Query Parameter
    - Request Modifiers
    - Network Configuration
  - CDN fallback feature
  - Sideloaded Subtitle Tracks
  - Streaming and Playback Events
  - Live Playback
    - Live configuraiton
  - Secondary Displays
  - Tunneling Support
  - Playlist Support
    - MultiControllerPlaylist
    - SingleControllerPlaylist
- The Player View
  - Basic Integration
  - Hiding the Surface
  - Scaling Mode
  - PlayerView Plugins
- DRM Protection
  - DRM Systems and Security Levels
  - DRMtoday Integration
  - Using DRMtoday
    - Upfront Authentication
  - Offline Key Storage
    - Offline key removal
    - Expired Keys and System Time Changes
    - Automatic keys renewal
  - Multi-DRM Environments
  - Multi-key Playbacks
  - Key rotation
  - Clear Lead
  - DRM URL
  - Troubleshooting - DRMToday trace identifiers
  - DRMtoday OnBoard
  - DRM Integration with Other Service Providers
  - Root Device Detection
- Global Configuration
- Extensions
  - Subtitles and Closed Captions
    - Subtitle FCC Fonts
    - Subtitle Styles
    - Subtitle Preview
    - Subtitles View
  - Recovering From Loss Of Connectivity
    - Handling Connectivity Loss for Live Playback
    - Customize Connectivity Check
  - Offline Keys
    - Key info
  - Interactive Media Ads (IMA)
    - Custom ad UI
    - IMA request options
    - Ad Creative Format Fallback
    - Manual ad Scheduling
  - Downloader
    - Scoped Storage
    - Request and Response Modifiers
  - Analytics
    - Analytics settings
    - Session detaching
    - Youbora
    - Nielsen
    - Mux
    - Conviva
    - Broadpeak
    - Vimond
    - Adobe
  - Crash Logging
    - Crashlytics Integration
  - User Agent
  - Streamroot Plugin
  - OkHttp Plugin
    - Intercept Traffic
    - Idle connection eviction
  - Thumbnails
    - Loading strategy
    - Disk cache configuration
    - Network Configuration
    - Embedded
    - Side-loaded
    - Using the built-in thumbnails view
    - Thumbnail rendering time tolerance
    - Thumbnail index selection
    - Downloader integration
    - Thumbnail loading details
    - Standalone Thumbnail providers
  - 360-Degree Playback Plugin
    - Google Cardboard
  - Google cast Manager
  - AndroidX Media2
  - Drm Device Time Checker
- Player Debugging
  - Adding to the project
  - Graphics
    - Charts
    - PlayerMetricChart and Metrics
    - Metric creation
  - AV Sync
  - Generic Logging in Builds
  - Known Compatibility Issues
  - Third party acknowledgement
- Example Projects
  - Streams Demo
  - Demos
- Kotlin
  - ConfigExtensions
  - ControllerExtensions
- Upgrade Guides
  - Changes in 4.2.4
  - Changes in 4.2
    - StreamingEventListener
    - AbstractStreamEventListener
    - Downloader
    - DRM
    - KeyStore
    - KeyStore in PlayerController
    - Ads & IMA plugin
    - SubtitlesViewComponent
    - StreamingEventListener
    - Image loader
    - Playback configuration
- Licensing
- Multicast Support
  - Basic Integration
  - URL Configuration
  - DRM Support with IPTV (experimental)
  - IPTV Read Timeout

API Docs

- SDK API
- Thumbs-Plugin API
- UI-Plugin API
- OkHttp-Plugin API
- Ads API (IMA)
- Downloader API
- Nielsen API
- Youbora API
- Conviva API
- Broadpeak API
- Google Cast Manager API
- Media Session API
- Subtitles Presentation API