2017-01-17 9 views
1

を保持し、私はJWPlayerを使用していますので、ビデオを保持するためにしようとすると、全画面でOrietationはアンドロイドJWPlayerのフルスクリーンが変更され、ビデオ

私のコードを変更されます。

@Override 
protected void onDestroy() { 
    Log.i(UIH.TAG_SCR, "Is Rotated : " + isRotated); 
    if(!isRotated) { 
     playerView.stop(); 
    } else { 
     isRotated = false; 
    } 
    super.onDestroy(); 
} 

@Override 
public void onConfigurationChanged(Configuration newConfig) { 
    Log.i(UIH.TAG_SCR, "ORIENTATION : " + newConfig.orientation); 
    if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) { 
     isRotated = true; 
     Log.i(UIH.TAG_SCR, "ORIENTATION : PORTRAIT"); 
    } else if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) { 
     isRotated = true; 
     Log.i(UIH.TAG_SCR, "ORIENTATION : LANDSCAPE"); 
     playerView.setFullscreen(true, true); 
    } 
    super.onConfigurationChanged(newConfig); 
} 

しかし、それはない作品を行います!

LogCatがある:

I/SCREEN_TAG:ORIENTATION:1

I/SCREEN_TAG:オリエンテーション:PORTRAIT

I/SCREEN_TAG:回転している:真

をI/SCREEN_TAG :オリエンテーション:2

I/SCREEN_TAG:オリエンテーション:ランドスケープ

I/SCREEN_TAG:回転している:真

+0

いずれかがお手伝いできますか? – AndroSco

答えて

2

これを試してみてください:

@Override 
public void onConfigurationChanged(Configuration newConfig) { 
    super.onConfigurationChanged(newConfig); 
    if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) { 
     if(playerView.getFullscreen()) { 
      playerView.setFullscreen(false, true); 
     } 
    } else if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) { 
     if(!playerView.getFullscreen()) { 
      playerView.setFullscreen(true, true); 
     } 
    } 
} 

それは私に動作します。

+0

私にITをチェックさせてください... – AndroSco

+0

それはうまくいきます、ありがとう – AndroSco

関連する問題