Skip to content

Commit

Permalink
Merge pull request #5719 from dmitrylyzo/fix-bubble-trickplay
Browse files Browse the repository at this point in the history
Fix Trickplay thumbnail in older web engines
  • Loading branch information
thornbill authored Jul 15, 2024
2 parents 86ff779 + 30c1926 commit 9501c50
Showing 1 changed file with 10 additions and 20 deletions.
30 changes: 10 additions & 20 deletions src/controllers/playback/video/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1382,7 +1382,7 @@ export default function (view) {

// Create bubble elements if they don't already exist
if (chapterThumbContainer) {
chapterThumb = chapterThumbContainer.querySelector('.chapterThumb');
chapterThumb = chapterThumbContainer.querySelector('.chapterThumbWrapper');
chapterThumbText = chapterThumbContainer.querySelector('.chapterThumbText');
} else {
doFullUpdate = true;
Expand All @@ -1391,22 +1391,12 @@ export default function (view) {
chapterThumbContainer.classList.add('chapterThumbContainer');
chapterThumbContainer.style.overflow = 'hidden';

const chapterThumbWrapper = document.createElement('div');
chapterThumbWrapper.classList.add('chapterThumbWrapper');
chapterThumbWrapper.style.overflow = 'hidden';
chapterThumbWrapper.style.position = 'relative';
chapterThumbWrapper.style.width = trickplayInfo.Width + 'px';
chapterThumbWrapper.style.height = trickplayInfo.Height + 'px';
chapterThumbContainer.appendChild(chapterThumbWrapper);

chapterThumb = document.createElement('img');
chapterThumb.classList.add('chapterThumb');
chapterThumb.style.position = 'absolute';
chapterThumb.style.width = 'unset';
chapterThumb.style.minWidth = 'unset';
chapterThumb.style.height = 'unset';
chapterThumb.style.minHeight = 'unset';
chapterThumbWrapper.appendChild(chapterThumb);
chapterThumb = document.createElement('div');
chapterThumb.classList.add('chapterThumbWrapper');
chapterThumb.style.overflow = 'hidden';
chapterThumb.style.width = trickplayInfo.Width + 'px';
chapterThumb.style.height = trickplayInfo.Height + 'px';
chapterThumbContainer.appendChild(chapterThumb);

const chapterThumbTextContainer = document.createElement('div');
chapterThumbTextContainer.classList.add('chapterThumbTextContainer');
Expand Down Expand Up @@ -1435,9 +1425,9 @@ export default function (view) {
MediaSourceId: mediaSourceId
});

if (chapterThumb.src != imgSrc) chapterThumb.src = imgSrc;
chapterThumb.style.left = offsetX + 'px';
chapterThumb.style.top = offsetY + 'px';
chapterThumb.style.backgroundImage = `url('${imgSrc}')`;
chapterThumb.style.backgroundPositionX = offsetX + 'px';
chapterThumb.style.backgroundPositionY = offsetY + 'px';

chapterThumbText.textContent = datetime.getDisplayRunningTime(positionTicks);

Expand Down

0 comments on commit 9501c50

Please sign in to comment.