public interface VideoPlayerView
Modifier and Type | Field and Description |
---|---|
static int |
DROP_WRONG_TIMESTAMP_PACKETS_ALWAYS
Packets with wrong timestamps will be always dropped
|
static int |
DROP_WRONG_TIMESTAMP_PACKETS_NEVER
Packets with wrong timestamps will be never dropped
|
static int |
DROP_WRONG_TIMESTAMP_PACKETS_ONLY_VOD
Packets with wrong timestamps will be dropped only for VOD streams
|
static int |
ERROR_FORMAT_UNKNOWN
The provided stream doesn't have a known format
|
static int |
ERROR_NETWORK_RESOURCE_DONT_EXIST
Resource (stream URL) doesn't exist
|
static int |
ERROR_NETWORK_SECURITY_ISSUE
Access not allowed to the provided stream URL
|
static int |
ERROR_NETWORK_UNAVAILABLE
Network access is not available
|
static int |
ERROR_RESOURCES_ISSUE
There was an issue while allocating resources for playback
|
static int |
ERROR_SUCCESS
No error
|
static int |
ERROR_TS_SEGMENT_INVALID
The provided stream contains format errors
|
static int |
FULLSCREEN_MODE_KEEP_ASPECT_RATIO
Fullscreen enabled, keeping original aspect ratio
|
static int |
FULLSCREEN_MODE_NONE
Fullscreen disabled
|
static int |
FULLSCREEN_MODE_TOTAL
Fullscreen enabled, filling the full control
|
static int |
HLS_STARTING_ALGORITHM_AKAMAI
Starting algorithm designed by Akamai, optimized to cover the max number of devices
with the starting bitrate.
|
static int |
HLS_STARTING_ALGORITHM_APPLE
Starting algorithm implemented in iDevices.
|
static int |
MEDIA_REBUFFERING_MODE_AUTOMATIC
Rebuffering mode automatic
|
static int |
MEDIA_REBUFFERING_MODE_MANUAL
Rebuffering mode manual
|
static int |
MEDIA_VIDEO_QUALITY_AUTO
Video Quality Auto
|
static int |
MEDIA_VIDEO_QUALITY_HIGH
Video Quality High
|
static int |
MEDIA_VIDEO_QUALITY_LOW
Video Quality Low
|
static int |
MEDIA_VIDEO_QUALITY_MEDIUM
Video Quality Medium
|
static int |
NETSESSION_MODE_ALLOWED
NetSession will be used by default but, in case of an error, the player will automatically disable it.
|
static int |
NETSESSION_MODE_DISABLED
NetSession disabled.
|
static int |
NETSESSION_MODE_REQUIRED
NetSession required.
|
static java.lang.String |
VERSION
Deprecated.
|
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.
|
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 |
getBitrateByIndex(int index)
Return the bitrate (bps) for the variant indicated in the index parameter
|
int |
getBitratesCount()
Get the number of available bitrate indexes 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
|
long |
getBytesLoaded()
For the current playback, get the number of bytes loaded
|
long |
getCurrentBitrate()
Get the current bitrate of the video in bps
|
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 |
getHeight()
Return the height of this view
|
int |
getIndexByBitrate(int bitrate)
Return the index for the bitrate indicated in the bitrate parameter (bps)
|
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 |
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
|
int |
getWidth()
Return the width of this view
|
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 |
isMuted()
Returns whether or not the current audio thread is muted
|
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
|
void |
onDestroy() |
void |
onPause() |
void |
onResume() |
void |
onSegmentProgress(java.lang.String segmentUrl,
int segmentOffset) |
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 position)
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 |
playMutedUrl(java.lang.String sInUrl)
Starts playing the stream in mute
|
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
|
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 |
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 |
switchBitrateDown()
Ask the player to switch to the lower bitrate
|
void |
switchBitrateUp()
Ask the player to switch to the upper bitrate
|
@Deprecated static final java.lang.String VERSION
static final int FULLSCREEN_MODE_NONE
static final int FULLSCREEN_MODE_KEEP_ASPECT_RATIO
static final int FULLSCREEN_MODE_TOTAL
static final int MEDIA_VIDEO_QUALITY_LOW
static final int MEDIA_VIDEO_QUALITY_MEDIUM
static final int MEDIA_VIDEO_QUALITY_HIGH
static final int MEDIA_VIDEO_QUALITY_AUTO
static final int MEDIA_REBUFFERING_MODE_MANUAL
static final int MEDIA_REBUFFERING_MODE_AUTOMATIC
static final int HLS_STARTING_ALGORITHM_AKAMAI
static final int HLS_STARTING_ALGORITHM_APPLE
static final int NETSESSION_MODE_DISABLED
static final int NETSESSION_MODE_ALLOWED
static final int NETSESSION_MODE_REQUIRED
static final int DROP_WRONG_TIMESTAMP_PACKETS_NEVER
static final int DROP_WRONG_TIMESTAMP_PACKETS_ONLY_VOD
static final int DROP_WRONG_TIMESTAMP_PACKETS_ALWAYS
static final int ERROR_SUCCESS
static final int ERROR_NETWORK_UNAVAILABLE
static final int ERROR_NETWORK_RESOURCE_DONT_EXIST
static final int ERROR_NETWORK_SECURITY_ISSUE
static final int ERROR_FORMAT_UNKNOWN
static final int ERROR_RESOURCES_ISSUE
static final int ERROR_TS_SEGMENT_INVALID
void playUrl(java.lang.String sInUrl)
sInUrl
- URL of the stream to playvoid playUrl(java.lang.String sInUrl, int position)
sInUrl
- URL of the stream to playposition
- Start position in secondsvoid playAudioUrl(java.lang.String sInUrl)
sInUrl
- Url of the stream to playvoid playAudioUrl(java.lang.String sInUrl, int position)
sInUrl
- Url of the stream to playposition
- Start position in secondsvoid playFeedFromUrl(java.lang.String sInUrl)
sInUrl
- URL of the feed to playvoid playFeedFromJson(java.lang.String sJsonData)
sJsonData
- JSON stringvoid stop()
void pause()
void resume()
void seek(int iInNewPos, @Deprecated int iInRelPos)
iInNewPos
- The offset in seconds from the start to seek to.[DEPRECATED]
- iInRelPos The offset in seconds from the current position to seek to. Use 0 to do an absolute seekvoid seekToLive()
void switchBitrateUp() throws java.lang.Exception
java.lang.Exception
void switchBitrateDown() throws java.lang.Exception
java.lang.Exception
void setMaxBitrate(int iMaxBitrate)
iMaxBitrate
- Max bitrate to playvoid setBitrateToPlay(int bitrateIndex) throws java.lang.Exception
bitrateIndex
- java.lang.Exception
void setStartingBitrateIndex(int iIndex)
index
- of the bitrate to be used when playback startint getBitratesCount()
int getBitrateByIndex(int index)
index
- of the bitrateint getIndexByBitrate(int bitrate)
bitrate
- java.lang.Boolean isBitrateSupported(int iBitrateIndex)
iBitrateIndex
- Zero based index of the bitrate to check.boolean isPlaying()
boolean isPaused()
boolean isError()
boolean isFinished()
boolean isSeeking()
boolean isAudioOnly()
boolean isFullScreen()
boolean isLive()
boolean isPlaybackProcessInterrupted()
boolean isResumingAfterActivityResume()
int getTimePosition()
long getTimePositionMS()
java.util.Date getTimePositionAsDate()
int getPositionInDVR()
long getDVRLength()
long getLastPTS()
void setAdjustTimestamps(boolean adjust)
adjust.
- True, to enable adjustment of timestampsvoid setDisableDynamicAudioFeature(boolean disable)
disable.
- True, to disable dynamic audio featurevoid setDropWrongTimestampPacketsMode(int mode)
mode.
- void onResume()
void onPause()
void onDestroy()
java.lang.String getStreamsInfo()
int getVideoWidth()
int getVideoHeight()
int getDuration()
long getCurrentBitrate()
void setFullScreenMode(int mode)
mode
- Fullscreen modevoid setFullScreen(boolean fullscreen)
fullScreen
- If true, switch the player to fullsreen mode. Otherwise, set non-fullscreen modeint getFullScreenMode()
mode
- Current fullscreen modeint getBufferingPercentage()
void setRebufferingMode(int iInMode)
iInMode
- Rebuffering mode value.void setRebufferingSize(int iInRebufferSize)
iInRebufferSize
- Buffer size in bytes.@Deprecated void setEventsListener(IPlayerEventsListener listener)
addEventsListener(IPlayerEventsListener)
void addEventsListener(IPlayerEventsListener listener)
player
- The callback that will be runvoid removeEventsListener(IPlayerEventsListener listener)
player
- The callback that will be removedvoid setSegmentInfoListener(ISegmentInfoListener segInfoListener)
int getBitratesSwitchesUp()
int getBitratesSwitchesDown()
int getRebuffers()
double getRebufferingTime()
long getFPS()
long getAvgFPS()
double getEncodedFPS()
java.lang.String getProtocol()
java.lang.String getServerIp()
int getServerPort()
int getLastHttpErrorCode()
int getLastMeasuredBandwidth()
void setDropFrames(boolean value)
value
- When true, player will drop frames to sync audio/videovoid setVideoQuality(int iInQuality)
iInQuality
- Video qualityvoid setAvoidAudioOnlyStreams(boolean bInValue)
bInValue
- If true, audio only streams will not be used for mbr streamsvoid setUseBufferingWhenStarting(boolean value)
value
- If true, log initial buffering is enabled.void setHLSStartingAlgorithm(int mode)
mode
- void setNetSessionMode(int mode)
mode
- NetSession mode.void setLogEnabled(boolean value)
value
- If true, log traces are enabled.void setUseMultiThread(boolean value)
if
- true, multithread decoding enabledvoid setManualSwitching(boolean bInValue)
bInValue
- if true, the control switch to manual mode and the bitrate selection algorithm is not usedvoid setAvoidIncompatibleVideoProfiles(boolean bInValue)
bInValue
- If true, enable protection that avoids selection of bitrates using H.264 profiles incompatible with the device.void setAvoidIncompatibleVideoResolutions(boolean bInValue)
bInValue
- If true, enable protection that avoids selection of bitrates whose profile is higher than the device screen reslution.void setAutoResume(boolean enable)
enable
- If true, auto-resume is enabled.long getBytesLoaded()
java.lang.String about()
void setProgressBarControl(View progressBar)
progressBar
- Progress Bar controlView getProgressBarControl()
void setDebugUrl(java.lang.String value)
value
- Url to send the debugging filesvoid setDebugingActive(java.lang.Boolean value)
value
- When true, the player sends debug files to a
remote server after each playbackvoid setLicense(java.lang.String license)
license.
- License should be provided by Akamai.java.lang.String getLicensePackageName()
java.util.Date getLicenseExpirationDate()
boolean isLicenseExpired()
java.lang.String getVersionDescription()
void setDefaultAudioConfig(int sample_rate, int channels)
sample_rate
- Audio stream sample ratechannels
- Number of channels of the audio streamvoid setMediaAnalyticsConfigUrl(java.lang.String configUrl)
Media
- Analytics config urlvoid setMediaAnalyticsData(java.lang.String key, java.lang.String value)
key
- value
- void setMediaAnalyticsViewerDiagnosticsId(java.lang.String viewerId)
void setMediaAnalyticsViewerId(java.lang.String viewerId)
java.lang.String getStreamUrl()
AMPFeed getFeed()
int getLastErrorCode()
int getWidth()
int getHeight()
int[] getLocationOnScreen()
void clearRenderBuffer()
void setInitialSeekingPosition(int iInNewPos)
iInNewPos
- The offset in seconds from the start to seek to. It can be 0 to do a relative seekvoid onSegmentProgress(java.lang.String segmentUrl, int segmentOffset)
java.lang.String getCurrentSegmentUrl()
void setForceFormatChange(boolean value)
value
- True to force format change flag after every seeking operationvoid setHardwareSeekingProtection(boolean value)
value
- True to enable protectionvoid setAkamaiAlgorithmValue(int bitrate)
bitrate
- in bpsvoid setForceOMXdecoding(boolean value)
value
- True to force OMX approachvoid setBackgroundColor(int color)
color
- Color to setvoid playMutedUrl(java.lang.String sInUrl)
boolean isMuted()