Commit 216d5b12 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

Listen for player "emptied" signal

This is when a website reuses their player and clears its playlist when doing Ajax page navigation

Differential Revision:
parent 8a1f15ca
......@@ -258,6 +258,13 @@ function registerPlayer(player) {
sendPlayerInfo(player, "waiting");
// playlist is now empty or being reloaded, stop player
// e.g. when using Ajax page navigation and the user nagivated away
player.addEventListener("emptied", function () {
// could have its own signal but for compat it's easier just to pretend to have stopped
sendPlayerInfo(player, "stopped");
// opposite of "waiting", we finished buffering enough
// only if we are playing, though, should we set playback state back to playing
player.addEventListener("canplay", function () {
Supports Markdown
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