1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-06-26 07:02:55 +00:00

Player: destroy -> saveAndShutdown

This commit is contained in:
Profpatsch 2025-05-13 15:51:21 +02:00
parent 06cf511188
commit f5a4af2d67
2 changed files with 9 additions and 3 deletions

View File

@ -591,9 +591,15 @@ public final class Player implements PlaybackListener, Listener {
}
}
public void destroy() {
/**
* Shut down this player.
* Saves the stream progress, sets recovery.
* Then destroys the player in all UIs and destroys the UIs as well.
*/
public void saveAndShutdown() {
if (DEBUG) {
Log.d(TAG, "destroy() called");
Log.d(TAG, "saveAndShutdown() called");
}
saveStreamProgressState();

View File

@ -226,7 +226,7 @@ class PlayerService : MediaBrowserServiceCompat() {
// notify that the player is being destroyed
onPlayerStartedOrStopped!!.accept(null)
}
player!!.destroy()
player!!.saveAndShutdown()
player = null
}