Fix player error

This commit is contained in:
Rafael 2022-01-31 19:11:58 -03:00 committed by Thomas Zarebczan
parent 3d4a4cd960
commit df360f7ccc

View file

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