abdelaziz-mahdy / flutter_meedu_videoplayer

Cross-Platform Video Player for flutter
https://abdelaziz-mahdy.github.io/flutter_meedu_videoplayer/
MIT License
132 stars 69 forks source link

Adding Desktop Pip #79

Closed 0Franky closed 1 year ago

0Franky commented 1 year ago

Added:

To Fix:

Needed:

0Franky commented 1 year ago

Hi zezo357, this is a draft of code to add Pip mode to desktops as well. (IS IN PROGRESS) I need your help to understand if I'm doing well and I'm writing the code in the right place.

Also I would need a hand to write the close pip mode button and a minimal ui for the pip mode (play/pause button, close pip).

abdelaziz-mahdy commented 1 year ago

Hi zezo357, this is a draft of code to add Pip mode to desktops as well. (IS IN PROGRESS) I need your help to understand if I'm doing well and I'm writing the code in the right place.

Also I would need a hand to write the close pip mode button and a minimal ui for the pip mode (play/pause button, close pip).

I have never seen a desktop app as pip, do you have any references on how you think it should look like?

abdelaziz-mahdy commented 1 year ago

just tested it, thats nice actually, and awesome progress btw

for the code yes you did put all in good places

note: i think there should be one example for pip ,other than that nothing is concerning

for the controls i think we should leave them as they are? and just overide the back button to close pip if its in pip, what do you think?

abdelaziz-mahdy commented 1 year ago

I noticed something also, the pip window can't be dragged 😞 which in normal usage a deal breaker,

Keep in mind most users drag the app by the top bar which was removed, I think it should be added in that case

If you have a better idea let me know

0Franky commented 1 year ago

First of all thank you very much!

Concerning drag and drop, I used the DragToMoveArea widget from the window_manager library. This allow to move the window via drag and drop without using the title bar. However, I have encountered this problem too. I was only able to move the window to a specific point in the pip (top right, but below the app bar row). I think there is some UI widget that is interfering with it.

As soon as possible I'll try to use the player without integrated UI and I'll try to understand something.

Concerning the controls instead, I noticed that leaving the UI as it is, if made very small some widgets could disappear. But it would also be good to replace the back arrow with the pip close button.

0Franky commented 1 year ago

Hi zezo357, this is a draft of code to add Pip mode to desktops as well. (IS IN PROGRESS) I need your help to understand if I'm doing well and I'm writing the code in the right place. Also I would need a hand to write the close pip mode button and a minimal ui for the pip mode (play/pause button, close pip).

I have never seen a desktop app as pip, do you have any references on how you think it should look like?

I thought of something similar to browser pip

abdelaziz-mahdy commented 1 year ago

I will push some changes soon, I added close pip

And integrated the dragging in the player, but will test and let you know

abdelaziz-mahdy commented 1 year ago

sorry i took a while, let me know what you think of my changes

it should fix most of the problems we faced.

pip example now is general for android and desktop

0Franky commented 1 year ago

I just watch your edits and are amazing! Now the drag and drop works (even if not in pip mode xD), ui are perfect.

Really nice job!

0Franky commented 1 year ago

I've just edit the ControlsContainer. Now the drad and drop works only in pip mode.

abdelaziz-mahdy commented 1 year ago

The only problem is noticed but couldn't fix is when closing full screen after pip

Steps: 1- open video as full screen 2- pip in and out 3- close the Fullscreen

Window will be so big 😔,

From what I have seen the problem is it's using the size of the Fullscreen after closing it .

Don't know the fix yet, but wanted to document it

0Franky commented 1 year ago

ok I'll try to check it today 😉 I'm thinking to resize the app at the default size if pip is opened in full screen or we can do a backup of the window size before enter in full screen mode.

abdelaziz-mahdy commented 1 year ago

ok I'll try to check it today 😉 I'm thinking to resize the app at the default size if pip is opened in full screen or we can do a backup of the window size before enter in full screen mode.

I think a backup will be better. Just to not force anything on the people

0Franky commented 1 year ago

yes I agree with you

0Franky commented 1 year ago

Just committed. What do you think about my changes?

abdelaziz-mahdy commented 1 year ago

Will check them at night, since I am at work right now.

If all is good I would likely merge it, also I thought in pip we can override the back button to exit pip

Using willpopscope in full screen route, but that needs some work to make it work

abdelaziz-mahdy commented 1 year ago

fixed the video always going full screen,

remaining the going back,making it exit pip before exiting the full screen

abdelaziz-mahdy commented 1 year ago

can you check again, and i will recheck android and windows just to be sure everything is good,

btw there is still some stuff needed to be added in new release, like volume slider (desktop) and controls lock if you want to help in any of them i would love that

0Franky commented 1 year ago

I was checking rn xD btw, I'll try to implement it ASAP. I'll create a new branch using this as a base, I think we have a lot of changes that might conflict.

abdelaziz-mahdy commented 1 year ago

I was checking rn xD btw, I'll try to implement it ASAP. I'll create a new branch using this as a base, I think we have a lot of changes that might conflict.

I think that too, let me know which will you work on, so I work on the other one

0Franky commented 1 year ago

I was checking rn xD btw, I'll try to implement it ASAP. I'll create a new branch using this as a base, I think we have a lot of changes that might conflict.

I think that too, let me know which will you work on, so I work on the other one

I started the lock. But only logic. I need to understand better how to implement the ui widgets

abdelaziz-mahdy commented 1 year ago

@0Franky pip for macos crashes, just was able to test it right now

abdelaziz-mahdy commented 1 year ago

@0Franky pip for macos crashes, just was able to test it right now

https://github.com/leanflutter/window_manager/pull/341 fixes it