Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Displaying youtube video in portrait with the YouTubeStandalonePlayer

With the new youtube api for android, when trying to start an activity with the YouTubeStandalonePlayer it displays the video on landscape mode.

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

I want the video still to be displayed on full screen but with portrait mode.

like image 817
meh Avatar asked Jan 24 '13 16:01

meh


People also ask

Can you watch YouTube videos in portrait mode?

Thankfully, there's a better way, using the app's built-in gestures: you can simply swipe up on a video to fill up the screen and swipe down on it to go back to portrait orientation.

What is a YouTube player?

A YouTubePlayer provides methods for loading, playing and controlling YouTube video playback.


1 Answers

You could try setting the lightboxMode parameter (the last boolean) to true. It won't be fullscreen then, but I think it might stay in portrait mode at least (I think, haven't tried it though...).

like image 126
Goddchen Avatar answered Sep 30 '22 17:09

Goddchen