Display youtube videos in portrait using YouTubeStandalonePlayer

With a new one youtube apifor android, when you try to start working with YouTubeStandalonePlayer , a video will be displayed in landscape mode.

Intent youtubeIntent = YouTubeStandalonePlayer.createVideoIntent(context, Configuration.DEVELOPER_KEY, item.getVideo().getId(), 0, true,false);
context.startActivity(youtubeIntent);

I want the video to still display in full screen mode, but with portrait mode.

+5
source share
1 answer

You can try setting the parameter lightboxMode(last boolean value) to true. Then it will not be full-screen, but I think that it can remain in portrait mode at least (I think I have not tried it, though ...).

+4
source

All Articles