Android OpenTV Player SDK  5.35.0.1710620932
OTVMediaPlayer Class Reference

Detailed Description

OTVMediaPlayer class can be used to return the playback information of audio/video streams. The playback of the streams must be done via the nagra.otv.sdk.OTVVideoView class.

Inherits MediaPlayer.

Public Member Functions

boolean addSubtitleSource (String url, String mimeType, String language)
 Adds an external subtitle source to the content. More...
 
void setMutualAuthentication (SSLSocketFactory sslSocketFactory)
 Sets the mutual authentication information on OTVMediaPlayer. More...
 
void setOkHttpClient (OkHttpClient xOkHttpClient)
 Sets OkHttp3 configurations for playback network engine on OTVMediaPlayer. More...
 

Static Public Attributes

static final int MEDIA_INFO_UNKNOWN = 1
 Unspecified media player info. More...
 
static final int MEDIA_INFO_VIDEO_RENDERING_START = 3
 The player just pushed the very first video frame for rendering. More...
 
static final int MEDIA_INFO_BUFFERING_START = 701
 MediaPlayer is temporarily pausing playback internally in order to buffer more data. More...
 
static final int MEDIA_INFO_BUFFERING_END = 702
 MediaPlayer is resuming playback after filling buffers. More...
 
static final int MEDIA_INFO_LOAD_START = 798
 load start event happens. More...
 
static final int MEDIA_INFO_STALLED = 799
 Stalled event happens. More...
 
static final int MEDIA_INFO_METADATA_UPDATE = 802
 A new set of metadata is available. More...
 
static final int MEDIA_INFO_METADATA_EXTRA_TRACKS_CHANGED = 1
 media track change happens, this is extra value for MediaPlayer.MEDIA_INFO_METADATA_UPDATE More...
 
static final int MEDIA_ERROR_UNKNOWN = 1
 Unspecified media player error. More...
 
static final int MEDIA_ERROR_OPY_LICENSE_INVALID = -1350
 
static final int MEDIA_ERROR_OPY_LICENSE_EXPIRED = -1351
 
static final int MEDIA_ERROR_OPY_SSM_SETUP_FAILURE = -1352
 SSM setup session request get failure. More...
 
static final int MEDIA_ERROR_OPY_SSM_RENEWAL_FAILURE = -1353
 SSM session renewal request get failure. More...
 
static final int MEDIA_ERROR_OPY_SSM_TEARDOWN_FAILURE = -1354
 SSM session teardown request get failure. More...
 
static final int MEDIA_ERROR_OPY_DRM_DECRYPTION_FAILURE = -1355
 DRM decryption error during playback. More...
 
static final int MEDIA_ERROR_OPY_DRM_NOT_SUPPORTED = -1356
 DRM type not supported on this device. More...
 
static final int MEDIA_ERROR_DECODER_ERROR = -1357
 Decoder errors (not supported). More...
 
static final int MEDIA_ERROR_LICENSE_KEY_EXPIRED = -1358
 Licence keys expired. More...
 
static final int MEDIA_ERROR_LICENSE_SESSION_FAILURE = -1359
 DRM Session Exception. More...
 
static final int MEDIA_ERROR_LICENSE_SCHEME_DATA_FAILURE = -1360
 Missing Scheme data for DRM session (data for uuid not found). More...
 
static final int MEDIA_ERROR_LICENSE_DRM_SESSION_FAILURE = -1361
 Non-specified DRM session manager error. More...
 
static final int MEDIA_ERROR_LICENSE_NO_KEY = -1362
 no required key in license. More...
 
static final int MEDIA_ERROR_AUDIO_TRACK_INIT_FAILED = 5100
 Audio track init failed. More...
 
static final int MEDIA_ERROR_PAK = -2000
 PAK error. More...
 
static final int MEDIA_ERROR_PAK_UNKNOWN = -2001
 Unspecified PAK error. More...
 
static final int MEDIA_ERROR_PAK_LICENSE_FETCH_FAILURE = -2002
 Fetch license failure. More...
 
static final int MEDIA_ERROR_PAK_ACCESS_DENIED = -2003
 PAK session access denied. More...
 
static final int MEDIA_ERROR_CONNECT = -3000
 Connect error. More...
 
static final int MEDIA_ERROR_CONNECT_UNKNOWN = -3001
 Unspecified Connect error. More...
 
static final int MEDIA_ERROR_CONNECT_LICENSE_FETCH_FAILURE = -3002
 Fetch license failure. More...
 
static final int MEDIA_ERROR_CONNECT_KEY_STATUS_INVALID = -3003
 Connect key status invalid. More...
 
static final int MEDIA_ERROR_CONNECT_NOT_PROVISIONED = -3004
 Connect device not provisioned. More...
 
static final int MEDIA_ERROR_CONNECT_DECRYPTION_FAILURE = -3005
 Connect decryption failure. More...
 
static final int MEDIA_ERROR_CONNECT_PROVISION_FAILURE = -3006
 Connect provision failure. More...
 
static final int MEDIA_ERROR_CONNECT_MEDIASERVER_DIED = -3007
 Connect media server died. More...
 
static final int MEDIA_ERROR_CONNECT_MEDIASERVER_RESET = -3008
 Connect media server reset failure. More...
 
static final int MEDIA_ERROR_CONNECT_SESSION_INVAILD = -3009
 Connect session invalid. More...
 
static final int MEDIA_ERROR_SSP = -3100
 SSP server error. More...
 
static final int MEDIA_ERROR_PROVISION = -3200
 Provision error. More...
 
static final int MEDIA_ERROR_THUMBNAIL = -3300
 Thumbnail error. More...
 
static final int MEDIA_ERROR_CONTENT_TOKEN = -3400
 Content token error. More...
 

Member Function Documentation

◆ addSubtitleSource()

boolean addSubtitleSource ( String  url,
String  mimeType,
String  language 
)

Adds an external subtitle source to the content.

An external subtitle/caption source can be added to the content to play back via this method. Currently only SRT subs are supported.

Parameters
urlthe remote url of the subtitles
mimeTypethe mime type of the subtitles (must be "application/x-subrip" currently)
languagethe language identifier of the subtitles (will appear in subtitle track selection)
Returns
false if no video path/url has been set or the url/mime type is invalid, true otherwise

◆ setMutualAuthentication()

void setMutualAuthentication ( SSLSocketFactory  sslSocketFactory)

Sets the mutual authentication information on OTVMediaPlayer.

Parameters
sslSocketFactorySSLSocketFactory instance.

◆ setOkHttpClient()

void setOkHttpClient ( OkHttpClient  xOkHttpClient)

Sets OkHttp3 configurations for playback network engine on OTVMediaPlayer.

Parameters
xOkHttpClientOkHttpClient instance.

Member Data Documentation

◆ MEDIA_ERROR_AUDIO_TRACK_INIT_FAILED

final int MEDIA_ERROR_AUDIO_TRACK_INIT_FAILED = 5100
static

Audio track init failed.

◆ MEDIA_ERROR_CONNECT

final int MEDIA_ERROR_CONNECT = -3000
static

Connect error.

◆ MEDIA_ERROR_CONNECT_DECRYPTION_FAILURE

final int MEDIA_ERROR_CONNECT_DECRYPTION_FAILURE = -3005
static

Connect decryption failure.

◆ MEDIA_ERROR_CONNECT_KEY_STATUS_INVALID

final int MEDIA_ERROR_CONNECT_KEY_STATUS_INVALID = -3003
static

Connect key status invalid.

◆ MEDIA_ERROR_CONNECT_LICENSE_FETCH_FAILURE

final int MEDIA_ERROR_CONNECT_LICENSE_FETCH_FAILURE = -3002
static

Fetch license failure.

◆ MEDIA_ERROR_CONNECT_MEDIASERVER_DIED

final int MEDIA_ERROR_CONNECT_MEDIASERVER_DIED = -3007
static

Connect media server died.

◆ MEDIA_ERROR_CONNECT_MEDIASERVER_RESET

final int MEDIA_ERROR_CONNECT_MEDIASERVER_RESET = -3008
static

Connect media server reset failure.

◆ MEDIA_ERROR_CONNECT_NOT_PROVISIONED

final int MEDIA_ERROR_CONNECT_NOT_PROVISIONED = -3004
static

Connect device not provisioned.

◆ MEDIA_ERROR_CONNECT_PROVISION_FAILURE

final int MEDIA_ERROR_CONNECT_PROVISION_FAILURE = -3006
static

Connect provision failure.

◆ MEDIA_ERROR_CONNECT_SESSION_INVAILD

final int MEDIA_ERROR_CONNECT_SESSION_INVAILD = -3009
static

Connect session invalid.

◆ MEDIA_ERROR_CONNECT_UNKNOWN

final int MEDIA_ERROR_CONNECT_UNKNOWN = -3001
static

Unspecified Connect error.

◆ MEDIA_ERROR_CONTENT_TOKEN

final int MEDIA_ERROR_CONTENT_TOKEN = -3400
static

Content token error.

◆ MEDIA_ERROR_DECODER_ERROR

final int MEDIA_ERROR_DECODER_ERROR = -1357
static

Decoder errors (not supported).

◆ MEDIA_ERROR_LICENSE_DRM_SESSION_FAILURE

final int MEDIA_ERROR_LICENSE_DRM_SESSION_FAILURE = -1361
static

Non-specified DRM session manager error.

◆ MEDIA_ERROR_LICENSE_KEY_EXPIRED

final int MEDIA_ERROR_LICENSE_KEY_EXPIRED = -1358
static

Licence keys expired.

◆ MEDIA_ERROR_LICENSE_NO_KEY

final int MEDIA_ERROR_LICENSE_NO_KEY = -1362
static

no required key in license.

◆ MEDIA_ERROR_LICENSE_SCHEME_DATA_FAILURE

final int MEDIA_ERROR_LICENSE_SCHEME_DATA_FAILURE = -1360
static

Missing Scheme data for DRM session (data for uuid not found).

◆ MEDIA_ERROR_LICENSE_SESSION_FAILURE

final int MEDIA_ERROR_LICENSE_SESSION_FAILURE = -1359
static

DRM Session Exception.

◆ MEDIA_ERROR_OPY_DRM_DECRYPTION_FAILURE

final int MEDIA_ERROR_OPY_DRM_DECRYPTION_FAILURE = -1355
static

DRM decryption error during playback.

◆ MEDIA_ERROR_OPY_DRM_NOT_SUPPORTED

final int MEDIA_ERROR_OPY_DRM_NOT_SUPPORTED = -1356
static

DRM type not supported on this device.

◆ MEDIA_ERROR_OPY_LICENSE_EXPIRED

final int MEDIA_ERROR_OPY_LICENSE_EXPIRED = -1351
static
Deprecated:
A valid license was set at SDK initialisation but has expired

◆ MEDIA_ERROR_OPY_LICENSE_INVALID

final int MEDIA_ERROR_OPY_LICENSE_INVALID = -1350
static
Deprecated:
Either an invalid License, no License at all.

◆ MEDIA_ERROR_OPY_SSM_RENEWAL_FAILURE

final int MEDIA_ERROR_OPY_SSM_RENEWAL_FAILURE = -1353
static

SSM session renewal request get failure.

◆ MEDIA_ERROR_OPY_SSM_SETUP_FAILURE

final int MEDIA_ERROR_OPY_SSM_SETUP_FAILURE = -1352
static

SSM setup session request get failure.

◆ MEDIA_ERROR_OPY_SSM_TEARDOWN_FAILURE

final int MEDIA_ERROR_OPY_SSM_TEARDOWN_FAILURE = -1354
static

SSM session teardown request get failure.

◆ MEDIA_ERROR_PAK

final int MEDIA_ERROR_PAK = -2000
static

PAK error.

◆ MEDIA_ERROR_PAK_ACCESS_DENIED

final int MEDIA_ERROR_PAK_ACCESS_DENIED = -2003
static

PAK session access denied.

◆ MEDIA_ERROR_PAK_LICENSE_FETCH_FAILURE

final int MEDIA_ERROR_PAK_LICENSE_FETCH_FAILURE = -2002
static

Fetch license failure.

◆ MEDIA_ERROR_PAK_UNKNOWN

final int MEDIA_ERROR_PAK_UNKNOWN = -2001
static

Unspecified PAK error.

◆ MEDIA_ERROR_PROVISION

final int MEDIA_ERROR_PROVISION = -3200
static

Provision error.

◆ MEDIA_ERROR_SSP

final int MEDIA_ERROR_SSP = -3100
static

SSP server error.

◆ MEDIA_ERROR_THUMBNAIL

final int MEDIA_ERROR_THUMBNAIL = -3300
static

Thumbnail error.

◆ MEDIA_ERROR_UNKNOWN

final int MEDIA_ERROR_UNKNOWN = 1
static

Unspecified media player error.

See also
android.media.MediaPlayer.OnErrorListener

◆ MEDIA_INFO_BUFFERING_END

final int MEDIA_INFO_BUFFERING_END = 702
static

MediaPlayer is resuming playback after filling buffers.

See also
android.media.MediaPlayer.OnInfoListener

◆ MEDIA_INFO_BUFFERING_START

final int MEDIA_INFO_BUFFERING_START = 701
static

MediaPlayer is temporarily pausing playback internally in order to buffer more data.

See also
android.media.MediaPlayer.OnInfoListener

◆ MEDIA_INFO_LOAD_START

final int MEDIA_INFO_LOAD_START = 798
static

load start event happens.

◆ MEDIA_INFO_METADATA_EXTRA_TRACKS_CHANGED

final int MEDIA_INFO_METADATA_EXTRA_TRACKS_CHANGED = 1
static

media track change happens, this is extra value for MediaPlayer.MEDIA_INFO_METADATA_UPDATE

See also
android.media.MediaPlayer.OnInfoListener

◆ MEDIA_INFO_METADATA_UPDATE

final int MEDIA_INFO_METADATA_UPDATE = 802
static

A new set of metadata is available.

See also
android.media.MediaPlayer.OnInfoListener

◆ MEDIA_INFO_STALLED

final int MEDIA_INFO_STALLED = 799
static

Stalled event happens.

◆ MEDIA_INFO_UNKNOWN

final int MEDIA_INFO_UNKNOWN = 1
static

Unspecified media player info.

See also
android.media.MediaPlayer.OnInfoListener

◆ MEDIA_INFO_VIDEO_RENDERING_START

final int MEDIA_INFO_VIDEO_RENDERING_START = 3
static

The player just pushed the very first video frame for rendering.

See also
android.media.MediaPlayer.OnInfoListener