mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Add chapter titles to trickplay popup (#5832)
This commit is contained in:
parent
9bceeff812
commit
1f1e9d5dad
1 changed files with 17 additions and 1 deletions
|
@ -1384,11 +1384,13 @@ export default function (view) {
|
||||||
let chapterThumbContainer = bubble.querySelector('.chapterThumbContainer');
|
let chapterThumbContainer = bubble.querySelector('.chapterThumbContainer');
|
||||||
let chapterThumb;
|
let chapterThumb;
|
||||||
let chapterThumbText;
|
let chapterThumbText;
|
||||||
|
let chapterThumbName;
|
||||||
|
|
||||||
// Create bubble elements if they don't already exist
|
// Create bubble elements if they don't already exist
|
||||||
if (chapterThumbContainer) {
|
if (chapterThumbContainer) {
|
||||||
chapterThumb = chapterThumbContainer.querySelector('.chapterThumbWrapper');
|
chapterThumb = chapterThumbContainer.querySelector('.chapterThumbWrapper');
|
||||||
chapterThumbText = chapterThumbContainer.querySelector('.chapterThumbText');
|
chapterThumbText = chapterThumbContainer.querySelector('h2.chapterThumbText');
|
||||||
|
chapterThumbName = chapterThumbContainer.querySelector('div.chapterThumbText');
|
||||||
} else {
|
} else {
|
||||||
doFullUpdate = true;
|
doFullUpdate = true;
|
||||||
|
|
||||||
|
@ -1407,11 +1409,24 @@ export default function (view) {
|
||||||
chapterThumbTextContainer.classList.add('chapterThumbTextContainer');
|
chapterThumbTextContainer.classList.add('chapterThumbTextContainer');
|
||||||
chapterThumbContainer.appendChild(chapterThumbTextContainer);
|
chapterThumbContainer.appendChild(chapterThumbTextContainer);
|
||||||
|
|
||||||
|
chapterThumbName = document.createElement('div');
|
||||||
|
chapterThumbName.classList.add('chapterThumbText', 'chapterThumbText-dim');
|
||||||
|
chapterThumbTextContainer.appendChild(chapterThumbName);
|
||||||
|
|
||||||
chapterThumbText = document.createElement('h2');
|
chapterThumbText = document.createElement('h2');
|
||||||
chapterThumbText.classList.add('chapterThumbText');
|
chapterThumbText.classList.add('chapterThumbText');
|
||||||
chapterThumbTextContainer.appendChild(chapterThumbText);
|
chapterThumbTextContainer.appendChild(chapterThumbText);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let chapter;
|
||||||
|
for (const currentChapter of item.Chapters || []) {
|
||||||
|
if (positionTicks < currentChapter.StartPositionTicks) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
chapter = currentChapter;
|
||||||
|
}
|
||||||
|
|
||||||
// Update trickplay values
|
// Update trickplay values
|
||||||
const currentTimeMs = positionTicks / 10_000;
|
const currentTimeMs = positionTicks / 10_000;
|
||||||
const currentTile = Math.floor(currentTimeMs / trickplayInfo.Interval);
|
const currentTile = Math.floor(currentTimeMs / trickplayInfo.Interval);
|
||||||
|
@ -1435,6 +1450,7 @@ export default function (view) {
|
||||||
chapterThumb.style.backgroundPositionY = offsetY + 'px';
|
chapterThumb.style.backgroundPositionY = offsetY + 'px';
|
||||||
|
|
||||||
chapterThumbText.textContent = datetime.getDisplayRunningTime(positionTicks);
|
chapterThumbText.textContent = datetime.getDisplayRunningTime(positionTicks);
|
||||||
|
chapterThumbName.textContent = chapter?.Name || '';
|
||||||
|
|
||||||
// Set bubble innerHTML if container isn't part of DOM
|
// Set bubble innerHTML if container isn't part of DOM
|
||||||
if (doFullUpdate) {
|
if (doFullUpdate) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue