I want to play the YouTube video in fullscreen mode by default in my Android application. I have tried with the options force_full screen
and flag_full screen
, but nothing is working.Can you please help me on this?
Thanks.
I want to play the YouTube video in fullscreen mode by default in my Android application. I have tried with the options force_full screen
and flag_full screen
, but nothing is working.Can you please help me on this?
Thanks.
This should be work:
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.youtube.com /watch?v=VIDEOID"));
intent.putExtra("force_fullscreen",true);
startActivity(intent);
Thanks DagW
you can use this code, if you use YouTube SDK
player.setPlaybackEventListener(new YouTubePlayer.PlaybackEventListener() {
@Override
public void onPlaying() {
player.setFullscreen(true);
}
@Override
public void onPaused() {
}
@Override
public void onStopped() {
}
@Override
public void onBuffering(boolean b) {
}
@Override
public void onSeekTo(int i) {
}
});