OpenMediaStation / media_kit_tv

Extensions for the Flutter media_kit libary for TVs
MIT License
2 stars 0 forks source link

keyboardShortcuts not working #1

Open sp4rkiop opened 1 week ago

sp4rkiop commented 1 week ago

keyboardShortcuts: { const SingleActivator(LogicalKeyboardKey.keyH): () { debugPrint('arrow right button pressed'); _player.seek(_currentPosition + Duration(seconds: 10)); }, },

    works if i use MaterialDesktop controls but not with MateriaTv
LNA-DEV commented 1 week ago

Yes I removed them because I feared they interfere with the Focus handling. Do you really need them on TV?

LNA-DEV commented 1 week ago

But I think we could add them back in around here: https://github.com/OpenMediaStation/media_kit_tv/blob/ff05ec925756767bbdd8dc2649e9418da7d76dfe/lib/material_tv.dart#L519

I may take a closer look in a few days

sp4rkiop commented 1 week ago

great!. btw yesterday i was debuging your player.dart and found that PlatformGlobals.isTv was the issue due to which MaterialDesktopVideoControlsTheme controls were opening and i was not able to navigate widgets. my emulator was android 10 tv 1080p (upto my understanding the emulator launcher has not updated and is still to default android tv launcher so 'android.software.leanback' is not detected there. we are developing almost same thing so i will work on your platform_globals.dart to make it backward compatible too. I am actively working on my code for player, its controls and settings menu for television devices, will share you player.dart when i am done with it.

EDIT: Finally done with changes and also found that i was not doing await PlatformGlobals.setGlobals(); in main.dart therefore every bool was false for me. My player is complete for mobile/web (was already) now done with androidTv aswell. Thanks for creating the package. Much appreciated.

sp4rkiop commented 1 week ago

But I think we could add them back in around here:

https://github.com/OpenMediaStation/media_kit_tv/blob/ff05ec925756767bbdd8dc2649e9418da7d76dfe/lib/material_tv.dart#L519

I may take a closer look in a few days

I don't think we need this anymore in near future maybe as already the navigation to buttons are working well. Thanks for addressing btw. also feel free to close this.