Fix play btn calcs as audio tag was not measuring as expected

This commit is contained in:
David Granado 2022-01-28 23:57:19 -06:00 committed by Thomas Zarebczan
parent 5ee2f40608
commit f09c6d7a50

View file

@ -292,7 +292,7 @@ function VideoViewer(props: Props) {
function centerPlayButton() { function centerPlayButton() {
// center play button // center play button
const playBT = document.getElementsByClassName('vjs-big-play-button')[0]; const playBT = document.getElementsByClassName('vjs-big-play-button')[0];
const videoDiv = window.player.children_[0]; const videoDiv = window.player.children_[0].closest('video-js-parent');
const controlBar = document.getElementsByClassName('vjs-control-bar')[0]; const controlBar = document.getElementsByClassName('vjs-control-bar')[0];
const leftWidth = (videoDiv.offsetWidth - playBT.offsetWidth) / 2 + 'px'; const leftWidth = (videoDiv.offsetWidth - playBT.offsetWidth) / 2 + 'px';
const availableHeight = videoDiv.offsetHeight - controlBar.offsetHeight; const availableHeight = videoDiv.offsetHeight - controlBar.offsetHeight;