ShowerLoop-cc/docker/showerloop/public/js/video-init.modern.js

18 lines
441 B
JavaScript

/**
* Initialize Video.js players with modern ES syntax
*/
document.addEventListener('DOMContentLoaded', () => {
const checkVideoJS = () => {
if (window.videojs) {
// Initialize any video players on the page
const players = document.querySelectorAll('.video-js');
players.forEach(player => {
videojs(player.id);
});
} else {
setTimeout(checkVideoJS, 50);
}
};
checkVideoJS();
});