public interface

VideoPlayerView

com.akamai.media.VideoPlayerView
Known Indirect Subclasses

Class Overview

Interface implemented by any of the Android SDK video controls. Allow to access to the video control in a generic way, independently of the decoding method used.

Summary

Constants
int DROP_WRONG_TIMESTAMP_PACKETS_ALWAYS Packets with wrong timestamps will be always dropped
int DROP_WRONG_TIMESTAMP_PACKETS_NEVER Packets with wrong timestamps will be never dropped
int DROP_WRONG_TIMESTAMP_PACKETS_ONLY_VOD Packets with wrong timestamps will be dropped only for VOD streams
int ERROR_FORMAT_UNKNOWN The provided stream doesn't have a known format
int ERROR_NETWORK_RESOURCE_DONT_EXIST Resource (stream URL) doesn't exist
int ERROR_NETWORK_SECURITY_ISSUE Access not allowed to the provided stream URL
int ERROR_NETWORK_UNAVAILABLE Network access is not available
int ERROR_RESOURCES_ISSUE There was an issue while allocating resources for playback
int ERROR_SUCCESS No error
int ERROR_TS_SEGMENT_INVALID The provided stream contains format errors
int FULLSCREEN_MODE_KEEP_ASPECT_RATIO Fullscreen enabled, keeping original aspect ratio
int FULLSCREEN_MODE_NONE Fullscreen disabled
int FULLSCREEN_MODE_TOTAL Fullscreen enabled, filling the full control
int HLS_STARTING_ALGORITHM_AKAMAI Starting algorithm designed by Akamai, optimized to cover the max number of devices with the starting bitrate.
int HLS_STARTING_ALGORITHM_APPLE Starting algorithm implemented in iDevices.
int MEDIA_REBUFFERING_MODE_AUTOMATIC Rebuffering mode automatic
int MEDIA_REBUFFERING_MODE_MANUAL Rebuffering mode manual
int MEDIA_VIDEO_QUALITY_AUTO Video Quality Auto
int MEDIA_VIDEO_QUALITY_HIGH Video Quality High
int MEDIA_VIDEO_QUALITY_LOW Video Quality Low
int MEDIA_VIDEO_QUALITY_MEDIUM Video Quality Medium
int NETSESSION_MODE_ALLOWED NetSession will be used by default but, in case of an error, the player will automatically disable it.
int NETSESSION_MODE_DISABLED NetSession disabled.
int NETSESSION_MODE_REQUIRED NetSession required.
String VERSION Version of the Akamai Android SDK video component
Public Methods
abstract String about()
Get the about text.
abstract void clearRenderBuffer()
Clears the screen render buffer.
abstract long getAvgFPS()
For the current playback, get the average FPS (Frames per Second) This method doesn't make sense in the hardware version of the SDK as the hardware decoder doesn't provide this information
abstract int getBitrateByIndex(int index)
Return the bitrate (bps) for the variant indicated in the index parameter
abstract int getBitratesCount()
Get the number of available bitrate indexes for the loaded stream
abstract int getBitratesSwitchesDown()
For multibirate streams, get the number of times the control has switched down
abstract int getBitratesSwitchesUp()
For multibirate streams, get the number of times the control has switched up
abstract int getBufferingPercentage()
Get the rebuffering percentage
abstract long getBytesLoaded()
For the current playback, get the number of bytes loaded
abstract long getCurrentBitrate()
Get the current bitrate of the video in bps
abstract String getCurrentSegmentUrl()
abstract long getDVRLength()
Get the lenght, in seconds, of the DVR
abstract int getDuration()
Get the duration of the video in seconds.
abstract double getEncodedFPS()
Get the encoded frames per second for the loaded stream This method is not supported on Hardware and Hardware Advanced decoding modes
abstract long getFPS()
Get the current FPS (Frames per Second)
abstract AMPFeed getFeed()
Returns the feed of the loaded stream (in case playback was launched providing a json feed)
abstract int getFullScreenMode()
Return the fullscreen mode
abstract int getHeight()
Return the height of this view
abstract int getIndexByBitrate(int bitrate)
Return the index for the bitrate indicated in the bitrate parameter (bps)
abstract int getLastErrorCode()
Returns the last error code that happens during the playback
abstract int getLastHttpErrorCode()
Get error code of the last HTTP request
abstract int getLastMeasuredBandwidth()
Returns the last measured bandwidth in bytes/sec
abstract long getLastPTS()
Get the PTS of the last packet read by the decoder
abstract Date getLicenseExpirationDate()
Returns the expiration date of the set license
abstract String getLicensePackageName()
Returns the package name for which the set license is valid
abstract int[] getLocationOnScreen()
Computes the coordinates of this view on the screen
abstract int getPositionInDVR()
Return the current playback position in the DVR in seconds
abstract View getProgressBarControl()
Gets the progress bar control that is shown whenever the player is doing a buffering/loading operation
abstract String getProtocol()
Get the protocol of the current loaded stream
abstract double getRebufferingTime()
Get the total time the player has been rebuffering in seconds
abstract int getRebuffers()
Get the number of rebuffers occurred
abstract String getServerIp()
Get the Server IP of the current loaded stream
abstract int getServerPort()
Get the Server port for the current loaded stream
abstract String getStreamUrl()
Returns the url of the loaded stream
abstract String getStreamsInfo()
Return information about the streams
abstract int getTimePosition()
Return the current playback position in seconds
abstract Date getTimePositionAsDate()
Return the current playback position as a local time date
abstract long getTimePositionMS()
Return the current playback position in milliseconds
abstract String getVersionDescription()
Get extended information about the SDK version
abstract int getVideoHeight()
Get the height of the video
abstract int getVideoWidth()
Get the width of the video
abstract int getWidth()
Return the width of this view
abstract boolean isAudioOnly()
Return true if the current bitrate is an audio only stream
abstract Boolean isBitrateSupported(int iBitrateIndex)
Method used for knowing if a specific bitrate of the stream that is being played is compatible with the device.
abstract boolean isError()
Check whether there was an error
abstract boolean isFinished()
Check whether the current playback has finished
abstract boolean isFullScreen()
Return true if the player is in fullscreenmode
abstract boolean isLicenseExpired()
Get information about the status of the SDK license
abstract boolean isLive()
Return true when playing a live stream
abstract boolean isPaused()
Check whether control is in pause
abstract boolean isPlaybackProcessInterrupted()
Return true if playback was interrupted by any of the Android SDK plugins
abstract boolean isPlaying()
Check whether control is playing
abstract boolean isResumingAfterActivityResume()
Return true if playback is being automatically restarted after an activity resume.
abstract boolean isSeeking()
Check whether VideoPlayerView control is doing a seeking operation
abstract void onDestroy()
abstract void onPause()
abstract void onResume()
abstract void onSegmentProgress(String segmentUrl, int segmentOffset)
abstract void pause()
Pause playback
abstract void playAudioUrl(String sInUrl)
Play an audio only stream given the stream URL
abstract void playAudioUrl(String sInUrl, int position)
Play an audio only stream given the stream URL, starting at the specified position in seconds
abstract void playFeedFromJson(String sJsonData)
Play a stream given a JSON feed string.
abstract void playFeedFromUrl(String sInUrl)
Play a stream given a feed url.
abstract void playUrl(String sInUrl)
Play a stream given the stream URL
abstract void playUrl(String sInUrl, int position)
Play a stream given the stream URL, starting at the specified position in seconds
abstract void resume()
Resume playback
abstract void seek(int iInNewPos, int iInRelPos)
Seek to the specified time position
abstract void seekToLive()
Seek to the live position.
abstract void setAdjustTimestamps(boolean adjust)
Enable/disable the adjustment of timestamps in case of misalignment detected
abstract void setAkamaiAlgorithmValue(int bitrate)
Combined with setHLSStartingAlgorithm(VideoPlayerView.HLS_STARTING_ALGORITHM_AKAMAI) this methods allow setting a custom value for the maximum starting bitrate (default is 300000bps)
abstract void setAutoResume(boolean enable)
Enable/disable auto resume feature.
abstract void setAvoidAudioOnlyStreams(boolean bInValue)
When multibitrate, deactivate/activate the use of audio only streams This method doesn't make sense in the hardware version of the SDK as the interpretation of the protocol is done by the hardware decoder.
abstract void setAvoidIncompatibleVideoProfiles(boolean bInValue)
Enable/disable protection mechanism that avoids the selection of incompatible bitrates.
abstract void setAvoidIncompatibleVideoResolutions(boolean bInValue)
Enable/disable protection mechanism that avoids the selection of incompatible bitrates.
abstract void setBitrateToPlay(int bitrateIndex)
Software: In manual switching mode, set the maximum bitrate to be used during the playback.
abstract void setDebugUrl(String value)
When debugging mode is active, each time the player finish playing a stream it sends a report to the url defined using this method.
abstract void setDebugingActive(Boolean value)
Activate/deactivate the debug mode
abstract void setDefaultAudioConfig(int sample_rate, int channels)
Set default audio configuration parameters.
abstract void setDisableDynamicAudioFeature(boolean disable)
Disable dynamic audio feature in stream (bitrates with different audio settings: channels, sample rate).
abstract void setDropFrames(boolean value)
Configure the player to drop frames when needed for improving audio/video sync.
abstract void setDropWrongTimestampPacketsMode(int mode)
Set how to manage packets that don't include timestamp For not well encoded streams is possible that timestamp values are not correctly set.
abstract void setEventsListener(IPlayerEventsListener player)
Register a callback to be invoked when any player event happens
abstract void setForceFormatChange(boolean value)
When set to true, the format change flag is set to true for the initial segment after a seeking operation.
abstract void setForceOMXdecoding(boolean value)
When set to true, the decoding engine will use the direct OMX approach instead of the newest MediaCodec approach.
abstract void setFullScreen(boolean fullscreen)
Set fullscreen mode.
abstract void setFullScreenMode(int mode)
Set fullscreen mode.
abstract void setHLSStartingAlgorithm(int mode)
Sets the algorithm used for selecting the initial bitrate of the playback
abstract void setHardwareSeekingProtection(boolean value)
When set to true, multiple seeks in a row are blocked by the SDK to protect from a hardware interface crash failure occurring for specific streams Default value: false Note: only for Hardware Advanced decoding mode
abstract void setInitialSeekingPosition(int iInNewPos)
Set the video starting position
abstract void setLicense(String license)
Set the Android SDK license.
abstract void setLogEnabled(boolean value)
Enable/Disable log traces
abstract void setManualSwitching(boolean bInValue)
Sets the manual switching mode
abstract void setMaxBitrate(int iMaxBitrate)
Set the maximum bitrate to be played, in bps
abstract void setMediaAnalyticsConfigUrl(String configUrl)
Sets the Media Analytics config url To use Media Analytics the application must enabled the following permissions - android.permission.INTERNET - android.permission.ACCESS_NETWORK_STATE - android.permission.READ_PHONE_STATE - android.permission.ACCESS_WIFI_STATE
abstract void setMediaAnalyticsData(String key, String value)
Report Media Analytics custom dimension in the player
abstract void setMediaAnalyticsViewerDiagnosticsId(String viewerId)
Set Media Analytics Diagnostics Viewer Id.
abstract void setMediaAnalyticsViewerId(String viewerId)
Set Media Analytics Viewer Id
abstract void setNetSessionMode(int mode)
Enable/Disable client side delivery
abstract void setProgressBarControl(View progressBar)
Sets the progress bar control that should be shown whenever the player is doing a buffering/loading operation
abstract void setRebufferingMode(int iInMode)
Set the rebuffering mode.
abstract void setRebufferingSize(int iInRebufferSize)
Set the rebuffering buffer size
abstract void setSegmentInfoListener(ISegmentInfoListener segInfoListener)
abstract void setStartingBitrateIndex(int iIndex)
Set index of the bitrate to be used when playback start
abstract void setUseBufferingWhenStarting(boolean value)
Enable/Disable the use of an initial buffer used for starting playback If enabled, playback won't start until the initial buffer is full.
abstract void setUseMultiThread(boolean value)
Enable/disable the use of multi threading decoding
abstract void setVideoQuality(int iInQuality)
Set the video quality.
abstract void stop()
Stop playback
abstract void switchBitrateDown()
Ask the player to switch to the lower bitrate
abstract void switchBitrateUp()
Ask the player to switch to the upper bitrate

Constants

public static final int DROP_WRONG_TIMESTAMP_PACKETS_ALWAYS

Packets with wrong timestamps will be always dropped

Constant Value: 2 (0x00000002)

public static final int DROP_WRONG_TIMESTAMP_PACKETS_NEVER

Packets with wrong timestamps will be never dropped

Constant Value: 0 (0x00000000)

public static final int DROP_WRONG_TIMESTAMP_PACKETS_ONLY_VOD

Packets with wrong timestamps will be dropped only for VOD streams

Constant Value: 1 (0x00000001)

public static final int ERROR_FORMAT_UNKNOWN

The provided stream doesn't have a known format

Constant Value: 4 (0x00000004)

public static final int ERROR_NETWORK_RESOURCE_DONT_EXIST

Resource (stream URL) doesn't exist

Constant Value: 2 (0x00000002)

public static final int ERROR_NETWORK_SECURITY_ISSUE

Access not allowed to the provided stream URL

Constant Value: 3 (0x00000003)

public static final int ERROR_NETWORK_UNAVAILABLE

Network access is not available

Constant Value: 1 (0x00000001)

public static final int ERROR_RESOURCES_ISSUE

There was an issue while allocating resources for playback

Constant Value: 5 (0x00000005)

public static final int ERROR_SUCCESS

No error

Constant Value: 0 (0x00000000)

public static final int ERROR_TS_SEGMENT_INVALID

The provided stream contains format errors

Constant Value: 6 (0x00000006)

public static final int FULLSCREEN_MODE_KEEP_ASPECT_RATIO

Fullscreen enabled, keeping original aspect ratio

Constant Value: 2 (0x00000002)

public static final int FULLSCREEN_MODE_NONE

Fullscreen disabled

Constant Value: 1 (0x00000001)

public static final int FULLSCREEN_MODE_TOTAL

Fullscreen enabled, filling the full control

Constant Value: 3 (0x00000003)

public static final int HLS_STARTING_ALGORITHM_AKAMAI

Starting algorithm designed by Akamai, optimized to cover the max number of devices with the starting bitrate. Chooses the first below 300Kbps that is not an audio only stream. Note that this value is configurable using setAkamaiAlgorithmValue(int bitrate)

Constant Value: 0 (0x00000000)

public static final int HLS_STARTING_ALGORITHM_APPLE

Starting algorithm implemented in iDevices. Choose as the starting bitrate the first bitrate in the playlist.

Constant Value: 1 (0x00000001)

public static final int MEDIA_REBUFFERING_MODE_AUTOMATIC

Rebuffering mode automatic

Constant Value: 1 (0x00000001)

public static final int MEDIA_REBUFFERING_MODE_MANUAL

Rebuffering mode manual

Constant Value: 0 (0x00000000)

public static final int MEDIA_VIDEO_QUALITY_AUTO

Video Quality Auto

Constant Value: 3 (0x00000003)

public static final int MEDIA_VIDEO_QUALITY_HIGH

Video Quality High

Constant Value: 2 (0x00000002)

public static final int MEDIA_VIDEO_QUALITY_LOW

Video Quality Low

Constant Value: 0 (0x00000000)

public static final int MEDIA_VIDEO_QUALITY_MEDIUM

Video Quality Medium

Constant Value: 1 (0x00000001)

public static final int NETSESSION_MODE_ALLOWED

NetSession will be used by default but, in case of an error, the player will automatically disable it.

Constant Value: 1 (0x00000001)

public static final int NETSESSION_MODE_DISABLED

NetSession disabled.

Constant Value: 0 (0x00000000)

public static final int NETSESSION_MODE_REQUIRED

NetSession required. If the destination URL doesn't support NetSession, the player won't work.

Constant Value: 2 (0x00000002)

public static final String VERSION

Version of the Akamai Android SDK video component

Constant Value: "5.24.0"

Public Methods

public abstract String about ()

Get the about text. You have to include this text in the About option of your application

Returns
  • About text

public abstract void clearRenderBuffer ()

Clears the screen render buffer. Only compatible with software decoding.

Returns
  • void

public abstract long getAvgFPS ()

For the current playback, get the average FPS (Frames per Second) This method doesn't make sense in the hardware version of the SDK as the hardware decoder doesn't provide this information

Returns
  • Average FPS

public abstract int getBitrateByIndex (int index)

Return the bitrate (bps) for the variant indicated in the index parameter

Parameters
index of the bitrate
Returns
  • bitrate of the variant

public abstract int getBitratesCount ()

Get the number of available bitrate indexes for the loaded stream

Returns
  • Number of bitrates

public abstract int getBitratesSwitchesDown ()

For multibirate streams, get the number of times the control has switched down

Returns
  • Bitrate switch down times

public abstract int getBitratesSwitchesUp ()

For multibirate streams, get the number of times the control has switched up

Returns
  • Bitrate switch up times

public abstract int getBufferingPercentage ()

Get the rebuffering percentage

Returns
  • Percentage of rebuffering

public abstract long getBytesLoaded ()

For the current playback, get the number of bytes loaded

Returns
  • Bytes loaded

public abstract long getCurrentBitrate ()

Get the current bitrate of the video in bps

Returns
  • Current bitrate in bps

public abstract String getCurrentSegmentUrl ()

public abstract long getDVRLength ()

Get the lenght, in seconds, of the DVR

Returns
  • In case the stream is a live stream, returns the length of the DVR in seconds. Otherwise, returns 0

public abstract int getDuration ()

Get the duration of the video in seconds. For a live stream the duration will be 0. This value can be assumed as valid once the player has received the event PLAYER_EVENT_TYPE_START_PLAYING.

Returns
  • Duration of the video in seconds

public abstract double getEncodedFPS ()

Get the encoded frames per second for the loaded stream This method is not supported on Hardware and Hardware Advanced decoding modes

Returns
  • Encoded Frames Per Second

public abstract long getFPS ()

Get the current FPS (Frames per Second)

Returns
  • FPS

public abstract AMPFeed getFeed ()

Returns the feed of the loaded stream (in case playback was launched providing a json feed)

Returns
  • Feed object

public abstract int getFullScreenMode ()

Return the fullscreen mode

public abstract int getHeight ()

Return the height of this view

Returns
  • Height of this view

public abstract int getIndexByBitrate (int bitrate)

Return the index for the bitrate indicated in the bitrate parameter (bps)

Returns
  • 0 starting index of the bitrate in the list of bitrates.

public abstract int getLastErrorCode ()

Returns the last error code that happens during the playback

Returns
  • Error code

public abstract int getLastHttpErrorCode ()

Get error code of the last HTTP request

Returns
  • Error code of the last HTTP request

public abstract int getLastMeasuredBandwidth ()

Returns the last measured bandwidth in bytes/sec

Returns
  • Bandwidth in bytes per second

public abstract long getLastPTS ()

Get the PTS of the last packet read by the decoder

Returns
  • PTS of the last packet read by the decoder

public abstract Date getLicenseExpirationDate ()

Returns the expiration date of the set license

Returns
  • Expiration date of the license.

public abstract String getLicensePackageName ()

Returns the package name for which the set license is valid

Returns
  • Package name of the license.

public abstract int[] getLocationOnScreen ()

Computes the coordinates of this view on the screen

Returns
  • Coordinates of this view on the screen

public abstract int getPositionInDVR ()

Return the current playback position in the DVR in seconds

Returns
  • Current playback position in the DVR in seconds

public abstract View getProgressBarControl ()

Gets the progress bar control that is shown whenever the player is doing a buffering/loading operation

Returns
  • Progress bar control. It will be null in case no progress bar control was set

public abstract String getProtocol ()

Get the protocol of the current loaded stream

Returns
  • Protocol

public abstract double getRebufferingTime ()

Get the total time the player has been rebuffering in seconds

Returns
  • Rebuffering time in seconds

public abstract int getRebuffers ()

Get the number of rebuffers occurred

Returns
  • Number of rebuffers occurred

public abstract String getServerIp ()

Get the Server IP of the current loaded stream

Returns
  • Server IP address

public abstract int getServerPort ()

Get the Server port for the current loaded stream

Returns
  • Transport protocol port

public abstract String getStreamUrl ()

Returns the url of the loaded stream

Returns
  • Url of the loaded stream

public abstract String getStreamsInfo ()

Return information about the streams

Returns
  • String with the streams description

public abstract int getTimePosition ()

Return the current playback position in seconds

Returns
  • Current playback position in seconds. -1 in case time position couldn't get

public abstract Date getTimePositionAsDate ()

Return the current playback position as a local time date

Returns
  • Current playback position as Date (locale time)

public abstract long getTimePositionMS ()

Return the current playback position in milliseconds

Returns
  • Current playback position in milliseconds. -1 in case time position couldn't get

public abstract String getVersionDescription ()

Get extended information about the SDK version

Returns
  • SDK Version full description

public abstract int getVideoHeight ()

Get the height of the video

Returns
  • Height of the video in pixels

public abstract int getVideoWidth ()

Get the width of the video

Returns
  • Width of the video in pixels

public abstract int getWidth ()

Return the width of this view

Returns
  • Width of this view

public abstract boolean isAudioOnly ()

Return true if the current bitrate is an audio only stream

Returns
  • true if it is audio only, false otherwise

public abstract Boolean isBitrateSupported (int iBitrateIndex)

Method used for knowing if a specific bitrate of the stream that is being played is compatible with the device.

Parameters
iBitrateIndex Zero based index of the bitrate to check.
Returns
  • True if the bitrate is supported, otherwise returns false.

public abstract boolean isError ()

Check whether there was an error

Returns
  • true if the control is in error state, false otherwise

public abstract boolean isFinished ()

Check whether the current playback has finished

Returns
  • true if the playback has finished, false otherwise

public abstract boolean isFullScreen ()

Return true if the player is in fullscreenmode

Returns
  • true if the player is in fullscreenmode, false otherwise

public abstract boolean isLicenseExpired ()

Get information about the status of the SDK license

Returns
  • true if the license has expired, false otherwise

public abstract boolean isLive ()

Return true when playing a live stream

Returns
  • true if playing a live stream, false otherwise

public abstract boolean isPaused ()

Check whether control is in pause

Returns
  • true if currently in pause, false otherwise

public abstract boolean isPlaybackProcessInterrupted ()

Return true if playback was interrupted by any of the Android SDK plugins

Returns
  • true if playback is interrupted, false otherwise

public abstract boolean isPlaying ()

Check whether control is playing

Returns
  • true if currently playing, false otherwise

public abstract boolean isResumingAfterActivityResume ()

Return true if playback is being automatically restarted after an activity resume. This property is set to false once the event PLAYER_EVENT_TYPE_LOAD_REQUESTED is launched

Returns
  • true if playback is being automatically resumed after an activity resume

public abstract boolean isSeeking ()

Check whether VideoPlayerView control is doing a seeking operation

Returns
  • true if currently seeking, false otherwise

public abstract void onDestroy ()

public abstract void onPause ()

public abstract void onResume ()

public abstract void onSegmentProgress (String segmentUrl, int segmentOffset)

public abstract void pause ()

Pause playback

public abstract void playAudioUrl (String sInUrl)

Play an audio only stream given the stream URL

Parameters
sInUrl Url of the stream to play

public abstract void playAudioUrl (String sInUrl, int position)

Play an audio only stream given the stream URL, starting at the specified position in seconds

Parameters
sInUrl Url of the stream to play
position Start position in seconds

public abstract void playFeedFromJson (String sJsonData)

Play a stream given a JSON feed string. Feed format supported is JSON type data with the format defined by Akamai Media Player. Example: http://projects.mediadev.edgesuite.net/customers/akamai/mdt-html5-core/premier/1.0.0008/resources/feeds/vod-feed.json

Parameters
sJsonData JSON string

public abstract void playFeedFromUrl (String sInUrl)

Play a stream given a feed url. Feed format supported is JSON type data with the format defined by Akamai Media Player. Example: http://projects.mediadev.edgesuite.net/customers/akamai/mdt-html5-core/premier/1.0.0008/resources/feeds/vod-feed.json

Parameters
sInUrl URL of the feed to play

public abstract void playUrl (String sInUrl)

Play a stream given the stream URL

Parameters
sInUrl URL of the stream to play

public abstract void playUrl (String sInUrl, int position)

Play a stream given the stream URL, starting at the specified position in seconds

Parameters
sInUrl URL of the stream to play
position Start position in seconds

public abstract void resume ()

Resume playback

public abstract void seek (int iInNewPos, int iInRelPos)

Seek to the specified time position

Parameters
iInNewPos The offset in seconds from the start to seek to.

public abstract void seekToLive ()

Seek to the live position. Only valid for live streams

public abstract void setAdjustTimestamps (boolean adjust)

Enable/disable the adjustment of timestamps in case of misalignment detected

public abstract void setAkamaiAlgorithmValue (int bitrate)

Combined with setHLSStartingAlgorithm(VideoPlayerView.HLS_STARTING_ALGORITHM_AKAMAI) this methods allow setting a custom value for the maximum starting bitrate (default is 300000bps)

Parameters
bitrate in bps

public abstract void setAutoResume (boolean enable)

Enable/disable auto resume feature. Auto resume is evaluated when playback was interrupted, in the loading phase, by a plugin. In case auto-resume is set to true, playbac will start automatically once the plugin that interrupted the loading has finishing its work.

Parameters
enable If true, auto-resume is enabled.

public abstract void setAvoidAudioOnlyStreams (boolean bInValue)

When multibitrate, deactivate/activate the use of audio only streams This method doesn't make sense in the hardware version of the SDK as the interpretation of the protocol is done by the hardware decoder. We are not analyzing the stream before passing it to the decoder so we can't know if the stream is an audio only stream.

Parameters
bInValue If true, audio only streams will not be used for mbr streams

public abstract void setAvoidIncompatibleVideoProfiles (boolean bInValue)

Enable/disable protection mechanism that avoids the selection of incompatible bitrates. When using hardware decoding method avoid the player to select any bitrate whose profile is not compatible with the H.264 hardware decoder.

Parameters
bInValue If true, enable protection that avoids selection of bitrates using H.264 profiles incompatible with the device.

public abstract void setAvoidIncompatibleVideoResolutions (boolean bInValue)

Enable/disable protection mechanism that avoids the selection of incompatible bitrates. When using hardware decoding method avoid the player to select any bitrate whose video resolution higher than the device screen resolution.

Parameters
bInValue If true, enable protection that avoids selection of bitrates whose profile is higher than the device screen reslution.

public abstract void setBitrateToPlay (int bitrateIndex)

Software: In manual switching mode, set the maximum bitrate to be used during the playback. The bitrate to be played will be the one inmediately below or equal than the indicated in the parameter bitrate Hardware & Hardware Advanced: Set a specific bitrate index to be played

Throws
Exception

public abstract void setDebugUrl (String value)

When debugging mode is active, each time the player finish playing a stream it sends a report to the url defined using this method. The url parameter allows three variables: %DEVICEID %TIME %ERRORCODE For example, url: http://debug.android.testing.com/postDebug.php?id=%DEVICEID&time=%TIME&error=%ERRORCODE

Parameters
value Url to send the debugging files

public abstract void setDebugingActive (Boolean value)

Activate/deactivate the debug mode

Parameters
value When true, the player sends debug files to a remote server after each playback

public abstract void setDefaultAudioConfig (int sample_rate, int channels)

Set default audio configuration parameters. Values provided will be used whenever the audio decoder is not able to get the real parameters of a stream Doesn't make sense for the Android SDK hardware version

Parameters
sample_rate Audio stream sample rate
channels Number of channels of the audio stream

public abstract void setDisableDynamicAudioFeature (boolean disable)

Disable dynamic audio feature in stream (bitrates with different audio settings: channels, sample rate). Having different audio settings per bitrate is not recommended.

public abstract void setDropFrames (boolean value)

Configure the player to drop frames when needed for improving audio/video sync. When the CPU is extremely slow, the frame drop feature is automatically turned off to avoid the player to show a constant black screen. The default value for this property is false This method doesn't make sense in the hardware version of the SDK dropping frames or not is managed internally in the hardware decoder

Parameters
value When true, player will drop frames to sync audio/video

public abstract void setDropWrongTimestampPacketsMode (int mode)

Set how to manage packets that don't include timestamp For not well encoded streams is possible that timestamp values are not correctly set. Using this method you can configure the SDK to drop packets with wrong timestamps

public abstract void setEventsListener (IPlayerEventsListener player)

Register a callback to be invoked when any player event happens

public abstract void setForceFormatChange (boolean value)

When set to true, the format change flag is set to true for the initial segment after a seeking operation. This reduces the "ghosting" effect seen on different devices when the stream keyframe interval is not aligned with the size of the segments. NOTE: only Android devices from 4.0.0 to 4.0.4 are affected, except if setForceOMXdecoding() is set to true. Default value: false Note: only for Hardware Advanced decoding mode

Parameters
value True to force format change flag after every seeking operation

public abstract void setForceOMXdecoding (boolean value)

When set to true, the decoding engine will use the direct OMX approach instead of the newest MediaCodec approach. Useful for old Android 4.x devices not correctly supporting MediaCodec Default value: false Note: only for Hardware Advanced decoding mode Note: not compatible with audio-only streams (playAudioUrl)

Parameters
value True to force OMX approach

public abstract void setFullScreen (boolean fullscreen)

Set fullscreen mode. Fullscreen mode keeps the aspect ratio

public abstract void setFullScreenMode (int mode)

Set fullscreen mode.

Parameters
mode Fullscreen mode

public abstract void setHLSStartingAlgorithm (int mode)

Sets the algorithm used for selecting the initial bitrate of the playback

public abstract void setHardwareSeekingProtection (boolean value)

When set to true, multiple seeks in a row are blocked by the SDK to protect from a hardware interface crash failure occurring for specific streams Default value: false Note: only for Hardware Advanced decoding mode

Parameters
value True to enable protection

public abstract void setInitialSeekingPosition (int iInNewPos)

Set the video starting position

Parameters
iInNewPos The offset in seconds from the start to seek to. It can be 0 to do a relative seek

public abstract void setLicense (String license)

Set the Android SDK license. Please, be sure you call this method before trying to play any video. Otherwise you will be using the Android SDK in trial mode (playback time limited).

public abstract void setLogEnabled (boolean value)

Enable/Disable log traces

Parameters
value If true, log traces are enabled.

public abstract void setManualSwitching (boolean bInValue)

Sets the manual switching mode

Parameters
bInValue if true, the control switch to manual mode and the bitrate selection algorithm is not used

public abstract void setMaxBitrate (int iMaxBitrate)

Set the maximum bitrate to be played, in bps

Parameters
iMaxBitrate Max bitrate to play

public abstract void setMediaAnalyticsConfigUrl (String configUrl)

Sets the Media Analytics config url To use Media Analytics the application must enabled the following permissions - android.permission.INTERNET - android.permission.ACCESS_NETWORK_STATE - android.permission.READ_PHONE_STATE - android.permission.ACCESS_WIFI_STATE

public abstract void setMediaAnalyticsData (String key, String value)

Report Media Analytics custom dimension in the player

public abstract void setMediaAnalyticsViewerDiagnosticsId (String viewerId)

Set Media Analytics Diagnostics Viewer Id. Needed for Viewer diagnostics

public abstract void setMediaAnalyticsViewerId (String viewerId)

Set Media Analytics Viewer Id

public abstract void setNetSessionMode (int mode)

Enable/Disable client side delivery

Parameters
mode NetSession mode.

public abstract void setProgressBarControl (View progressBar)

Sets the progress bar control that should be shown whenever the player is doing a buffering/loading operation

Parameters
progressBar Progress Bar control

public abstract void setRebufferingMode (int iInMode)

Set the rebuffering mode. By default its value is manual. In automatic mode the buffer size is managed by the player control trying to get the shortest startup time and minimizing the rebuffer times

Parameters
iInMode Rebuffering mode value.

public abstract void setRebufferingSize (int iInRebufferSize)

Set the rebuffering buffer size

Parameters
iInRebufferSize Buffer size in bytes.

public abstract void setSegmentInfoListener (ISegmentInfoListener segInfoListener)

public abstract void setStartingBitrateIndex (int iIndex)

Set index of the bitrate to be used when playback start

public abstract void setUseBufferingWhenStarting (boolean value)

Enable/Disable the use of an initial buffer used for starting playback If enabled, playback won't start until the initial buffer is full. The size of the buffer can be defined using the method setRebufferingSize. This method doesn't make sense in the hardware version of the SDK as the buffer size is managed internally by the Android hardware decoders

Parameters
value If true, log initial buffering is enabled.

public abstract void setUseMultiThread (boolean value)

Enable/disable the use of multi threading decoding

public abstract void setVideoQuality (int iInQuality)

Set the video quality. By default its value is "Low" This method doesn't make sense in the hardware version of the SDK as hardware decoder always works with the maximum quality, without possibility of configuration

Parameters
iInQuality Video quality

public abstract void stop ()

Stop playback

public abstract void switchBitrateDown ()

Ask the player to switch to the lower bitrate

Throws
Exception

public abstract void switchBitrateUp ()

Ask the player to switch to the upper bitrate

Throws
Exception