Device Wakelock #5501
Replies: 4 comments
This comment has been hidden.
This comment has been hidden.
-
I believe the reason it may not be working in video is because AndroidManifest.xml does not include permission for it when I tried before. I haven't been able to test video on android lately because of a recent gradle upgrade on android studio that is breaking the --include-packages flet_video:
Yeah I have to agree at this point in time, the video plugin would be a much better idea to build a music player with as it supports playlists, without playlist support, normal audio plugin will not be able to play more than one song on web when someone switches tabs in the browser. If you can fix the video player compile issues, I should be able to test if wakelock works or not when you add permission to AndroidManifest.xml for it. Last time I was able to test video, android would kill it off within a few minutes when I shut screen off, and that was with wakelock set to True. |
Beta Was this translation helpful? Give feedback.
-
I still stand by my original post though, even if we can get video player working correctly in android. This plugin should be a separate plugin. In the future of flet people may develop apps that need screen on, say for map navigation in their car, background audio, cooking recipes whatever. A generic plugin for android that can act as a foreground service for everyone where they could put custom icons/controls/images on users display as well will be what is needed and what I think will make flet really stand out for developers. I think we might need a customized plugin that makes it easy for people to run a foreground service on android, maybe a function where they could add custom controls/icons/background images to users screen. I think that would make flet really stand out as a developers paradise and gain it huge popularity with developers, as any serious developers are going to target android and iphone before anything else. In latest news from google, anyone running a foreground service on android targeting later API versions, will now have to make a youtube video of their app before submitting to playstore. Also anyone targetting later API version will now not be able to get a wakelock either without a foreground service. So as not to make developers lives complete hell, a plugin that can start a foreground service, issue wakelocks if needed etc will just make flet hugely popular. As it stands now, unless a developer was able to pull in custom foreground service plugins from flutter themselves, flet would be completely useless to them. Which would be really sad as python is most popular language on the planet, especially with AI. |
Beta Was this translation helpful? Give feedback.
-
hey guys, is there any way you can wrap mediakit with https://pub.dev/packages/audio_service I have tested wakelock on flet_video and works fine, but ultimately audio_service plugin is what I really need personally. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
People using audioplayers package cannot get a wakelock on android to continue playing music, soon as screen turns off or app is backgrounded.
The flutter package https://pub.dev/packages/wakelock_plus seems to solve this issue, the video player would need it as well. Modifications would be needed to AndroidManifest.xml to add the permission.
I believe it would need a partial wakelock for audio, and full wakelock for video.
Beta Was this translation helpful? Give feedback.
All reactions