开发者

Help with capturing pause/resume with VideoView with MediaController after video starts

开发者 https://www.devze.com 2023-02-20 10:13 出处:网络
... mVideoView = (VideoView) findViewById(R.id.video); mVideoView.setKeepScreenOn(true); final Intent intent = getIntent();

...

        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

精彩评论

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