Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix chapter marker re-rendering #5593

Merged
merged 1 commit into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/elements/emby-slider/emby-slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,14 @@ function setMarker(range, valueMarker, marker, valueProgress) {
}

function updateMarkers(range, currentValue) {
if (range.getMarkerInfo) {
if (range.getMarkerInfo && !range.markerInfo) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't markerInfo (as well as the slider itself) preserved when start playing the next video, so the markers won't be updated?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my testing it was not.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only get to the breakpoint once per refresh. So I assume they are preserved (because videoosd doesn't reload for the next item).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm yeah you are right... I'm not sure how it worked when I originally tested... #5601

range.markerInfo = range.getMarkerInfo();

range.markerContainerElement.innerHTML = '';

let markersHtml = '';
range.markerInfo.forEach(() => {
range.markerContainerElement.insertAdjacentHTML('beforeend', '<span class="sliderMarker" aria-hidden="true"></span>');
markersHtml += '<span class="sliderMarker" aria-hidden="true"></span>';
});
range.markerContainerElement.innerHTML = markersHtml;

range.markerElements = range.markerContainerElement.querySelectorAll('.sliderMarker');
}
Expand Down
2 changes: 1 addition & 1 deletion src/elements/emby-slider/emby-slider.scss
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@
.sliderMarker {
position: absolute;
width: 2px;
height: 0.5em;
height: 12px;
transform: translate3d(0, 25%, 0);
}

Expand Down
Loading