mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge pull request #3745 from Viperinius/chapter-markers
Add chapter markings to video player slider
This commit is contained in:
commit
1ac326d40b
5 changed files with 123 additions and 7 deletions
|
@ -21,6 +21,7 @@
|
|||
<div class="flex flex-direction-row align-items-center">
|
||||
<div class="osdTextContainer startTimeText osdPositionText" style="margin: 0 .25em 0 0;"></div>
|
||||
<div class="sliderContainer flex-grow" style="margin: .5em 0 .25em;">
|
||||
<div class="sliderMarkerContainer"></div>
|
||||
<input type="range" step=".01" min="0" max="100" value="0" is="emby-slider" class="osdPositionSlider" data-slider-keep-progress="true" />
|
||||
</div>
|
||||
<div class="osdTextContainer endTimeText osdDurationText" style="margin: 0 0 0 .25em;"></div>
|
||||
|
|
|
@ -1563,6 +1563,25 @@ import { setBackdropTransparency, TRANSPARENCY_LEVEL } from '../../../components
|
|||
return '<h1 class="sliderBubbleText">' + datetime.getDisplayRunningTime(ticks) + '</h1>';
|
||||
};
|
||||
|
||||
nowPlayingPositionSlider.getMarkerInfo = function () {
|
||||
const markers = [];
|
||||
|
||||
const item = currentItem;
|
||||
|
||||
// use markers based on chapters
|
||||
if (item?.Chapters?.length) {
|
||||
item.Chapters.forEach(currentChapter => {
|
||||
markers.push({
|
||||
className: 'chapterMarker',
|
||||
name: currentChapter.Name,
|
||||
progress: currentChapter.StartPositionTicks / item.RunTimeTicks
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
return markers;
|
||||
};
|
||||
|
||||
view.querySelector('.btnPreviousTrack').addEventListener('click', function () {
|
||||
playbackManager.previousTrack(currentPlayer);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue