mirror of
https://github.com/TeamNewPipe/NewPipe.git
synced 2025-10-03 01:39:38 +02:00
Player: destroy -> saveAndShutdown
This commit is contained in:
parent
0aa71a58ed
commit
4e1b0e0555
2 changed files with 9 additions and 3 deletions
|
@ -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) {
|
if (DEBUG) {
|
||||||
Log.d(TAG, "destroy() called");
|
Log.d(TAG, "saveAndShutdown() called");
|
||||||
}
|
}
|
||||||
|
|
||||||
saveStreamProgressState();
|
saveStreamProgressState();
|
||||||
|
|
|
@ -226,7 +226,7 @@ class PlayerService : MediaBrowserServiceCompat() {
|
||||||
// notify that the player is being destroyed
|
// notify that the player is being destroyed
|
||||||
onPlayerStartedOrStopped!!.accept(null)
|
onPlayerStartedOrStopped!!.accept(null)
|
||||||
}
|
}
|
||||||
player!!.destroy()
|
player!!.saveAndShutdown()
|
||||||
player = null
|
player = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue