当视频在Fullscreen上播放时。我想按下后退按钮可以退出全屏,我一直尝试覆盖 onbackPress 和 onKeydown 但是不行。请帮助我
@Override
public void onInitializationSuccess(YouTubePlayer.Provider provider, YouTubePlayer youTubePlayer, boolean b) {
System.out.println("here");
youTubePlayer.setPlayerStateChangeListener(playerStateChangeListener);
youTubePlayer.setPlaybackEventListener(playbackeventlistener);
youTubePlayer.setOnFullscreenListener(onFullscreenListener);
you = youTubePlayer;
if (b) {
youTubePlayer.cueVideo(Video_id);
}}
youTubePlayer.setShowFullscreenButton(false);
youTubePlayer.setManageAudioFocus(false);
youTubePlayer.setFullscreen(true);
youTubePlayer.setPlayerStyle(YouTubePlayer.PlayerStyle.MINIMAL);
}
@Override
public void onBackPressed() {
super.onBackPressed();
if (isFullscreen.equals(true)){
you.setFullscreenControlFlags(0);
isFullscreen = false;
you.setFullscreen(false);
}else {
super.onBackPressed();
}
}
}
答案 0 :(得分:2)
你能试试吗?
var Startdatetime = DateTime.ParseExact(startdate.Substring(0, 24), "ddd MMM d yyyy HH:mm:ss", CultureInfo.InvariantCulture);