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

[Windows] optional ability to restore app hotkeys #5

Closed nikitatg closed 2 years ago

nikitatg commented 2 years ago

If app uses hotkeys through hotkey_manager pkg then after meedu player's close/dispose all hotkeys are lost. There is async callback through which app can re-register it's hotkeys

abdelaziz-mahdy commented 2 years ago

Why would u want to register the hotkeys after removing them?

Can you explain the situation to me?😅

I don't get why you would need that ?

nikitatg commented 2 years ago

My use-case is next App (on windows) provides different functionality (e.g. instant messaging), including own hotkeys. For this I use hotkey_manager HotKeyManager.instance.registerHotkey(); Appearance of video player is only one of functions. When player appears, it registers its hotkeys. And when called MeeduPlayerController.videoPlayerClosed() and/or MeeduPlayerController.dispose() it executes HotKeyManager.instance.unregisterAll(); This code unregisters any hotkeys in app, including those I registered before I call player. Easy solution I see is to manually re-register my hotkeys when I close/dispose MeeduPlayerController passing callback

abdelaziz-mahdy commented 2 years ago

Oh I get your point now

I may make the hotkey only unregister the video player keys in an update

For now I will merge your request

Thank you for it ❤️