Help with capturing pause/resume with VideoView with MediaController after video starts
...
mVideoView = (VideoView) findViewById(R.id.video); mVideoView.setKeepScreenOn(true); final Intent intent = getIntent(); mHeadline = intent.getStringExtra("headline"); String liveVideoUrl = intent.getStringExtra("live_video_url"); mVideoView.setVideoPath(liveVideoUrl); mMediaController = new MediaController(this); mVideoView.setMediaController(mMediaController); mVideoView.start();
...
I need to capture when the user presses the pause/play buttons. The VideoView encapsulates Media Player hence how do I capture 开发者_如何转开发the play/pause events? Thanks.
Create a class that extends VideoView
and use this class in your layout which is assigned to mVideoView
.
精彩评论