Triton Mobile SDK for Android 3.5.1
This is a custom android player made by Triton Digital
Loading...
Searching...
No Matches
com.tritondigital.player.StreamPlayer Class Reference

Low level streaming player. More...

Inheritance diagram for com.tritondigital.player.StreamPlayer:
com.tritondigital.player.MediaPlayer

Public Member Functions

 StreamPlayer (@NonNull Context context, @NonNull Bundle settings, boolean isTimeshiftStreaming)
 Constructor.
 
boolean isTimeshiftStreaming ()
 
int getDuration ()
 
int getPosition ()
 
float getVolume ()
 
void setVolume (float volume)
 
void setMediaRoute (MediaRouter.RouteInfo routeInfo)
 
- Public Member Functions inherited from com.tritondigital.player.MediaPlayer
 MediaPlayer (Context context, Bundle settings)
 Constructor.
 
Bundle getSettings ()
 Returns the settings of this player.
 
int getState ()
 Returns the player's state.
 
Bundle getLastCuePoint ()
 Returns the last received cue point.
 
int getLastErrorCode ()
 Returns the last error code.
 
OnCuePointReceivedListener getOnCuePointReceivedListener ()
 Returns the cue point listener.
 
OnMetaDataReceivedListener getMetadataListener ()
 Returns the metadata listener.
 
OnInfoListener getOnInfoListener ()
 Returns the info listener.
 
OnStateChangedListener getOnStateChangedListener ()
 Returns the state changed listener.
 
OnAnalyticsReceivedListener getAnalyticsReceivedListener ()
 
OnCloudStreamInfoReceivedListener getCloudStreamInfoReceivedListener ()
 
void setOnCuePointReceivedListener (OnCuePointReceivedListener listener)
 Sets the cue point event listener.
 
void setOnMetaDataReceivedListener (OnMetaDataReceivedListener listener)
 Sets the cue point event listener.
 
void setOnInfoListener (OnInfoListener listener)
 Sets the info listener.
 
void setOnStateChangedListener (OnStateChangedListener listener)
 Sets the state changed listener.
 
void setOnAnalyticsReceivedListener (OnAnalyticsReceivedListener listener)
 Sets the analytics changed listener.
 
void setOnCloudStreamInfoReceivedListener (OnCloudStreamInfoReceivedListener listener)
 Sets the timeshift programs listener.
 
boolean isSeekable ()
 Returns true if the media is seekable in the current state.
 
boolean isPausable ()
 Returns true if the media can be paused at the current state.
 
final void seekTo (int position, int original)
 Seek to the provided position.
 
final void seekTo (int position)
 Seek to the provided position.
 
void seek (int delta)
 Seek to a time from the current position.
 
final void seekToLive ()
 
void getCloudStreamInfo ()
 
void playProgram (String programId)
 
final void play ()
 
final void play (boolean timeshiftStreaming)
 Starts the playback.
 
final void pause ()
 Pauses the playback so it can be resumed at the same position by calling play().
 
final void changeSpeed (Float speed)
 
final void stop ()
 Stops the playback.
 
final void release ()
 Releases the player resources.
 
int getErrorCode ()
 

Static Public Attributes

static final String SETTINGS_AUTH_TOKEN = PlayerConsts.AUTH_TOKEN
 
static final String SETTINGS_AUTH_KEY_ID = PlayerConsts.AUTH_KEY_ID
 
static final String SETTINGS_AUTH_SECRET_KEY = PlayerConsts.AUTH_SECRET_KEY
 
static final String SETTINGS_AUTH_REGISTERED_USER = PlayerConsts.AUTH_REGISTERED_USER
 
static final String SETTINGS_AUTH_USER_ID = PlayerConsts.AUTH_USER_ID
 
static final String SETTINGS_MEDIA_ITEM_METADATA = PlayerConsts.MEDIA_ITEM_METADATA
 
static final String SETTINGS_STATION_MOUNT = PlayerConsts.STATION_MOUNT
 
static final String SETTINGS_SBM_URL = PlayerConsts.SBM_URL
 
static final String SETTINGS_TARGETING_LOCATION_TRACKING_ENABLED = PlayerConsts.TARGETING_LOCATION_TRACKING_ENABLED
 
static final String SETTINGS_TARGETING_PARAMS = PlayerConsts.TARGETING_PARAMS
 
static final String SETTINGS_STREAM_MIME_TYPE = PlayerConsts.MIME_TYPE
 
static final String SETTINGS_STREAM_POSITION = PlayerConsts.POSITION
 
static final String SETTINGS_STREAM_URL = PlayerConsts.STREAM_URL
 
static final String SETTINGS_TIMESHIFT_STREAM_URL = PlayerConsts.TIMESHIFT_STREAM_URL
 
static final String SETTINGS_TIMESHIFT_PROGRAM_URL = PlayerConsts.TIMESHIFT_PROGRAM_URL
 
static final String SETTINGS_TRANSPORT = PlayerConsts.TRANSPORT
 
static final String SETTINGS_LOW_DELAY = PlayerConsts.LOW_DELAY
 
static final String SETTINGS_TTAGS = PlayerConsts.TTAGS
 
static final String SETTINGS_DMP_SEGMENTS = PlayerConsts.DMP_SEGMENTS
 
static final String SETTINGS_USER_AGENT = PlayerConsts.USER_AGENT
 
- Static Public Attributes inherited from com.tritondigital.player.MediaPlayer
static final int ERROR_LOW_LEVEL_PLAYER_ERROR = 210
 Error code indicating an error in the OS player or Google Cast.
 
static final int ERROR_CONNECTION_FAILED = 211
 Error code indicating a connection problem to the server.
 
static final int ERROR_CONNECTION_TIMEOUT = 408
 Error code indicating than the connection has timed out.
 
static final int ERROR_UNEXPECTED_END_OF_MEDIA = 213
 Error code indicating the end of a media which shouldn't occur on live streaming.
 
static final int ERROR_UNEXPECTED_END_OF_MEDIA_ANDROID_PLAYER = 214
 Error code indicating the end of a media which shouldn't occur on live streaming.
 
static final int ERROR_EXOPLAYER_BUFFER_RECONNECT = 212
 Error code indicating that low delay increased 3 times an still did not fill the buffer.
 
static final int ERROR_EXOPLAYER_BUFFER_TIMEOUT = 218
 Error code indicating buffer timed out.
 
static final int ERROR_EXOPLAYER_ON_ERROR = 219
 Error code indicating buffer timed out.
 
static final int ERROR_GEOBLOCKED = 453
 Error code indicating that the stream can't be used in the user location.
 
static final int ERROR_INVALID_URL = 216
 Error code indicating that the URL isn't in a valid format.
 
static final int ERROR_NO_NETWORK = 217
 Error code indicating the lack of network connectivity.
 
static final int ERROR_NOT_FOUND = 404
 Error code indicating that the input source couldn't be found.
 
static final int ERROR_SERVICE_UNAVAILABLE = 503
 Error code indicating that no server is available.
 
static final int STATE_COMPLETED = 200
 The end of the media source has been reached (on-demand only)
 
static final int STATE_CONNECTING = 201
 The player is connecting to the server or buffering.
 
static final int STATE_ERROR = 202
 An error has occurred.
 
static final int STATE_PLAYING = 203
 The playback is started.
 
static final int STATE_RELEASED = 204
 The resources have been released and this player instance can no longer be used.
 
static final int STATE_STOPPED = 205
 The playback is stopped.
 
static final int STATE_PAUSED = 206
 The playback is paused (on-demand only)
 
static final int DURATION_LIVE_STREAM = Integer.MAX_VALUE
 Live stream.
 
static final int DURATION_UNKNOWN = -1
 Unknown duration.
 
static final int POSITION_UNKNOWN = 0
 Unknown position.
 
static final float VOLUME_DUCK = 0.2f
 Ducked volume.
 
static final float VOLUME_MUTE = 0.0f
 Muted volume.
 
static final float VOLUME_NORMAL = 1.0f
 Normal volume.
 
static final int INFO_ALTERNATE_MOUNT = 270
 A the player has connected to an alternate mount.
 
static final int INFO_SEEK_COMPLETED = 271
 A seek operation has completed.
 
static final int INFO_DURATION_CHANGED = 272
 Media duration changed (extra=duration)
 
static final int INFO_SEEKABLE_CHANGED = 273
 Seekable state change (0=false / 1=true)
 
static final int INFO_SEEK_STARTED = 274
 A seek operation has begun.
 
static final int INFO_BUFFERING_START = 275
 Temporarily pausing playback internally in order to buffer more data.
 
static final int INFO_BUFFERING_COMPLETED = 276
 The playback is resumed after filling buffers.
 
static final int ERROR_END_OF_MEDIA = ERROR_UNEXPECTED_END_OF_MEDIA
 

Protected Member Functions

void internalPlay ()
 
void internalPlay (boolean timeshiftStreaming)
 
void internalPause ()
 
void internalStop ()
 
void internalChangeSpeed (Float speed)
 
void internalRelease ()
 
void internalSeekTo (int position, int original)
 
void internalGetCloudStreamInfo ()
 
void internalPlayProgram (String programId)
 
String makeTag ()
 
boolean isEventLoggingEnabled ()
 

Additional Inherited Members

- Static Public Member Functions inherited from com.tritondigital.player.MediaPlayer
static boolean isPlayValidInState (int state)
 Returns true if a play request is valid in the provided state.
 
static boolean isTransitionValid (int state0, int state1)
 Returns true if the provided state transition is valid.
 
static String debugErrorToStr (int errorCode)
 Utility method to convert an error code to a debug string.
 
static String debugInfoToStr (int info)
 Utility method to convert an info code to a debug string.
 
static String debugStateToStr (int state)
 Utility method to convert the player state to a debug string.
 
- Protected Attributes inherited from com.tritondigital.player.MediaPlayer
final String TAG = makeTag()
 
final Bundle mSettings
 

Detailed Description

Low level streaming player.

A new instance must be created in order to change the URL.

Supported cue points:

  • FLV stream
  • Side-Band Metadata

Member Function Documentation

◆ getDuration()

int com.tritondigital.player.StreamPlayer.getDuration ( )

◆ getPosition()

int com.tritondigital.player.StreamPlayer.getPosition ( )

◆ getVolume()

float com.tritondigital.player.StreamPlayer.getVolume ( )

◆ internalChangeSpeed()

void com.tritondigital.player.StreamPlayer.internalChangeSpeed ( Float  speed)
protected

◆ internalGetCloudStreamInfo()

void com.tritondigital.player.StreamPlayer.internalGetCloudStreamInfo ( )
protected

◆ internalPause()

void com.tritondigital.player.StreamPlayer.internalPause ( )
protected

◆ internalPlay() [1/2]

void com.tritondigital.player.StreamPlayer.internalPlay ( )
protected

◆ internalPlay() [2/2]

void com.tritondigital.player.StreamPlayer.internalPlay ( boolean  timeshiftStreaming)
protected

◆ internalPlayProgram()

void com.tritondigital.player.StreamPlayer.internalPlayProgram ( String  programId)
protected

◆ internalRelease()

void com.tritondigital.player.StreamPlayer.internalRelease ( )
protected

◆ internalSeekTo()

void com.tritondigital.player.StreamPlayer.internalSeekTo ( int  position,
int  original 
)
protected

◆ internalStop()

void com.tritondigital.player.StreamPlayer.internalStop ( )
protected

◆ isEventLoggingEnabled()

boolean com.tritondigital.player.StreamPlayer.isEventLoggingEnabled ( )
protected

◆ isTimeshiftStreaming()

boolean com.tritondigital.player.StreamPlayer.isTimeshiftStreaming ( )

◆ makeTag()

String com.tritondigital.player.StreamPlayer.makeTag ( )
protected

◆ setVolume()

void com.tritondigital.player.StreamPlayer.setVolume ( float  volume)

The documentation for this class was generated from the following file: