Multi-instance
To test this feature and view the example code, please see the Android SDK 5 Example Code Quick Start guide.
The multi-instance feature enables simultaneous playback of multiple streams for Picture-in-Picture (PiP) capabilities, previews and other scenarios. It is facilitated by having multiple instances of the CONNECT Player; to play more than one stream simultaneously, a player must be created for each stream.
The SDK depends on the device hardware decoding and rendering. Performance is not guaranteed as some devices may struggle when playing more than one stream, especially when decryption or high bitrates are involved.
To facilitate multiple playbacks:
You must define screen space for each player and associate each with its
OTVVideoView
instance; in the activity’s layout file, anagra.otv.sdk.OTVVideoView
entry must be created for each player (unless created programmatically).Each
OTVVideoView
instance must be configured separately with its stream definitions, player, callbacks, listeners and controls.The event handlers (e.g.
onStart()
,onPause()
,onResume()
) have to handle allOTVVideoView
instances.Each player instance is controlled separately. If, for example, a second player is set up for PiP, it is the application’s responsibility to mute the second player’s audio (setting its volume to 0).