mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge pull request #2210 from nyanmisaka/offset-step
Set the step of subtitle offset slider to 0.1
This commit is contained in:
commit
c7a1c19d9e
2 changed files with 4 additions and 4 deletions
|
@ -45,11 +45,11 @@ function init(instance) {
|
||||||
let inputOffset = /[-+]?\d+\.?\d*/g.exec(this.textContent);
|
let inputOffset = /[-+]?\d+\.?\d*/g.exec(this.textContent);
|
||||||
if (inputOffset) {
|
if (inputOffset) {
|
||||||
inputOffset = inputOffset[0];
|
inputOffset = inputOffset[0];
|
||||||
|
inputOffset = parseFloat(inputOffset);
|
||||||
|
inputOffset = Math.min(30, Math.max(-30, inputOffset));
|
||||||
|
|
||||||
// replace current text by considered offset
|
// replace current text by considered offset
|
||||||
this.textContent = inputOffset + 's';
|
this.textContent = inputOffset + 's';
|
||||||
|
|
||||||
inputOffset = parseFloat(inputOffset);
|
|
||||||
// set new offset
|
// set new offset
|
||||||
playbackManager.setSubtitleOffset(inputOffset, player);
|
playbackManager.setSubtitleOffset(inputOffset, player);
|
||||||
// synchronize with slider value
|
// synchronize with slider value
|
||||||
|
@ -121,7 +121,7 @@ function getPercentageFromOffset(value) {
|
||||||
// convert fraction to percent
|
// convert fraction to percent
|
||||||
percentValue *= 50;
|
percentValue *= 50;
|
||||||
percentValue += 50;
|
percentValue += 50;
|
||||||
return Math.min(100, Math.max(0, percentValue.toFixed()));
|
return Math.min(100, Math.max(0, percentValue.toFixed(1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
class SubtitleSync {
|
class SubtitleSync {
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<button type="button" is="paper-icon-button-light" class="subtitleSync-closeButton"><span class="material-icons close"></span></button>
|
<button type="button" is="paper-icon-button-light" class="subtitleSync-closeButton"><span class="material-icons close"></span></button>
|
||||||
<div class="subtitleSyncTextField" contenteditable="true" spellcheck="false">0s</div>
|
<div class="subtitleSyncTextField" contenteditable="true" spellcheck="false">0s</div>
|
||||||
<div class="sliderContainer subtitleSyncSliderContainer">
|
<div class="sliderContainer subtitleSyncSliderContainer">
|
||||||
<input is="emby-slider" type="range" step="1" min="0" max="100" value="50" class="subtitleSyncSlider" data-slider-keep-progress="true" />
|
<input is="emby-slider" type="range" step=".1" min="0" max="100" value="50" class="subtitleSyncSlider" data-slider-keep-progress="true" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue