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

Android TV / DPAD support? #44

Closed roman-petrov closed 1 year ago

roman-petrov commented 1 year ago

First of all, thank you for such great package! I noticed that keyboard focus navigation & DPAD support is missing, is it planned?

I found that ExcludeFocus is used which prevents keyboard access https://github.com/zezo357/flutter_meedu_videoplayer/blob/4e5ef23d93b0655261f36b1ff98d4e71b0edae46/package/lib/src/widgets/meedu_video_player.dart#L90, is it intentional?

Thanks!

abdelaziz-mahdy commented 1 year ago

Yes, I ignore foucs for inner widgets (like buttons inside container)

And keyboard inputs are supported, I tested only on windows

(arrows) for volume and seek

(.) For fit changes

(Enter) for full screen

roman-petrov commented 1 year ago

thanks for the response. Actually I asked about a "standard" ability to perform focus activation through playback controls using keyboard tab, arrows/enter key: https://docs.flutter.dev/development/ui/advanced/focus. As I understand, currently ExcludeFocus widget prevents it. So on Android TV it is not possible to access UI through DPAD.

abdelaziz-mahdy commented 1 year ago

thanks for the response. Actually I asked about a "standard" ability to perform focus activation through playback controls using keyboard tab, arrows/enter key: https://docs.flutter.dev/development/ui/advanced/focus. As I understand, currently ExcludeFocus widget prevents it. So on Android TV it is not possible to access UI through DPAD.

Can you explain to me what does dpad does?

Also tabs should work on the video player as a whole not the controls inside it

I can make exclude foucs optional from controller, if the controls are the thing you need

roman-petrov commented 1 year ago

DPAD just navigates through focusable widgets, it behaves almost similar to desktop keyboard. So if focus navigation using desktop keyboard will work fine, DPAD will work too.

On TVs players all controls usually focusable with Remote or DPAD.

abdelaziz-mahdy commented 1 year ago

Okay, I will make the exclude optional and you will have to disable it on your side when you need it

roman-petrov commented 1 year ago

thank you for quick support!

abdelaziz-mahdy commented 1 year ago

can you test on flutter_meedu_videoplayer: ^4.0.9-dev.1

added a new variable where you set if focus should be ignored or not

roman-petrov commented 1 year ago

focus navigation is working on 4.0.9-dev.1, thank you for quick help!

abdelaziz-mahdy commented 1 year ago

fixed on 4.0.9