am 79e338fb: Merge change 22089 into eclair
Merge commit '79e338fb2ae4144a7069e9b3ce4c6d7a2b7b87ec' * commit '79e338fb2ae4144a7069e9b3ce4c6d7a2b7b87ec': The MetaData API is optional and getMetadata may return null if unsupported.
This commit is contained in:
@@ -267,12 +267,17 @@ public class VideoView extends SurfaceView implements MediaPlayerControl {
|
||||
// Get the capabilities of the player for this stream
|
||||
Metadata data = mp.getMetadata(MediaPlayer.METADATA_ALL,
|
||||
MediaPlayer.BYPASS_METADATA_FILTER);
|
||||
mCanPause = !data.has(Metadata.PAUSE_AVAILABLE)
|
||||
|| data.getBoolean(Metadata.PAUSE_AVAILABLE);
|
||||
mCanSeekBack = !data.has(Metadata.SEEK_BACKWARD_AVAILABLE)
|
||||
|| data.getBoolean(Metadata.SEEK_BACKWARD_AVAILABLE);
|
||||
mCanSeekForward = !data.has(Metadata.SEEK_FORWARD_AVAILABLE)
|
||||
|| data.getBoolean(Metadata.SEEK_FORWARD_AVAILABLE);
|
||||
|
||||
if (data != null) {
|
||||
mCanPause = !data.has(Metadata.PAUSE_AVAILABLE)
|
||||
|| data.getBoolean(Metadata.PAUSE_AVAILABLE);
|
||||
mCanSeekBack = !data.has(Metadata.SEEK_BACKWARD_AVAILABLE)
|
||||
|| data.getBoolean(Metadata.SEEK_BACKWARD_AVAILABLE);
|
||||
mCanSeekForward = !data.has(Metadata.SEEK_FORWARD_AVAILABLE)
|
||||
|| data.getBoolean(Metadata.SEEK_FORWARD_AVAILABLE);
|
||||
} else {
|
||||
mCanPause = mCanSeekForward = mCanSeekForward = true;
|
||||
}
|
||||
|
||||
if (mOnPreparedListener != null) {
|
||||
mOnPreparedListener.onPrepared(mMediaPlayer);
|
||||
|
||||
Reference in New Issue
Block a user