public class

VideoPlayerViewHardwareAdvanced

extends SurfaceView
implements AMPFeedLoader.AMPFeedLoaderListener IStreamPropertiesChange VideoPlayerView MemoryBufferProcessor
java.lang.Object
   ↳ SurfaceView
     ↳ com.akamai.media.VideoPlayerViewHardwareAdvanced

Class Overview

Video player user control that uses hardware advanced decoding

Summary

[Expand]
Inherited Constants
From interface com.akamai.media.VideoPlayerView
Public Constructors
VideoPlayerViewHardwareAdvanced(Context context)
VideoPlayerViewHardwareAdvanced(Context context, AttributeSet attrs)
Public Methods
String about()
Get the about text.
void clearRenderBuffer()
Clears the screen render buffer.
void feedLoaded(AMPFeed feed)
boolean forceBufferProcessing()
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
int getBandwidth()
int getBitrateByIndex(int index)
Return the bitrate for the variant indicated in the index parameter
int getBitratesCount()
Get the number of available bitrates for the loaded stream
int getBitratesSwitchesDown()
For multibirate streams, get the number of times the control has switched down
int getBitratesSwitchesUp()
For multibirate streams, get the number of times the control has switched up
int getBufferingPercentage()
Get the rebuffering percentage
int getBuffersInQueue()
long getBytesLoaded()
For the current playback, get the number of bytes loaded
long getCurrentBitrate()
Get the current bitrate of the video
String getCurrentSegmentUrl()
long getDVRLength()
Get the lenght, in seconds, of the DVR
int getDuration()
Get the duration of the video in seconds.
double getEncodedFPS()
Get the encoded frames per second for the loaded stream This method is not supported on Hardware and Hardware Advanced decoding modes
long getFPS()
Get the current FPS (Frames per Second)
AMPFeed getFeed()
Returns the feed of the loaded stream (in case playback was launched providing a json feed)
int getFullScreenMode()
Return the fullscreen mode
int getIndexByBitrate(int bitrate)
Return the index for the bitrate indicated in the bitrate parameter
int getLastErrorCode()
Returns the last error code that happens during the playback
int getLastHttpErrorCode()
Get error code of the last HTTP request
int getLastMeasuredBandwidth()
Returns the last measured bandwidth in bytes/sec
long getLastPTS()
Get the PTS of the last packet read by the decoder
Date getLicenseExpirationDate()
Returns the expiration date of the set license
String getLicensePackageName()
Returns the package name for which the set license is valid
int[] getLocationOnScreen()
Computes the coordinates of this view on the screen
int getNetsessionMode()
int getPositionInDVR()
Return the current playback position in the DVR in seconds
View getProgressBarControl()
Gets the progress bar control that is shown whenever the player is doing a buffering/loading operation
String getProtocol()
Get the protocol of the current loaded stream
double getRebufferingTime()
Get the total time the player has been rebuffering in seconds
int getRebuffers()
Get the number of rebuffers occurred
String getServerIp()
Get the Server IP of the current loaded stream
int getServerPort()
Get the Server port for the current loaded stream
String getStreamUrl()
Returns the url of the loaded stream
String getStreamsInfo()
Return information about the streams
int getTimePosition()
Return the current playback position in seconds
Date getTimePositionAsDate()
Return the current playback position as a local time date
long getTimePositionMS()
Return the current playback position in milliseconds
String getVersionDescription()
Get extended information about the SDK version
int getVideoHeight()
Get the height of the video
int getVideoWidth()
Get the width of the video
boolean isAudioOnly()
Return true if the current bitrate is an audio only stream
Boolean isBitrateSupported(int iBitrateIndex)
Method used for knowing if a specific bitrate of the stream that is being played is compatible with the device.
boolean isError()
Check whether there was an error
boolean isFinished()
Check whether the current playback has finished
boolean isFullScreen()
Return true if the player is in fullscreenmode
boolean isLicenseExpired()
Get information about the status of the SDK license
boolean isLive()
Return true when playing a live stream
boolean isPaused()
Check whether control is in pause
boolean isPlaybackProcessInterrupted()
Return true if playback was interrupted by any of the Android SDK plugins
boolean isPlaying()
Check whether control is playing
boolean isResumingAfterActivityResume()
Return true if playback is being automatically restarted after an activity resume.
boolean isSeeking()
Check whether VideoPlayerView control is doing a seeking operation
int onAudioPropertiesChange(int channels, int sampleRate, int bitRate)
void onDestroy()
int onEndBuffering()
int onError()
void onPause()
int onPlaybackFinished()
void onResume()
void onSegmentProgress(String segmentUrl, int segmentOffset)
int onStartBuffering()
int onVideoPropertiesChange(int width, int height, int frameRate, int bitRate)
void pause()
Pause playback
void playAudioUrl(String sInUrl)
Play an audio only stream given the stream URL
void playAudioUrl(String sInUrl, int startPosition)
Play an audio only stream given the stream URL, starting at the specified position in seconds
void playFeedFromJson(String sJsonData)
Play a stream given a JSON feed string.
void playFeedFromUrl(String sInUrl)
Play a stream given a feed url.
void playInternalUrl(String sInUrl, boolean bInOnlyAudio, int startPosition)
void playUrl(String sInUrl)
Play a stream given the stream Url
void playUrl(String sInUrl, int position)
Play a stream given the stream URL, starting at the specified position in seconds
boolean processBuffer(String url, byte[] data, int bitrate, boolean lastSegment, boolean forceDiscontinuity, int segmentPosition, int segmentOffset, boolean segmentAfterSeek)
void resume()
Resume playback
void seek(int iInNewPos, int iInRelPos)
Seek to the specified time position
void seekToLive()
Seek to the live position.
void setAdjustTimestamps(boolean adjust)
Enable/disable the adjustment of timestamps in case of misalignment detected
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)
void setAutoResume(boolean enable)
Enable/disable auto resume feature.
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.
void setAvoidIncompatibleVideoProfiles(boolean bInValue)
Enable/disable protection mechanism that avoids the selection of incompatible bitrates.
void setAvoidIncompatibleVideoResolutions(boolean bInValue)
Enable/disable protection mechanism that avoids the selection of incompatible bitrates.
void setBitrateToPlay(int bitrateIndex)
Software: In manual switching mode, set the maximum bitrate to be used during the playback.
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.
void setDebugingActive(Boolean value)
Activate/deactivate the debug mode
void setDefaultAudioConfig(int sample_rate, int channels)
Set default audio configuration parameters.
void setDisableDynamicAudioFeature(boolean disable)
Disable dynamic audio feature in stream (bitrates with different audio settings: channels, sample rate).
void setDropFrames(boolean value)
Configure the player to drop frames when needed for improving audio/video sync.
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.
void setEventsListener(IPlayerEventsListener player)
Register a callback to be invoked when any player event happens
void setForceFormatChange(boolean value)
When set to true, the format change flag is set to true for the initial segment after a seeking operation.
void setForceOMXdecoding(boolean value)
When set to true, the decoding engine will use the direct OMX approach instead of the newest MediaCodec approach.
void setFullScreen(boolean fullscreen)
Set fullscreen mode.
void setFullScreenMode(int mode)
Set fullscreen mode.
void setHLSStartingAlgorithm(int mode)
Sets the algorithm used for selecting the initial bitrate of the playback
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
void setInitialSeekingPosition(int iInNewPos)
Set the video starting position
void setLastErrorCode(int errorCode, int httpErrorCode)
void setLicense(String license)
Set the Android SDK license.
void setLogEnabled(boolean value)
Enable/Disable log traces
void setManualSwitching(boolean bInValue)
Sets the manual switching mode
void setMaxBitrate(int iMaxBitrate)
Set the maximum bitrate to be played, in bps
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
void setMediaAnalyticsData(String key, String value)
Report Media Analytics custom dimension in the player
void setMediaAnalyticsViewerDiagnosticsId(String viewerId)
Set Media Analytics Diagnostics Viewer Id.
void setMediaAnalyticsViewerId(String viewerId)
Set Media Analytics Viewer Id
void setNetSessionMode(int mode)
Enable/Disable client side delivery
void setProgressBarControl(View progressBar)
Sets the progress bar control that should be shown whenever the player is doing a buffering/loading operation
void setRebufferingMode(int iInMode)
Set the rebuffering mode.
void setRebufferingSize(int iInRebufferSize)
Set the rebuffering buffer size
void setSegmentInfoListener(ISegmentInfoListener segInfoListener)
void setStartingBitrateIndex(int iIndex)
Set index of the bitrate to be used when playback start
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.
void setUseMultiThread(boolean value)
Enable/disable the use of multi threading decoding
void setVideoQuality(int iInQuality)
Set the video quality.
void stop()
Stop playback
void surfaceChanged(SurfaceHolder holder, int format, int width, int height)
void surfaceCreated(SurfaceHolder holder)
void surfaceDestroyed(SurfaceHolder holder)
void switchBitrateDown()
Ask the player to switch to the lower bitrate
void switchBitrateUp()
Ask the player to switch to the upper bitrate
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.akamai.media.AMPFeedLoader.AMPFeedLoaderListener
From interface com.akamai.media.IStreamPropertiesChange
From interface com.akamai.media.VideoPlayerView
From interface com.akamai.media.hls.MemoryBufferProcessor

Public Constructors

public VideoPlayerViewHardwareAdvanced (Context context)

public VideoPlayerViewHardwareAdvanced (Context context, AttributeSet attrs)

Public Methods

public String about ()

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

Returns
  • About text

public void clearRenderBuffer ()

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

Returns
  • void

public void feedLoaded (AMPFeed feed)

public boolean forceBufferProcessing ()

public 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 int getBandwidth ()

public int getBitrateByIndex (int index)

Return the bitrate for the variant indicated in the index parameter

Parameters
index of the bitrate
Returns
  • bitrate of the variant

public int getBitratesCount ()

Get the number of available bitrates for the loaded stream

Returns
  • Number of bitrates

public int getBitratesSwitchesDown ()

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

Returns
  • Bitrate switch down times

public int getBitratesSwitchesUp ()

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

Returns
  • Bitrate switch up times

public int getBufferingPercentage ()

Get the rebuffering percentage

Returns
  • Percentage of rebuffering

public int getBuffersInQueue ()

public long getBytesLoaded ()

For the current playback, get the number of bytes loaded

Returns
  • Bytes loaded

public long getCurrentBitrate ()

Get the current bitrate of the video

Returns
  • Current bitrate in bps

public String getCurrentSegmentUrl ()

public 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 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 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 long getFPS ()

Get the current FPS (Frames per Second)

Returns
  • FPS

public AMPFeed getFeed ()

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

Returns
  • Feed object

public int getFullScreenMode ()

Return the fullscreen mode

public int getIndexByBitrate (int bitrate)

Return the index for the bitrate indicated in the bitrate parameter

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

public int getLastErrorCode ()

Returns the last error code that happens during the playback

Returns
  • Error code

public int getLastHttpErrorCode ()

Get error code of the last HTTP request

Returns
  • Error code of the last HTTP request

public int getLastMeasuredBandwidth ()

Returns the last measured bandwidth in bytes/sec

Returns
  • Bandwidth in bytes per second

public long getLastPTS ()

Get the PTS of the last packet read by the decoder

Returns
  • PTS of the last packet read by the decoder

public Date getLicenseExpirationDate ()

Returns the expiration date of the set license

Returns
  • Expiration date of the license.

public String getLicensePackageName ()

Returns the package name for which the set license is valid

Returns
  • Package name of the license.

public int[] getLocationOnScreen ()

Computes the coordinates of this view on the screen

Returns
  • Coordinates of this view on the screen

public int getNetsessionMode ()

public int getPositionInDVR ()

Return the current playback position in the DVR in seconds

Returns
  • Current playback position in the DVR in seconds

public 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 String getProtocol ()

Get the protocol of the current loaded stream

Returns
  • Protocol

public double getRebufferingTime ()

Get the total time the player has been rebuffering in seconds

Returns
  • Rebuffering time in seconds

public int getRebuffers ()

Get the number of rebuffers occurred

Returns
  • Number of rebuffers occurred

public String getServerIp ()

Get the Server IP of the current loaded stream

Returns
  • Server IP address

public int getServerPort ()

Get the Server port for the current loaded stream

Returns
  • Transport protocol port

public String getStreamUrl ()

Returns the url of the loaded stream

Returns
  • Url of the loaded stream

public String getStreamsInfo ()

Return information about the streams

Returns
  • String with the streams description

public int getTimePosition ()

Return the current playback position in seconds

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

public Date getTimePositionAsDate ()

Return the current playback position as a local time date

Returns
  • Current playback position as Date (locale time)

public long getTimePositionMS ()

Return the current playback position in milliseconds

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

public String getVersionDescription ()

Get extended information about the SDK version

Returns
  • SDK Version full description

public int getVideoHeight ()

Get the height of the video

Returns
  • Height of the video in pixels

public int getVideoWidth ()

Get the width of the video

Returns
  • Width of the video in pixels

public boolean isAudioOnly ()

Return true if the current bitrate is an audio only stream

Returns
  • true if it is audio only, false otherwise

public 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 boolean isError ()

Check whether there was an error

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

public boolean isFinished ()

Check whether the current playback has finished

Returns
  • true if the playback has finished, false otherwise

public boolean isFullScreen ()

Return true if the player is in fullscreenmode

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

public boolean isLicenseExpired ()

Get information about the status of the SDK license

Returns
  • true if the license has expired, false otherwise

public boolean isLive ()

Return true when playing a live stream

Returns
  • true if playing a live stream, false otherwise

public boolean isPaused ()

Check whether control is in pause

Returns
  • true if currently in pause, false otherwise

public boolean isPlaybackProcessInterrupted ()

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

Returns
  • true if playback is interrupted, false otherwise

public boolean isPlaying ()

Check whether control is playing

Returns
  • true if currently playing, false otherwise

public 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 boolean isSeeking ()

Check whether VideoPlayerView control is doing a seeking operation

Returns
  • true if currently seeking, false otherwise

public int onAudioPropertiesChange (int channels, int sampleRate, int bitRate)

public void onDestroy ()

public int onEndBuffering ()

public int onError ()

public void onPause ()

public int onPlaybackFinished ()

public void onResume ()

public void onSegmentProgress (String segmentUrl, int segmentOffset)

public int onStartBuffering ()

public int onVideoPropertiesChange (int width, int height, int frameRate, int bitRate)

public void pause ()

Pause playback

public void playAudioUrl (String sInUrl)

Play an audio only stream given the stream URL

Parameters
sInUrl Url of the stream to play

public void playAudioUrl (String sInUrl, int startPosition)

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

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

public 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 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 void playInternalUrl (String sInUrl, boolean bInOnlyAudio, int startPosition)

public void playUrl (String sInUrl)

Play a stream given the stream Url

Parameters
sInUrl Url of the stream to play

public 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 boolean processBuffer (String url, byte[] data, int bitrate, boolean lastSegment, boolean forceDiscontinuity, int segmentPosition, int segmentOffset, boolean segmentAfterSeek)

public void resume ()

Resume playback

public 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 void seekToLive ()

Seek to the live position. Only valid for live streams

public void setAdjustTimestamps (boolean adjust)

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

public 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 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 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 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 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 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

public 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 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 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 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 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 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 void setEventsListener (IPlayerEventsListener player)

Register a callback to be invoked when any player event happens

public 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 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 void setFullScreen (boolean fullscreen)

Set fullscreen mode. Fullscreen mode keeps the aspect ratio

public void setFullScreenMode (int mode)

Set fullscreen mode.

Parameters
mode Fullscreen mode

public void setHLSStartingAlgorithm (int mode)

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

public 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 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 void setLastErrorCode (int errorCode, int httpErrorCode)

public 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 void setLogEnabled (boolean value)

Enable/Disable log traces

Parameters
value If true, log traces are enabled.

public 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 void setMaxBitrate (int iMaxBitrate)

Set the maximum bitrate to be played, in bps

Parameters
iMaxBitrate Max bitrate to play

public 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 void setMediaAnalyticsData (String key, String value)

Report Media Analytics custom dimension in the player

public void setMediaAnalyticsViewerDiagnosticsId (String viewerId)

Set Media Analytics Diagnostics Viewer Id. Needed for Viewer diagnostics

public void setMediaAnalyticsViewerId (String viewerId)

Set Media Analytics Viewer Id

public void setNetSessionMode (int mode)

Enable/Disable client side delivery

Parameters
mode NetSession mode.

public 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 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 void setRebufferingSize (int iInRebufferSize)

Set the rebuffering buffer size

Parameters
iInRebufferSize Buffer size in bytes.

public void setSegmentInfoListener (ISegmentInfoListener segInfoListener)

public void setStartingBitrateIndex (int iIndex)

Set index of the bitrate to be used when playback start

public 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 void setUseMultiThread (boolean value)

Enable/disable the use of multi threading decoding

public 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 void stop ()

Stop playback

public void surfaceChanged (SurfaceHolder holder, int format, int width, int height)

public void surfaceCreated (SurfaceHolder holder)

public void surfaceDestroyed (SurfaceHolder holder)

public void switchBitrateDown ()

Ask the player to switch to the lower bitrate

public void switchBitrateUp ()

Ask the player to switch to the upper bitrate