Commit 3f5e615e authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

Keep player pending also when duration is known but too short

Should the player be added with a short sound but then change its duration,
we would never have tracked it as pending player.
parent bd66295a
......@@ -319,15 +319,14 @@ function playerPaused(player) {
}
function setPlayerActive(player) {
pendingActivePlayer = player;
if (isNaN(player.duration)) {
// Ignore this player for now until we know a duration
// In durationchange event handler we'll check for this and end up here again
pendingActivePlayer = player;
return;
}
pendingActivePlayer = undefined;
// Ignore short sounds, they are most likely a chat notification sound
// A stream has a duration of Infinity
// Note that "NaN" is also not finite but we already returned earlier for that
......@@ -335,6 +334,7 @@ function setPlayerActive(player) {
return;
}
pendingActivePlayer = undefined;
activePlayer = player;
// when playback starts, send along metadata
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment