Android: Why can't I give an onClickListener to a VideoView?

前端 未结 11 2152
独厮守ぢ
独厮守ぢ 2021-02-03 17:08

I have written these lines of code:

 mVideoView = (VideoView) findViewById(R.id.video_view);
    mVideoView.setOnClickListener(new OnClickListener() {
        @O         


        
11条回答
  •  长情又很酷
    2021-02-03 17:44

    You can solve this issue through cover layout. I used the linearlayout.

                
                    
    
                
    

    and try it in source file.

    video1.setOnClickListener {
                    if(Video.isPlaying) {
                        Video.pause()
                    }
                    else {
                        Video.start()
                    }
    }
    

提交回复
热议问题