当前位置: 首页>>代码示例>>Java>>正文


Java YouTubePlayer.setOnFullscreenListener方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:muddassir235,项目名称:Pop-Movies-Android-App,代码行数:20,代码来源:YoutubeTrailerFragment.java

示例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);
    }
}
 
开发者ID:jszczygiel,项目名称:AndroidYoutubeOverlay,代码行数:18,代码来源:YoutubeOverlayFragment.java

示例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);
        }
    }
}
 
开发者ID:mcruncher,项目名称:worshipsongs-android,代码行数:25,代码来源:CustomYoutubeBoxActivity.java

示例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);
    }
}
 
开发者ID:prakh25,项目名称:MovieApp,代码行数:16,代码来源:TrailerActivity.java

示例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");
  }
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:13,代码来源:FullscreenDemoActivity.java

示例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");
  }
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:11,代码来源:ActionBarDemoActivity.java

示例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);
  }
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:10,代码来源:VideoListDemoActivity.java

示例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);
}
 
开发者ID:SEA2015-GROUP7,项目名称:projectTetViet,代码行数:53,代码来源:YouTubePlayerActivity.java


注:本文中的com.google.android.youtube.player.YouTubePlayer.setOnFullscreenListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。