【问题标题】:Fullscreen mode on screen orientation change in jiaozi video player library饺子视频播放器库中屏幕方向更改的全屏模式
【发布时间】:2018-01-20 13:10:23
【问题描述】:

我正在使用 jiaozi 视频播放器 库在我的 Android 应用中播放视频。一切正常。现在我面临一个问题,在屏幕方向从纵向更改为横向时,视频应该是全屏的,有没有人这样做过,如果是,请分享代码或 sn-p 以便我可以实现相同的操作。

【问题讨论】:

    标签: android


    【解决方案1】:

    示例我从这里得到的代码:https://stackoverflow.com/a/5726776/2232127

    @Override
    public void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);
    
        // Checks the orientation of the screen
        if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
            yourVideoPlayer.setFullscreen(true);
        } else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT){
            yourVideoPlayer.setFullscreen(false);
        }
    }
    

    我实际上并不了解您的视频播放器库,因此 setFullscreen 方法可能不存在。尝试找到对应的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-20
      • 1970-01-01
      • 2010-10-19
      • 2014-11-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多