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


Java YouTubePlayer.cueVideo方法代碼示例

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


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

示例1: onInitializationSuccess

import com.google.android.youtube.player.YouTubePlayer; //導入方法依賴的package包/類
@Override
public void onInitializationSuccess(YouTubePlayer.Provider provider,
                                    YouTubePlayer youTubePlayer, boolean wasRestored) {
    if (!wasRestored) {
        if (LOG) {
            Log.v(TAG, "trailerData " + trailerData);
        }
        if (trailerData != null && !trailerData.isEmpty()) {
            Uri uri = trailerData.get(0).getTrailerUri();

            if (LOG) {
                Log.v(TAG, "trailerData " + trailerData.size());
            }
            String trailerCode = uri.getQueryParameter("v");
            if (trailerCode != null) {
                this.youTubePlayer = youTubePlayer;
                youTubePlayer.cueVideo(trailerCode);
            }
        } else {
            getFragmentManager().beginTransaction().remove(youTubePlayerFragment).commit();
        }
    }
}
 
開發者ID:an-garcia,項目名稱:MovieGuide,代碼行數:24,代碼來源:TVShowActivity.java

示例2: onInitializationSuccess

import com.google.android.youtube.player.YouTubePlayer; //導入方法依賴的package包/類
@Override
public void onInitializationSuccess(Provider provider, YouTubePlayer player, boolean wasRestored) {
    if (null == player) return;
    mPlayer = player;

    displayCurrentTime();

    // Start buffering
    if (!wasRestored) {
        player.cueVideo(VIDEO_ID);
    }

    player.setPlayerStyle(PlayerStyle.CHROMELESS);
    mPlayButtonLayout.setVisibility(View.VISIBLE);

    // Add listeners to YouTubePlayer instance
    player.setPlayerStateChangeListener(mPlayerStateChangeListener);
    player.setPlaybackEventListener(mPlaybackEventListener);
}
 
開發者ID:StackTipsLab,項目名稱:YouTubePlayerView-Example,代碼行數:20,代碼來源:CustomPlayerControlActivity.java

示例3: 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

示例4: onInitializationSuccess

import com.google.android.youtube.player.YouTubePlayer; //導入方法依賴的package包/類
@Override
public void onInitializationSuccess(YouTubePlayer.Provider provider, YouTubePlayer youTubePlayer, boolean b) {
    if (!b) {

        // loadVideo() will auto play video
        // Use cueVideo() method, if you don't want to play it automatically
        youTubePlayer.cueVideo(Config.YOUTUBE_VIDEO_CODE);
        player=youTubePlayer;
        // Hiding player controls
        youTubePlayer.setPlayerStyle(YouTubePlayer.PlayerStyle.DEFAULT);
    }
}
 
開發者ID:rishabh115,項目名稱:Odyssey2017,代碼行數:13,代碼來源:YoutubeActivity.java

示例5: onInitializationSuccess

import com.google.android.youtube.player.YouTubePlayer; //導入方法依賴的package包/類
@Override
    public void onInitializationSuccess(YouTubePlayer.Provider provider, YouTubePlayer player, boolean wasRestored) {
        if (!wasRestored) {
//            player.cueVideo("wKJ9KzGQq0w");
            player.cueVideo(presenter.getViewId());
        }
    }
 
開發者ID:DameMatiku,項目名稱:damematiku-android,代碼行數:8,代碼來源:VideoActivity.java

示例6: onInitializationSuccess

import com.google.android.youtube.player.YouTubePlayer; //導入方法依賴的package包/類
@Override
public void onInitializationSuccess(YouTubePlayer.Provider provider, YouTubePlayer youTubePlayer, boolean wasRestored) {
    Utils.doLog("onInitializationSuccess");
    if (!wasRestored) {
        String youtubeVideoId = Utils.getYoutubeIdFormUrl(mUrlYoutubeVideo);
        youTubePlayer.cueVideo(youtubeVideoId);
    }
    youTubePlayer.setPlayerStateChangeListener(this);
}
 
開發者ID:ttpho,項目名稱:Android-Video-Youtube-View,代碼行數:10,代碼來源:YoutubeVideoView.java

示例7: onInitializationSuccess

import com.google.android.youtube.player.YouTubePlayer; //導入方法依賴的package包/類
@Override
public void onInitializationSuccess(YouTubePlayer.Provider provider, YouTubePlayer player,
    boolean wasRestored) {
  if (!wasRestored) {
    player.cueVideo("wKJ9KzGQq0w");
  }
}
 
開發者ID:ChiangC,項目名稱:FMTech,代碼行數:8,代碼來源:PlayerViewDemoActivity.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;
  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

示例9: onInitializationSuccess

import com.google.android.youtube.player.YouTubePlayer; //導入方法依賴的package包/類
@Override
public void onInitializationSuccess(YouTubePlayer.Provider provider, YouTubePlayer player,
    boolean wasRestored) {
  if (!wasRestored) {
    player.cueVideo("nCgQDjiotG0");
  }
}
 
開發者ID:ChiangC,項目名稱:FMTech,代碼行數:8,代碼來源:FragmentDemoActivity.java

示例10: 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

示例11: 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

示例12: onInitializationSuccess

import com.google.android.youtube.player.YouTubePlayer; //導入方法依賴的package包/類
@Override
public void onInitializationSuccess(YouTubePlayer.Provider provider, YouTubePlayer player, boolean wasRestored) {
    //setup the player variable, so the seekbutton can change the player.
    this.player = player;
    //add both listeners declared below.
    player.setPlayerStateChangeListener(playerStateChangeListener);
    player.setPlaybackEventListener(playbackEventListener);
    if (!wasRestored) {
        player.cueVideo("fhWaJi1Hsfo"); // Plays https://www.youtube.com/watch?v=fhWaJi1Hsfo
    }
}
 
開發者ID:JimSeker,項目名稱:AudioVideo,代碼行數:12,代碼來源:AdvancedYTActivity.java

示例13: onInitializationSuccess

import com.google.android.youtube.player.YouTubePlayer; //導入方法依賴的package包/類
@Override
public void onInitializationSuccess(YouTubePlayer.Provider provider, YouTubePlayer youTubePlayer, boolean b) {
    String videoId = getIntent().getStringExtra("videoId");
    if (!b) {
        youTubePlayer.cueVideo(videoId);
    }
}
 
開發者ID:bazhabazha,項目名稱:Demo-YouTuBe-Android,代碼行數:8,代碼來源:PlayVideoUsingYouTuBeActivity.java

示例14: onInitializationSuccess

import com.google.android.youtube.player.YouTubePlayer; //導入方法依賴的package包/類
@Override
public void onInitializationSuccess(YouTubePlayer.Provider provider, YouTubePlayer player, boolean wasRestored) {
    if (!wasRestored) {
        player.cueVideo("fhWaJi1Hsfo"); // Plays https://www.youtube.com/watch?v=fhWaJi1Hsfo
    }
}
 
開發者ID:JimSeker,項目名稱:AudioVideo,代碼行數:7,代碼來源:MainFragment.java

示例15: onInitializationSuccess

import com.google.android.youtube.player.YouTubePlayer; //導入方法依賴的package包/類
@Override
public void onInitializationSuccess(YouTubePlayer.Provider provider, YouTubePlayer youTubePlayer, boolean b) {
    youTubePlayer.cueVideo(ABOUT_VIDEO_ID);
}
 
開發者ID:rapidpro,項目名稱:ureport-android,代碼行數:5,代碼來源:AboutActivity.java


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