mirror of
https://github.com/owncast/owncast.git
synced 2024-10-10 19:16:02 +00:00
Use on Ready event instead of player setup hook
This commit is contained in:
parent
431c1a54e7
commit
06ec265038
@ -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,
|
||||
|
@ -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');
|
||||
|
Loading…
x
Reference in New Issue
Block a user