Skip to content

Commit

Permalink
chore: keep window vhs/mpc up to date on source switch (#883)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonocasey authored Jun 26, 2020
1 parent 267cc34 commit 3ba85fd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/index-demo-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,13 @@
} else {
sources.dispatchEvent(newEvent('change'));
}
player.ready(() => {
player.on('loadedmetadata', () => {
if (player.vhs) {
window.vhs = player.tech_.vhs;
window.mpc = player.tech_.vhs.masterPlaylistController_;
} else {
window.vhs = null;
window.mpc = null;
}
});
cb(player);
Expand Down

0 comments on commit 3ba85fd

Please sign in to comment.