abdelaziz-mahdy / flutter_meedu_videoplayer

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

macos Initialization window size issue #131

Closed 1124863805 closed 1 year ago

1124863805 commented 1 year ago

fisrt

截屏2023-07-02 00 25 47

then

截屏2023-07-02 00 25 54

The above is an example of using a plugin

If I use a third-party plugin and specify the window size, the above situation will still occur

such as

bitsdojo_window: ^0.1.5

doWhenWindowReady(() { const initialSize = Size(1000, 800); appWindow.minSize = initialSize; appWindow.size = initialSize; appWindow.alignment = Alignment.center; appWindow.show(); });

The size shown in Figure 2 will still appear, but it will return to normal next time it starts

abdelaziz-mahdy commented 1 year ago

Well that's weird, can you provide an example code to reproduce the problem?

1124863805 commented 1 year ago

https://github.com/zezo357/flutter_meedu_videoplayer/tree/master/package/example

in macos Your official example can be reproduced

abdelaziz-mahdy commented 1 year ago

https://github.com/zezo357/flutter_meedu_videoplayer/tree/master/package/example

in macos Your official example can be reproduced

Will test and let you know, keep in mind I am busy these days, so when I have time I will test

westito commented 1 year ago

Same here. The problem is the initMeeduPlayer() call. Why it is setting window size?


Future<void> initWindowManagerIfNeeded() async {
  if (UniversalPlatform.isDesktop) {
    await windowManager.ensureInitialized();

    WindowOptions windowOptions = const WindowOptions(
      size: Size(1200, 700),
      center: true,
    );

    windowManager.waitUntilReadyToShow(windowOptions, () async {
      await windowManager.show();
      await windowManager.focus();
    });
  }
}```
abdelaziz-mahdy commented 1 year ago

Same here. The problem is the initMeeduPlayer() call. Why it is setting window size?

Future<void> initWindowManagerIfNeeded() async {
  if (UniversalPlatform.isDesktop) {
    await windowManager.ensureInitialized();

    WindowOptions windowOptions = const WindowOptions(
      size: Size(1200, 700),
      center: true,
    );

    windowManager.waitUntilReadyToShow(windowOptions, () async {
      await windowManager.show();
      await windowManager.focus();
    });
  }
}```

its because of the pip feature, we can add a boolean to disable it if not needed

westito commented 1 year ago

Absolutely need :D I use auto window restoration that maintains the last window size

abdelaziz-mahdy commented 1 year ago

4.2.14 is released.