开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜