mirror of https://github.com/stashapp/stash.git
Change playback rates and fix rates after seeking (#2550)
This commit is contained in:
parent
ce175dcfc6
commit
dcd7595c07
|
@ -147,7 +147,7 @@ export const ScenePlayer: React.FC<IScenePlayerProps> = ({
|
||||||
chaptersButton: false,
|
chaptersButton: false,
|
||||||
},
|
},
|
||||||
nativeControlsForTouch: false,
|
nativeControlsForTouch: false,
|
||||||
playbackRates: [0.75, 1, 1.5, 2, 3, 4],
|
playbackRates: [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2],
|
||||||
inactivityTimeout: 2000,
|
inactivityTimeout: 2000,
|
||||||
preload: "none",
|
preload: "none",
|
||||||
userActions: {
|
userActions: {
|
||||||
|
@ -351,6 +351,12 @@ export const ScenePlayer: React.FC<IScenePlayerProps> = ({
|
||||||
handleError(true);
|
handleError(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// changing source (eg when seeking) resets the playback rate
|
||||||
|
// so set the default in addition to the current rate
|
||||||
|
player.on("ratechange", function (this: VideoJsPlayer) {
|
||||||
|
this.defaultPlaybackRate(this.playbackRate());
|
||||||
|
});
|
||||||
|
|
||||||
player.on("loadedmetadata", () => {
|
player.on("loadedmetadata", () => {
|
||||||
if (!player.videoWidth() && !player.videoHeight()) {
|
if (!player.videoWidth() && !player.videoHeight()) {
|
||||||
// Occurs during preload when videos with supported audio/unsupported video are preloaded.
|
// Occurs during preload when videos with supported audio/unsupported video are preloaded.
|
||||||
|
|
Loading…
Reference in New Issue