Use on Ready event instead of player setup hook

This commit is contained in:
Gabe Kangas 2020-06-17 17:13:55 -07:00
parent 431c1a54e7
commit 06ec265038
2 changed files with 5 additions and 4 deletions

View File

@ -10,7 +10,7 @@ async function setupApp() {
window.app = new Vue({
el: "#app-container",
data: {
streamStatus: "",
streamStatus: "Stream is offline.", // Default state.
viewerCount: 0,
sessionMaxViewerCount: 0,
overallMaxViewerCount: 0,

View File

@ -4,12 +4,13 @@ window.VIDEOJS_NO_DYNAMIC_STYLE = true;
var waitingTimeoutTimer;
// Wait until the player is setup before we start polling status
videojs.hookOnce('setup', function (player) {
// console.log('setup')
const player = videojs('video');
player.on('ready', function () {
getStatus();
setInterval(getStatus, 5000);
setupPlayerEventHandlers();
});
})
function setupPlayerEventHandlers() {
const player = videojs('video');