當前位置: 首頁>>代碼示例>>Java>>正文


Java YouTubePlayer.FULLSCREEN_FLAG_ALWAYS_FULLSCREEN_IN_LANDSCAPE屬性代碼示例

本文整理匯總了Java中com.google.android.youtube.player.YouTubePlayer.FULLSCREEN_FLAG_ALWAYS_FULLSCREEN_IN_LANDSCAPE屬性的典型用法代碼示例。如果您正苦於以下問題:Java YouTubePlayer.FULLSCREEN_FLAG_ALWAYS_FULLSCREEN_IN_LANDSCAPE屬性的具體用法?Java YouTubePlayer.FULLSCREEN_FLAG_ALWAYS_FULLSCREEN_IN_LANDSCAPE怎麽用?Java YouTubePlayer.FULLSCREEN_FLAG_ALWAYS_FULLSCREEN_IN_LANDSCAPE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在com.google.android.youtube.player.YouTubePlayer的用法示例。


在下文中一共展示了YouTubePlayer.FULLSCREEN_FLAG_ALWAYS_FULLSCREEN_IN_LANDSCAPE屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onCheckedChanged

@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
  int controlFlags = player.getFullscreenControlFlags();
  if (isChecked) {
    // If you use the FULLSCREEN_FLAG_ALWAYS_FULLSCREEN_IN_LANDSCAPE, your activity's normal UI
    // should never be laid out in landscape mode (since the video will be fullscreen whenever the
    // activity is in landscape orientation). Therefore you should set the activity's requested
    // orientation to portrait. Typically you would do this in your AndroidManifest.xml, we do it
    // programmatically here since this activity demos fullscreen behavior both with and without
    // this flag).
    setRequestedOrientation(PORTRAIT_ORIENTATION);
    controlFlags |= YouTubePlayer.FULLSCREEN_FLAG_ALWAYS_FULLSCREEN_IN_LANDSCAPE;
  } else {
    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);
    controlFlags &= ~YouTubePlayer.FULLSCREEN_FLAG_ALWAYS_FULLSCREEN_IN_LANDSCAPE;
  }
  player.setFullscreenControlFlags(controlFlags);
}
 
開發者ID:youtube,項目名稱:yt-android-player,代碼行數:18,代碼來源:FullscreenDemoActivity.java

示例2: onInitializationSuccess

@Override
public void onInitializationSuccess(YouTubePlayer.Provider provider,
        YouTubePlayer youTubePlayer, boolean wasRestored) {

    // Set up YouTube player
    mYouTubePlayer = youTubePlayer;
    mYouTubePlayer.setPlayerStateChangeListener(this);
    mYouTubePlayer.setFullscreen(mIsFullscreen);
    mYouTubePlayer.setOnFullscreenListener(this);

    // YouTube player flags: use a custom full screen layout; let the YouTube player control
    // the system UI (hiding navigation controls, ActionBar etc); and let the YouTube player
    // handle the orientation state of the activity.
    mYouTubeFullscreenFlags = YouTubePlayer.FULLSCREEN_FLAG_CUSTOM_LAYOUT |
            YouTubePlayer.FULLSCREEN_FLAG_CONTROL_SYSTEM_UI |
            YouTubePlayer.FULLSCREEN_FLAG_CONTROL_ORIENTATION;

    // On smaller screen devices always switch to full screen in landscape mode
    if (!mIsTablet) {
        mYouTubeFullscreenFlags |= YouTubePlayer.FULLSCREEN_FLAG_ALWAYS_FULLSCREEN_IN_LANDSCAPE;
    }

    // Apply full screen flags
    mYouTubePlayer.setFullscreenControlFlags(mYouTubeFullscreenFlags);

    // Load the requested video
    if (!TextUtils.isEmpty(mYouTubeVideoId)) {
        mYouTubePlayer.loadVideo(mYouTubeVideoId);
    }
}
 
開發者ID:The-WebOps-Club,項目名稱:saarang-iosched,代碼行數:30,代碼來源:SessionLivestreamActivity.java

示例3: onInitializationSuccess

@Override
public void onInitializationSuccess(YouTubePlayer.Provider provider,
        YouTubePlayer youTubePlayer, boolean wasRestored) {

    // Set up YouTube player
    mYouTubePlayer = youTubePlayer;
    mYouTubePlayer.setPlayerStateChangeListener(this);
    mYouTubePlayer.setFullscreen(mIsFullscreen);
    mYouTubePlayer.setOnFullscreenListener(this);

    // YouTube player flags: use a custom full screen layout; let the YouTube player control
    // the system UI (hiding navigation controls, ActionBar etc); and let the YouTube player
    // handle the orientation state of the activity.
    mYouTubeFullscreenFlags = YouTubePlayer.FULLSCREEN_FLAG_CUSTOM_LAYOUT |
            YouTubePlayer.FULLSCREEN_FLAG_CONTROL_SYSTEM_UI |
            YouTubePlayer.FULLSCREEN_FLAG_CONTROL_ORIENTATION;

    // On smaller screen devices always switch to full screen in landscape mode
    if (!mIsTablet) {
        mYouTubeFullscreenFlags |= YouTubePlayer.FULLSCREEN_FLAG_ALWAYS_FULLSCREEN_IN_LANDSCAPE;
    }

    // Apply full screen flags
    setFullscreenFlags();

    // If a presentation display is available, set YouTube player style to minimal
    if (mPresentation != null) {
        mYouTubePlayer.setPlayerStyle(YouTubePlayer.PlayerStyle.MINIMAL);
    }

    // Load the requested video
    if (!TextUtils.isEmpty(mYouTubeVideoId)) {
        mYouTubePlayer.loadVideo(mYouTubeVideoId);
    }

    updatePresentation();
}
 
開發者ID:TheDeltaProgram,項目名稱:iosched2013,代碼行數:37,代碼來源:SessionLivestreamActivity.java


注:本文中的com.google.android.youtube.player.YouTubePlayer.FULLSCREEN_FLAG_ALWAYS_FULLSCREEN_IN_LANDSCAPE屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。