我尝试查找有关EXOPLAYER
超过2天的默认播放按钮。但是现在卡住了。
我的问题,单击时是否可以检测默认播放按钮?
单击默认播放按钮时,我需要进行全屏模式。我想要直接单击播放时。不需要其他按钮。
defaultPlayButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//do the fullscreen mode
}
});
对我来说,效果最好:
public void performFullScreenOperations(Boolean isFullScreen){
if(!isFullScreen) {
//fullscreenButton.setImageDrawable(ContextCompat.getDrawable(MainActivity.this, R.drawable.ic_fullscreen_open));
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
if(getSupportActionBar() != null){
getSupportActionBar().show();
}
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) playerView.getLayoutParams();
params.width = params.MATCH_PARENT;
params.height = (int) ( 200 * getApplicationContext().getResources().getDisplayMetrics().density);
playerView.setLayoutParams(params);
//fullscreen = false;
}else{
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN
|View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
|View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
if(getSupportActionBar() != null){
getSupportActionBar().hide();
}
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) playerView.getLayoutParams();
params.width = params.MATCH_PARENT;
params.height = params.MATCH_PARENT;
playerView.setLayoutParams(params);
//fullscreen = true;
}
}