19 lines
461 B
JavaScript
19 lines
461 B
JavaScript
/**
|
|
* Initialize Video.js players
|
|
*/
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
// Wait for Video.js to be loaded
|
|
function checkVideoJS() {
|
|
if (window.videojs) {
|
|
// Initialize any video players on the page
|
|
var players = document.querySelectorAll('.video-js');
|
|
players.forEach(function(player) {
|
|
videojs(player.id);
|
|
});
|
|
} else {
|
|
setTimeout(checkVideoJS, 50);
|
|
}
|
|
}
|
|
|
|
checkVideoJS();
|
|
});
|