mirror of
https://github.com/zoriya/react-native-omni.git
synced 2026-08-16 02:44:51 +00:00
fix(exoplayer): fix hotswap between players
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user