Troubleshoot player not getting ready event on production server

This commit is contained in:
Gabe Kangas
2020-06-17 17:48:33 -07:00
parent 5cecb50b2e
commit f20d8b3179

View File

@@ -1,12 +1,11 @@
// style hackings // style hackings
window.VIDEOJS_NO_DYNAMIC_STYLE = true; window.VIDEOJS_NO_DYNAMIC_STYLE = true;
var waitingTimeoutTimer;
// Wait until the player is setup before we start polling status // Wait until the player is setup before we start polling status
const player = videojs('video'); const player = videojs('video');
player.on('ready', function () { player.on('ready', function () {
console.log('Player ready.')
getStatus(); getStatus();
setInterval(getStatus, 5000); setInterval(getStatus, 5000);
setupPlayerEventHandlers(); setupPlayerEventHandlers();
@@ -16,41 +15,36 @@ function setupPlayerEventHandlers() {
const player = videojs('video'); const player = videojs('video');
player.on('error', function (e) { player.on('error', function (e) {
console.log(e); console.log("Player error: ", e);
}) })
player.on('loadeddata', function (e) { // player.on('loadeddata', function (e) {
console.log("loadeddata"); // console.log("loadeddata");
}) // })
player.on('ended', function (e) {
console.log("ended");
})
// player.on('ended', function (e) {
// console.log("ended");
// })
//
// player.on('abort', function (e) { // player.on('abort', function (e) {
// console.log("abort"); // console.log("abort");
// }) // })
//
// player.on('durationchange', function (e) { // player.on('durationchange', function (e) {
// console.log("durationchange"); // console.log("durationchange");
// }) // })
//
// player.on('stalled', function (e) { // player.on('stalled', function (e) {
// console.log("stalled"); // console.log("stalled");
// }) // })
//
player.on('playing', function (e) { // player.on('playing', function (e) {
// console.log("playing"); // // console.log("playing");
clearTimeout(waitingTimeoutTimer); // })
}) //
// player.on('waiting', function (e) {
player.on('waiting', function (e) { // // console.log("waiting");
// console.log("waiting"); // })
// waitingTimeoutTimer = setTimeout(function () {
// restartPlayer();
// }, 3000)
})
} }
function restartPlayer() { function restartPlayer() {