2021-11-12 15:56:46 +01:00
|
|
|
// @flow
|
2022-02-11 19:50:55 +01:00
|
|
|
const VideoJsFunctions = ({ isAudio }: { isAudio: boolean }) => {
|
2021-11-12 15:56:46 +01:00
|
|
|
// TODO: can remove this function as well
|
|
|
|
// Create the video DOM element and wrapper
|
|
|
|
function createVideoPlayerDOM(container: any) {
|
|
|
|
if (!container) return;
|
|
|
|
|
|
|
|
// This seems like a poor way to generate the DOM for video.js
|
|
|
|
const wrapper = document.createElement('div');
|
|
|
|
wrapper.setAttribute('data-vjs-player', 'true');
|
|
|
|
const el = document.createElement(isAudio ? 'audio' : 'video');
|
|
|
|
el.className = 'video-js vjs-big-play-centered ';
|
|
|
|
wrapper.appendChild(el);
|
|
|
|
|
|
|
|
container.appendChild(wrapper);
|
|
|
|
|
|
|
|
return el;
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
createVideoPlayerDOM,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
export default VideoJsFunctions;
|