fix(exoplayer): fix hotswap between players

This commit is contained in:
2026-07-26 20:05:12 +02:00
parent 06efcbf1aa
commit e565717016
2 changed files with 83 additions and 2 deletions
@@ -107,7 +107,10 @@ class OmniPlayer(
override var showNotification: Boolean? = false
set(value) {
if (value == true) {
if (notificationPlayer != null && notificationPlayer?.isPlaying == true) {
val otherIsPlaying = notificationPlayer?.let { other ->
runOnMainThreadSync { other.isPlaying }
} == true
if (otherIsPlaying) {
throw Error("Two players can't display notifications at the same time.")
}
notificationPlayer = localPlayer