开发者

How to OverRide some of the methods of VideoView of android

Is there any Listener to override methods of Videoview like

boolean canPause()

boolean canSeekBackward()

boolean canSeekForward()

int getBufferPercentage()

int getCurrentPosition()

int getDuration()

boolean isPlaying()

How to pause a video. For audio we use mediaController.setMediaPlayer. How we can use for video.

Basically 开发者_开发问答my code for playing video is like this :

mediaController = new MediaController(activity);

mediaController.setMediaPlayer(videoView);

videoView.setVideoPath(filePath);

videoView.requestFocus();

videoView.start();

mediaController.show();

videoView.setMediaController(mediaController);

And also I want to know what is the difference between mediaController.setMediaPlayer

(videoView); and videoView.setMediaController(mediaController).

Can Anyone help me in sorting out thi issue.
Thanks in Advance.


I am afraid you cant. You might have to write your own videoview by overriding the SurfaceView and creating a MediaPlayer instance. But in this case you would have to handle many factors like video dimension, playback, buffer etc...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜