How to play in the background when the phone enters low power mode
@marcbaechinger is already working on this.
Since Nov 27, 2023.
- Dominant language
- Java
- Stars
- 3k
- Forks
- 955
- Avg merge
- 12d 14h
- Merged PRs (30d)
- 2
Description
Hello, I'm implementing a novel player. Now I have implemented a MediaLibraryService, and then implemented a DataProvider. The DataProvider provides playback metadata for the Player. Due to business requirements, only one MediaItem can be loaded into the Player at a time. After listening to the STATE_ENDED of the player, it starts to obtain the data of the next chapter through the DataProvider request interface, and then resets it to the player.
The problem now is that after starting playback, the user locks the screen and the phone enters low power mode. After the playback ends, STATE_ENDED will cause the foreground service of MediaLibraryService to be suspended. As a result, the DataProvider cannot connect to the Internet to request the loading of the next chapter's data. What should I do to solve the problem?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.