使用JW Player旋转屏幕在Android应用程序中运行不佳

时间:2016-12-07 20:17:03

标签: android jwplayer screen-rotation android-fullscreen onconfigurationchanged

我有一个JW Player的任务 - 这个播放器必须在旋转设备时全屏显示,就像在youtube中一样。在将数据设置为播放器(视频URL)之前,旋转在两个方向(向右和向左)都有效。在那之后,第一次旋转对于横向定向很好。并且容易以纵向方式返回。但在那之后我的活动旋转不好。它仅在一个方向(向左)旋转。正确的方向不要在片段和活动中调用onConfigurationChanged。

我在片段中使用JWPlayerView。活动在清单中具有以下设置:

 android:configChanges="keyboard|keyboardHidden|orientation|screenSize"

PlayerFragment

 @Override
public void onConfigurationChanged(Configuration newConfig) {
    mJWPlayerView.setFullscreen(newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE, true);
    super.onConfigurationChanged(newConfig);

}

当我调用此方法时,旋转变得很糟糕:

 PlaylistItem pi = new PlaylistItem.Builder()
                  .file("https:" + videoModel.getVideoUrl().getHlsUrl())
                  .build();

 mJWPlayerView.load(pi);

我应该在哪里找到问题?

我见过来自Google Play的应用程序示例jwPlayer。它也有同样的问题。 https://play.google.com/store/apps/details?id=com.jwplayer.opensourcedemo&hl=ru

0 个答案:

没有答案