public class VideoPlayerViewHardwareAdvanced extends SurfaceView implements MemoryBufferProcessor, VideoPlayerView, IStreamPropertiesChange, AMPFeedLoader.AMPFeedLoaderListener
DROP_WRONG_TIMESTAMP_PACKETS_ALWAYS, DROP_WRONG_TIMESTAMP_PACKETS_NEVER, DROP_WRONG_TIMESTAMP_PACKETS_ONLY_VOD, ERROR_FORMAT_UNKNOWN, ERROR_NETWORK_RESOURCE_DONT_EXIST, ERROR_NETWORK_SECURITY_ISSUE, ERROR_NETWORK_UNAVAILABLE, ERROR_RESOURCES_ISSUE, ERROR_SUCCESS, ERROR_TS_SEGMENT_INVALID, FULLSCREEN_MODE_KEEP_ASPECT_RATIO, FULLSCREEN_MODE_NONE, FULLSCREEN_MODE_TOTAL, HLS_STARTING_ALGORITHM_AKAMAI, HLS_STARTING_ALGORITHM_APPLE, MEDIA_REBUFFERING_MODE_AUTOMATIC, MEDIA_REBUFFERING_MODE_MANUAL, MEDIA_VIDEO_QUALITY_AUTO, MEDIA_VIDEO_QUALITY_HIGH, MEDIA_VIDEO_QUALITY_LOW, MEDIA_VIDEO_QUALITY_MEDIUM, NETSESSION_MODE_ALLOWED, NETSESSION_MODE_DISABLED, NETSESSION_MODE_REQUIRED, VERSION
Constructor and Description |
---|
VideoPlayerViewHardwareAdvanced(Context context) |
VideoPlayerViewHardwareAdvanced(Context context,
AttributeSet attrs) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
about()
Get the about text.
|
void |
addEventsListener(IPlayerEventsListener listener)
Register a callback to be invoked when any player event happens
|
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
|
java.lang.String |
getCurrentSegmentUrl() |
int |
getDuration()
Get the duration of the video in seconds.
|
long |
getDVRLength()
Get the lenght, in seconds, of the DVR
|
double |
getEncodedFPS()
Get the encoded frames per second for the loaded stream
This method is not supported on Hardware and Hardware Advanced decoding modes
|
AMPFeed |
getFeed()
Returns the feed of the loaded stream (in case playback was launched providing a json feed)
|
long |
getFPS()
Get the current FPS (Frames per Second)
|
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
|
java.util.Date |
getLicenseExpirationDate()
Returns the expiration date of the set license
|
java.lang.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
|
java.lang.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
|
java.lang.String |
getServerIp()
Get the Server IP of the current loaded stream
|
int |
getServerPort()
Get the Server port for the current loaded stream
|
java.lang.String |
getStreamsInfo()
Return information about the streams
|
java.lang.String |
getStreamUrl()
Returns the url of the loaded stream
|
int |
getTimePosition()
Return the current playback position in seconds
|
java.util.Date |
getTimePositionAsDate()
Return the current playback position as a local time date
|
long |
getTimePositionMS()
Return the current playback position in milliseconds
|
java.lang.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
|
java.lang.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() |
protected void |
onDetachedFromWindow() |
int |
onEndBuffering() |
int |
onError() |
protected void |
onMeasure(int widthMeasureSpec,
int heightMeasureSpec) |
void |
onPause() |
int |
onPlaybackFinished() |
void |
onResume() |
void |
onSegmentProgress(java.lang.String segmentUrl,
int segmentOffset) |
int |
onStartBuffering() |
int |
onVideoPropertiesChange(int width,
int height,
int frameRate,
int bitRate) |
void |
pause()
Pause playback
|
void |
playAudioUrl(java.lang.String sInUrl)
Play an audio only stream given the stream URL
|
void |
playAudioUrl(java.lang.String sInUrl,
int startPosition)
Play an audio only stream given the stream URL, starting at the specified position in seconds
|
void |
playFeedFromJson(java.lang.String sJsonData)
Play a stream given a JSON feed string.
|
void |
playFeedFromUrl(java.lang.String sInUrl)
Play a stream given a feed url.
|
void |
playInternalUrl(java.lang.String sInUrl,
boolean bInOnlyAudio,
int startPosition) |
void |
playUrl(java.lang.String sInUrl)
Play a stream given the stream Url
|
void |
playUrl(java.lang.String sInUrl,
int position)
Play a stream given the stream URL, starting at the specified position in seconds
|
boolean |
processBuffer(java.lang.String url,
byte[] data,
int bitrate,
boolean lastSegment,
boolean forceDiscontinuity,
int segmentPosition,
int segmentOffset,
boolean segmentAfterSeek) |
void |
removeEventsListener(IPlayerEventsListener listener)
Deregister a callback that was invoked when any player event happens
|
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 |
setBackgroundColor(int color)
Sets the background color for the player itself
|
void |
setBitrateToPlay(int bitrateIndex)
Software: In manual switching mode, set the maximum bitrate to be used during the playback.
|
void |
setDebugingActive(java.lang.Boolean value)
Activate/deactivate the debug mode
|
void |
setDebugUrl(java.lang.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 |
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 listener)
Deprecated.
|
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 |
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 |
setHLSStartingAlgorithm(int mode)
Sets the algorithm used for selecting the initial bitrate of the playback
|
void |
setInitialSeekingPosition(int iInNewPos)
Set the video starting position
|
void |
setLastErrorCode(int errorCode,
int httpErrorCode) |
void |
setLicense(java.lang.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(java.lang.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(java.lang.String key,
java.lang.String value)
Report Media Analytics custom dimension in the player
|
void |
setMediaAnalyticsViewerDiagnosticsId(java.lang.String viewerId)
Set Media Analytics Diagnostics Viewer Id.
|
void |
setMediaAnalyticsViewerId(java.lang.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
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getHeight, getWidth
public VideoPlayerViewHardwareAdvanced(Context context, AttributeSet attrs)
public VideoPlayerViewHardwareAdvanced(Context context)
public void playUrl(java.lang.String sInUrl)
playUrl
in interface VideoPlayerView
sInUrl
- Url of the stream to playpublic void playUrl(java.lang.String sInUrl, int position)
playUrl
in interface VideoPlayerView
sInUrl
- URL of the stream to playposition
- Start position in secondspublic void playAudioUrl(java.lang.String sInUrl)
playAudioUrl
in interface VideoPlayerView
sInUrl
- Url of the stream to playpublic void playAudioUrl(java.lang.String sInUrl, int startPosition)
playAudioUrl
in interface VideoPlayerView
sInUrl
- Url of the stream to playposition
- Start position in secondspublic void playFeedFromUrl(java.lang.String sInUrl)
playFeedFromUrl
in interface VideoPlayerView
sInUrl
- URL of the feed to playpublic void feedLoaded(AMPFeed feed)
feedLoaded
in interface AMPFeedLoader.AMPFeedLoaderListener
public void playFeedFromJson(java.lang.String sJsonData)
playFeedFromJson
in interface VideoPlayerView
sJsonData
- JSON stringpublic void playInternalUrl(java.lang.String sInUrl, boolean bInOnlyAudio, int startPosition)
public void pause()
pause
in interface VideoPlayerView
public boolean isPlaybackProcessInterrupted()
VideoPlayerView
isPlaybackProcessInterrupted
in interface VideoPlayerView
public void resume()
resume
in interface VideoPlayerView
public void stop()
VideoPlayerView
stop
in interface VideoPlayerView
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height)
public void surfaceCreated(SurfaceHolder holder)
public void surfaceDestroyed(SurfaceHolder holder)
public boolean processBuffer(java.lang.String url, byte[] data, int bitrate, boolean lastSegment, boolean forceDiscontinuity, int segmentPosition, int segmentOffset, boolean segmentAfterSeek)
processBuffer
in interface MemoryBufferProcessor
public int getBuffersInQueue()
getBuffersInQueue
in interface MemoryBufferProcessor
public boolean forceBufferProcessing()
forceBufferProcessing
in interface MemoryBufferProcessor
public int getNetsessionMode()
getNetsessionMode
in interface MemoryBufferProcessor
@Deprecated public void setEventsListener(IPlayerEventsListener listener)
addEventsListener(IPlayerEventsListener)
setEventsListener
in interface VideoPlayerView
oInPlayer
- The callback that will be runpublic void addEventsListener(IPlayerEventsListener listener)
VideoPlayerView
addEventsListener
in interface VideoPlayerView
public void removeEventsListener(IPlayerEventsListener listener)
VideoPlayerView
removeEventsListener
in interface VideoPlayerView
public void setSegmentInfoListener(ISegmentInfoListener segInfoListener)
setSegmentInfoListener
in interface VideoPlayerView
protected void onDetachedFromWindow()
public void seek(int iInNewPos, int iInRelPos)
VideoPlayerView
seek
in interface VideoPlayerView
iInNewPos
- The offset in seconds from the start to seek to.public void seekToLive()
VideoPlayerView
seekToLive
in interface VideoPlayerView
public void switchBitrateUp()
switchBitrateUp
in interface VideoPlayerView
public void switchBitrateDown()
switchBitrateDown
in interface VideoPlayerView
public void setMaxBitrate(int iMaxBitrate)
VideoPlayerView
setMaxBitrate
in interface VideoPlayerView
iMaxBitrate
- Max bitrate to playpublic void setBitrateToPlay(int bitrateIndex)
VideoPlayerView
setBitrateToPlay
in interface VideoPlayerView
public void setStartingBitrateIndex(int iIndex)
setStartingBitrateIndex
in interface VideoPlayerView
index
- of the bitrate to be used when playback startpublic int getBitratesCount()
getBitratesCount
in interface VideoPlayerView
public int getBitrateByIndex(int index)
getBitrateByIndex
in interface VideoPlayerView
index
- of the bitratepublic int getIndexByBitrate(int bitrate)
getIndexByBitrate
in interface VideoPlayerView
bitrate
- public boolean isPlaying()
VideoPlayerView
isPlaying
in interface VideoPlayerView
public boolean isPaused()
VideoPlayerView
isPaused
in interface VideoPlayerView
public boolean isError()
VideoPlayerView
isError
in interface VideoPlayerView
public boolean isFinished()
VideoPlayerView
isFinished
in interface VideoPlayerView
public boolean isSeeking()
VideoPlayerView
isSeeking
in interface VideoPlayerView
public boolean isAudioOnly()
VideoPlayerView
isAudioOnly
in interface VideoPlayerView
public boolean isFullScreen()
VideoPlayerView
isFullScreen
in interface VideoPlayerView
public boolean isLive()
VideoPlayerView
isLive
in interface VideoPlayerView
public boolean isResumingAfterActivityResume()
isResumingAfterActivityResume
in interface VideoPlayerView
public int getTimePosition()
VideoPlayerView
getTimePosition
in interface VideoPlayerView
public java.util.Date getTimePositionAsDate()
VideoPlayerView
getTimePositionAsDate
in interface VideoPlayerView
public int getPositionInDVR()
VideoPlayerView
getPositionInDVR
in interface VideoPlayerView
public long getDVRLength()
VideoPlayerView
getDVRLength
in interface VideoPlayerView
public void setAdjustTimestamps(boolean adjust)
VideoPlayerView
setAdjustTimestamps
in interface VideoPlayerView
public void setDisableDynamicAudioFeature(boolean disable)
VideoPlayerView
setDisableDynamicAudioFeature
in interface VideoPlayerView
public void setDropWrongTimestampPacketsMode(int mode)
VideoPlayerView
setDropWrongTimestampPacketsMode
in interface VideoPlayerView
public void setAutoResume(boolean enable)
VideoPlayerView
setAutoResume
in interface VideoPlayerView
enable
- If true, auto-resume is enabled.public void setProgressBarControl(View progressBar)
VideoPlayerView
setProgressBarControl
in interface VideoPlayerView
progressBar
- Progress Bar controlpublic View getProgressBarControl()
VideoPlayerView
getProgressBarControl
in interface VideoPlayerView
public void onResume()
onResume
in interface VideoPlayerView
public void onPause()
onPause
in interface VideoPlayerView
public void onDestroy()
onDestroy
in interface VideoPlayerView
public java.lang.String getStreamsInfo()
getStreamsInfo
in interface VideoPlayerView
public int getVideoWidth()
VideoPlayerView
getVideoWidth
in interface VideoPlayerView
public int getVideoHeight()
VideoPlayerView
getVideoHeight
in interface VideoPlayerView
public int getDuration()
VideoPlayerView
getDuration
in interface VideoPlayerView
public long getCurrentBitrate()
getCurrentBitrate
in interface VideoPlayerView
public void setFullScreenMode(int mode)
VideoPlayerView
setFullScreenMode
in interface VideoPlayerView
mode
- Fullscreen modepublic void setFullScreen(boolean fullscreen)
VideoPlayerView
setFullScreen
in interface VideoPlayerView
public int getFullScreenMode()
VideoPlayerView
getFullScreenMode
in interface VideoPlayerView
public int getBufferingPercentage()
VideoPlayerView
getBufferingPercentage
in interface VideoPlayerView
public void setRebufferingMode(int iInMode)
VideoPlayerView
setRebufferingMode
in interface VideoPlayerView
iInMode
- Rebuffering mode value.public void setRebufferingSize(int iInRebufferSize)
VideoPlayerView
setRebufferingSize
in interface VideoPlayerView
iInRebufferSize
- Buffer size in bytes.public int getBitratesSwitchesUp()
VideoPlayerView
getBitratesSwitchesUp
in interface VideoPlayerView
public int getBitratesSwitchesDown()
VideoPlayerView
getBitratesSwitchesDown
in interface VideoPlayerView
public int getRebuffers()
VideoPlayerView
getRebuffers
in interface VideoPlayerView
public double getRebufferingTime()
VideoPlayerView
getRebufferingTime
in interface VideoPlayerView
public long getFPS()
VideoPlayerView
getFPS
in interface VideoPlayerView
public java.lang.String getCurrentSegmentUrl()
getCurrentSegmentUrl
in interface VideoPlayerView
public long getAvgFPS()
VideoPlayerView
getAvgFPS
in interface VideoPlayerView
public double getEncodedFPS()
VideoPlayerView
getEncodedFPS
in interface VideoPlayerView
public java.lang.String getProtocol()
VideoPlayerView
getProtocol
in interface VideoPlayerView
public java.lang.String getServerIp()
VideoPlayerView
getServerIp
in interface VideoPlayerView
public int getServerPort()
VideoPlayerView
getServerPort
in interface VideoPlayerView
public int getLastHttpErrorCode()
VideoPlayerView
getLastHttpErrorCode
in interface VideoPlayerView
public void setDropFrames(boolean value)
VideoPlayerView
setDropFrames
in interface VideoPlayerView
value
- When true, player will drop frames to sync audio/videopublic void setVideoQuality(int iInQuality)
VideoPlayerView
setVideoQuality
in interface VideoPlayerView
iInQuality
- Video qualitypublic void setAvoidAudioOnlyStreams(boolean bInValue)
VideoPlayerView
setAvoidAudioOnlyStreams
in interface VideoPlayerView
bInValue
- If true, audio only streams will not be used for mbr streamspublic void setUseBufferingWhenStarting(boolean value)
VideoPlayerView
setUseBufferingWhenStarting
in interface VideoPlayerView
value
- If true, log initial buffering is enabled.public void setHLSStartingAlgorithm(int mode)
VideoPlayerView
setHLSStartingAlgorithm
in interface VideoPlayerView
public void setNetSessionMode(int mode)
VideoPlayerView
setNetSessionMode
in interface VideoPlayerView
mode
- NetSession mode.public void setLogEnabled(boolean value)
setLogEnabled
in interface VideoPlayerView
value
- If true, log traces are enabled.public void setUseMultiThread(boolean value)
VideoPlayerView
setUseMultiThread
in interface VideoPlayerView
public void setManualSwitching(boolean bInValue)
VideoPlayerView
setManualSwitching
in interface VideoPlayerView
bInValue
- if true, the control switch to manual mode and the bitrate selection algorithm is not usedpublic long getBytesLoaded()
VideoPlayerView
getBytesLoaded
in interface VideoPlayerView
public java.lang.String about()
VideoPlayerView
about
in interface VideoPlayerView
public void setDebugUrl(java.lang.String value)
setDebugUrl
in interface VideoPlayerView
value
- Url to send the debugging filespublic void setDebugingActive(java.lang.Boolean value)
setDebugingActive
in interface VideoPlayerView
value
- When true, the player sends debug files to a
remote server after each playbackpublic void setLicense(java.lang.String license)
setLicense
in interface VideoPlayerView
license.
- License should be provided by Akamai.public java.lang.String getLicensePackageName()
getLicensePackageName
in interface VideoPlayerView
public java.util.Date getLicenseExpirationDate()
getLicenseExpirationDate
in interface VideoPlayerView
public boolean isLicenseExpired()
isLicenseExpired
in interface VideoPlayerView
public java.lang.String getVersionDescription()
getVersionDescription
in interface VideoPlayerView
public void setDefaultAudioConfig(int sample_rate, int channels)
VideoPlayerView
setDefaultAudioConfig
in interface VideoPlayerView
sample_rate
- Audio stream sample ratechannels
- Number of channels of the audio streampublic void setMediaAnalyticsConfigUrl(java.lang.String configUrl)
VideoPlayerView
setMediaAnalyticsConfigUrl
in interface VideoPlayerView
public void setMediaAnalyticsData(java.lang.String key, java.lang.String value)
VideoPlayerView
setMediaAnalyticsData
in interface VideoPlayerView
public java.lang.String getStreamUrl()
VideoPlayerView
getStreamUrl
in interface VideoPlayerView
public AMPFeed getFeed()
getFeed
in interface VideoPlayerView
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
public int onVideoPropertiesChange(int width, int height, int frameRate, int bitRate)
onVideoPropertiesChange
in interface IStreamPropertiesChange
public int onAudioPropertiesChange(int channels, int sampleRate, int bitRate)
onAudioPropertiesChange
in interface IStreamPropertiesChange
public int onStartBuffering()
onStartBuffering
in interface IStreamPropertiesChange
public void onSegmentProgress(java.lang.String segmentUrl, int segmentOffset)
onSegmentProgress
in interface VideoPlayerView
public int onEndBuffering()
onEndBuffering
in interface IStreamPropertiesChange
public int onPlaybackFinished()
onPlaybackFinished
in interface IStreamPropertiesChange
public int onError()
onError
in interface IStreamPropertiesChange
public java.lang.Boolean isBitrateSupported(int iBitrateIndex)
VideoPlayerView
isBitrateSupported
in interface VideoPlayerView
iBitrateIndex
- Zero based index of the bitrate to check.public int getLastMeasuredBandwidth()
VideoPlayerView
getLastMeasuredBandwidth
in interface VideoPlayerView
public void setAvoidIncompatibleVideoProfiles(boolean bInValue)
VideoPlayerView
setAvoidIncompatibleVideoProfiles
in interface VideoPlayerView
bInValue
- If true, enable protection that avoids selection of bitrates using H.264 profiles incompatible with the device.public void setAvoidIncompatibleVideoResolutions(boolean bInValue)
VideoPlayerView
setAvoidIncompatibleVideoResolutions
in interface VideoPlayerView
bInValue
- If true, enable protection that avoids selection of bitrates whose profile is higher than the device screen reslution.public void setMediaAnalyticsViewerDiagnosticsId(java.lang.String viewerId)
VideoPlayerView
setMediaAnalyticsViewerDiagnosticsId
in interface VideoPlayerView
public void setMediaAnalyticsViewerId(java.lang.String viewerId)
VideoPlayerView
setMediaAnalyticsViewerId
in interface VideoPlayerView
public int getLastErrorCode()
VideoPlayerView
getLastErrorCode
in interface VideoPlayerView
public void clearRenderBuffer()
VideoPlayerView
clearRenderBuffer
in interface VideoPlayerView
public void setLastErrorCode(int errorCode, int httpErrorCode)
setLastErrorCode
in interface MemoryBufferProcessor
public long getTimePositionMS()
VideoPlayerView
getTimePositionMS
in interface VideoPlayerView
public int getBandwidth()
getBandwidth
in interface MemoryBufferProcessor
public int[] getLocationOnScreen()
getLocationOnScreen
in interface VideoPlayerView
public void setInitialSeekingPosition(int iInNewPos)
VideoPlayerView
setInitialSeekingPosition
in interface VideoPlayerView
iInNewPos
- The offset in seconds from the start to seek to. It can be 0 to do a relative seekpublic long getLastPTS()
VideoPlayerView
getLastPTS
in interface VideoPlayerView
public void setForceFormatChange(boolean value)
VideoPlayerView
setForceFormatChange
in interface VideoPlayerView
value
- True to force format change flag after every seeking operationpublic void setHardwareSeekingProtection(boolean value)
VideoPlayerView
setHardwareSeekingProtection
in interface VideoPlayerView
value
- True to enable protectionpublic void setAkamaiAlgorithmValue(int bitrate)
VideoPlayerView
setAkamaiAlgorithmValue
in interface VideoPlayerView
bitrate
- in bpspublic void setForceOMXdecoding(boolean value)
VideoPlayerView
setForceOMXdecoding
in interface VideoPlayerView
value
- True to force OMX approachpublic void setBackgroundColor(int color)
VideoPlayerView
setBackgroundColor
in interface VideoPlayerView
color
- Color to set