【问题标题】:How to implement the Pause action for the android VideoView?如何为 android VideoView 实现暂停操作?
【发布时间】:2012-01-27 10:03:30
【问题描述】:

在我的应用程序中,我将播放 VideoView。

我没有将媒体控制器用于播放、暂停和停止等各种选项。

我使用单个按钮来使用播放和暂停功能。

我已经实现了如下代码:

case R.id.playVideoBtn:
        if(myVideoView.isPlaying()){
            myVideoView.pause();
        }else{

            //MediaController ctlr=new MediaController(this);
        //  ctlr.setMediaPlayer(myVideoView);
            //myVideoView.setMediaController(ctlr);

            myVideoView.start();
        }


        break;

现在我想知道如何为同一个按钮单击实现暂停功能。

请帮帮我。

谢谢。

【问题讨论】:

    标签: android android-layout android-ndk android-videoview android-video-player


    【解决方案1】:

    来自VideoView.java 我发现...

    start() goes with pause(), but resume() goes with suspend() (the latter pair causing the screen to blank out).
    

    对于您的解决方案,请查看此示例 Playing Video

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-01-27
      • 2020-01-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多