本文整理匯總了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();
}
}
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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());
}
}
示例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);
}
示例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");
}
}
示例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");
}
}
示例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");
}
}
示例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");
}
}
示例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);
}
}
示例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
}
}
示例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);
}
}
示例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
}
}
示例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);
}