本文整理汇总了Java中com.google.android.youtube.player.YouTubePlayer.setOnFullscreenListener方法的典型用法代码示例。如果您正苦于以下问题:Java YouTubePlayer.setOnFullscreenListener方法的具体用法?Java YouTubePlayer.setOnFullscreenListener怎么用?Java YouTubePlayer.setOnFullscreenListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.android.youtube.player.YouTubePlayer
的用法示例。
在下文中一共展示了YouTubePlayer.setOnFullscreenListener方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onInitializationSuccess
import com.google.android.youtube.player.YouTubePlayer; //导入方法依赖的package包/类
@Override
public void onInitializationSuccess(YouTubePlayer.Provider provider, YouTubePlayer youTubePlayer, boolean b) {
youTubePlayer.setOnFullscreenListener(this);
if (!b) {
videoId = getArguments().getString("video_id");
if(skipToMillis==-1) {
Log.v("LoadingVideo:"," "+videoId);
youTubePlayer.loadVideo(videoId);
}else{
Log.v("CueingVideo:"," "+videoId);
youTubePlayer.cueVideo(videoId,skipToMillis);
Log.v("MillisToSeek:", " " + skipToMillis/1000);
}
this.youTubePlayer = youTubePlayer;
youTubePlayer.setShowFullscreenButton(false);
//youTubePlayer.setFullscreenControlFlags(YouTubePlayer.FULLSCREEN_FLAG_CONTROL_SYSTEM_UI);
}
}
示例2: onInitializationSuccess
import com.google.android.youtube.player.YouTubePlayer; //导入方法依赖的package包/类
@Override
public void onInitializationSuccess(YouTubePlayer.Provider provider, final YouTubePlayer player, boolean restored) {
LogHelper.logMessage("onInitializationSuccess: " + restored + " videoId: " + videoId);
this.player = player;
player.addFullscreenControlFlag(YouTubePlayer.FULLSCREEN_FLAG_CONTROL_SYSTEM_UI);
player.addFullscreenControlFlag(YouTubePlayer.FULLSCREEN_FLAG_CUSTOM_LAYOUT);
player.setOnFullscreenListener(new YouTubePlayer.OnFullscreenListener() {
@Override
public void onFullscreen(boolean fullscreen) {
YoutubeOverlayFragment.this.fullscreen = fullscreen;
}
});
if (!restored && videoId != null) {
player.loadVideo(videoId);
}
}
示例3: onInitializationSuccess
import com.google.android.youtube.player.YouTubePlayer; //导入方法依赖的package包/类
@Override
public void onInitializationSuccess(YouTubePlayer.Provider provider, YouTubePlayer youTubePlayer, boolean wasRestored)
{
if (Configuration.ORIENTATION_PORTRAIT == getResources().getConfiguration().orientation) {
this.youTubePlayer = youTubePlayer;
youTubePlayer.setFullscreenControlFlags(YouTubePlayer.FULLSCREEN_FLAG_CONTROL_ORIENTATION);
youTubePlayer.addFullscreenControlFlag(YouTubePlayer.FULLSCREEN_FLAG_CONTROL_SYSTEM_UI);
youTubePlayer.setShowFullscreenButton(false);
youTubePlayer.setOnFullscreenListener(new YouTubePlayer.OnFullscreenListener()
{
@Override
public void onFullscreen(boolean b)
{
isFullscreen = b;
}
});
if (mVideoId != null && !wasRestored) {
youTubePlayer.loadVideo(mVideoId);
}
if (wasRestored) {
youTubePlayer.seekToMillis(millis);
}
}
}
示例4: onInitializationSuccess
import com.google.android.youtube.player.YouTubePlayer; //导入方法依赖的package包/类
@Override
public void onInitializationSuccess(YouTubePlayer.Provider provider, YouTubePlayer youTubePlayer, boolean wasRestored) {
player = youTubePlayer;
youTubePlayer.setFullscreenControlFlags(YouTubePlayer.FULLSCREEN_FLAG_CONTROL_ORIENTATION);
youTubePlayer.addFullscreenControlFlag(YouTubePlayer.FULLSCREEN_FLAG_CONTROL_SYSTEM_UI);
youTubePlayer.setOnFullscreenListener(b -> isFullScreen = b);
if (videoId != null && !wasRestored) {
youTubePlayer.loadVideo(videoId);
}
if (wasRestored) {
youTubePlayer.seekToMillis(videoTime);
}
}
示例5: onInitializationSuccess
import com.google.android.youtube.player.YouTubePlayer; //导入方法依赖的package包/类
@Override
public void onInitializationSuccess(YouTubePlayer.Provider provider, YouTubePlayer player,
boolean wasRestored) {
this.player = player;
setControlsEnabled();
// Specify that we want to handle fullscreen behavior ourselves.
player.addFullscreenControlFlag(YouTubePlayer.FULLSCREEN_FLAG_CUSTOM_LAYOUT);
player.setOnFullscreenListener(this);
if (!wasRestored) {
player.cueVideo("avP5d16wEp0");
}
}
示例6: onInitializationSuccess
import com.google.android.youtube.player.YouTubePlayer; //导入方法依赖的package包/类
@Override
public void onInitializationSuccess(YouTubePlayer.Provider provider, YouTubePlayer player,
boolean wasRestored) {
player.addFullscreenControlFlag(YouTubePlayer.FULLSCREEN_FLAG_CUSTOM_LAYOUT);
player.setOnFullscreenListener(this);
if (!wasRestored) {
player.cueVideo("9c6W4CCU9M4");
}
}
示例7: onInitializationSuccess
import com.google.android.youtube.player.YouTubePlayer; //导入方法依赖的package包/类
@Override
public void onInitializationSuccess(Provider provider, YouTubePlayer player, boolean restored) {
this.player = player;
player.addFullscreenControlFlag(YouTubePlayer.FULLSCREEN_FLAG_CUSTOM_LAYOUT);
player.setOnFullscreenListener((VideoListDemoActivity) getActivity());
if (!restored && videoId != null) {
player.cueVideo(videoId);
}
}
示例8: onInitializationSuccess
import com.google.android.youtube.player.YouTubePlayer; //导入方法依赖的package包/类
@Override
public void onInitializationSuccess(YouTubePlayer.Provider provider,
YouTubePlayer player,
boolean wasRestored) {
this.player = player;
player.setOnFullscreenListener(this);
player.setPlayerStateChangeListener(this);
switch (orientation) {
case AUTO:
player.setFullscreenControlFlags(YouTubePlayer.FULLSCREEN_FLAG_CONTROL_ORIENTATION
| YouTubePlayer.FULLSCREEN_FLAG_CONTROL_SYSTEM_UI
| YouTubePlayer.FULLSCREEN_FLAG_ALWAYS_FULLSCREEN_IN_LANDSCAPE
| YouTubePlayer.FULLSCREEN_FLAG_CUSTOM_LAYOUT);
break;
case AUTO_START_WITH_LANDSCAPE:
player.setFullscreenControlFlags(YouTubePlayer.FULLSCREEN_FLAG_CONTROL_ORIENTATION
| YouTubePlayer.FULLSCREEN_FLAG_CONTROL_SYSTEM_UI
| YouTubePlayer.FULLSCREEN_FLAG_ALWAYS_FULLSCREEN_IN_LANDSCAPE
| YouTubePlayer.FULLSCREEN_FLAG_CUSTOM_LAYOUT);
player.setFullscreen(true);
break;
case ONLY_LANDSCAPE:
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
player.setFullscreenControlFlags(YouTubePlayer.FULLSCREEN_FLAG_CONTROL_SYSTEM_UI
| YouTubePlayer.FULLSCREEN_FLAG_CUSTOM_LAYOUT);
player.setFullscreen(true);
break;
case ONLY_PORTRAIT:
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
player.setFullscreenControlFlags(YouTubePlayer.FULLSCREEN_FLAG_CONTROL_SYSTEM_UI
| YouTubePlayer.FULLSCREEN_FLAG_CUSTOM_LAYOUT);
player.setFullscreen(true);
break;
}
switch (playerStyle) {
case CHROMELESS:
player.setPlayerStyle(YouTubePlayer.PlayerStyle.CHROMELESS);
break;
case MINIMAL:
player.setPlayerStyle(YouTubePlayer.PlayerStyle.MINIMAL);
break;
case DEFAULT:
default:
player.setPlayerStyle(YouTubePlayer.PlayerStyle.DEFAULT);
break;
}
if (!wasRestored)
player.loadVideo(videoId);
}