i am using YoutubePlayer API to play videos from youtube.My problem is to auto play videos starting with ads using "Youtubeplayerfragment" starting with 1.loadvideo(videoid) auto plays videos but skips ads 2.using cuevideo(videoid) cue's video but does'nt auto play.so how to auto play videos along with ads.
Instead of player.cuevideo(videoid) use player.loadVideo(videoId)
@Override
public void onInitializationSuccess(YouTubePlayer.Provider provider, YouTubePlayer player, boolean wasRestored) {
if (!wasRestored) {
player.loadVideo(strYoutubeId);
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With