ja2375 / FluTube

A Flutter plugin to facilitate embedding Youtube videos inside mobile apps.
MIT License
34 stars 17 forks source link

Fullscreen when rotating phone to landscape #7

Open fiote opened 5 years ago

fiote commented 5 years ago

Hi. First of all, thanks for this awesome plugin! I wasted like 2 days trying to find one that actually works and this is the best one, by far!

That said, I want to implement something like youtube's app do, which is forcing the video to fullscreen when the user rotate the phone to a landscape position.

So, what I need is one of two things: 1) an option on the FluTube creator function like forceFullscreenOnLandscape (defaulted to false), that would do what I just asked... or; 2) a method on the FluTube instanced object, like goFullscreen(), that would allow me call that by code.

Do you think any of that is possible?

ja2375 commented 5 years ago

Thanks :) Some days ago i tried to implement exactly what you said because that functionality is something that i need too. Unfortunately, this plugin relies on another plugin (Chewie) to build the player. That said, Chewie has to support that. Otherwise i would have to modify Chewie to implement it. And i don't have time for that. I have too much work to do as for now to code that functionality.

So if you really need that functionality you should go to Chewie github page and ask for it. Or you can always code it yourself and send a PR to chewie to see if they accept it (i guess they will because this should be supported out of the box...) If you get to implement it on Chewie, i will update this plugin.

The other option you have is wait for me to modify chewie. But it can take really long because, as i said, i have no time at the moment sorry.

fiote commented 5 years ago

Okay. I'll try to work on it, then :)

fiote commented 5 years ago

Based on https://github.com/brianegan/chewie/issues/125, it looks like chewie has a enterFullScreen() method. Maybe you can then expose the chewie instance at your player? That way we can do myFlutubeInstance.chewie.enterFullScreen().