mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
Fix marker seeking (#689)
This commit is contained in:
@@ -95,9 +95,6 @@ export class ScenePlayerImpl extends React.Component<
|
|||||||
|
|
||||||
private onReady() {
|
private onReady() {
|
||||||
this.player = JWUtils.getPlayer();
|
this.player = JWUtils.getPlayer();
|
||||||
if (this.props.timestamp > 0) {
|
|
||||||
this.player.seek(this.props.timestamp);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.player.on("error", (err: any) => {
|
this.player.on("error", (err: any) => {
|
||||||
if (err && err.code === 224003) {
|
if (err && err.code === 224003) {
|
||||||
@@ -115,6 +112,12 @@ export class ScenePlayerImpl extends React.Component<
|
|||||||
this.handleError();
|
this.handleError();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.player.on("playlist", () => {
|
||||||
|
if (this.props.timestamp > 0) {
|
||||||
|
this.player.seek(this.props.timestamp);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private onSeeked() {
|
private onSeeked() {
|
||||||
@@ -152,6 +155,12 @@ export class ScenePlayerImpl extends React.Component<
|
|||||||
console.log("Trying next source in playlist");
|
console.log("Trying next source in playlist");
|
||||||
this.player.load(this.playlist);
|
this.player.load(this.playlist);
|
||||||
this.player.play();
|
this.player.play();
|
||||||
|
|
||||||
|
this.player.on("firstFrame", () => {
|
||||||
|
if (this.props.timestamp > 0) {
|
||||||
|
this.player.seek(this.props.timestamp);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -210,6 +219,7 @@ export class ScenePlayerImpl extends React.Component<
|
|||||||
|
|
||||||
const seekHook = (seekToPosition: number, _videoTag: HTMLVideoElement) => {
|
const seekHook = (seekToPosition: number, _videoTag: HTMLVideoElement) => {
|
||||||
if (
|
if (
|
||||||
|
!_videoTag.src ||
|
||||||
ScenePlayerImpl.isDirectStream(_videoTag.src) ||
|
ScenePlayerImpl.isDirectStream(_videoTag.src) ||
|
||||||
_videoTag.src.endsWith(".m3u8")
|
_videoTag.src.endsWith(".m3u8")
|
||||||
) {
|
) {
|
||||||
|
|||||||
Reference in New Issue
Block a user