Fix markers not autoplaying (#698)

* Fix marker seeking
* Autostart when loading from marker
This commit is contained in:
WithoutPants 2020-08-05 09:48:23 +10:00 committed by GitHub
parent b166abfa7b
commit f5c3cafa63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 8 deletions

View File

@ -113,7 +113,7 @@ export class ScenePlayerImpl extends React.Component<
}
});
this.player.on("playlist", () => {
this.player.on("firstFrame", () => {
if (this.props.timestamp > 0) {
this.player.seek(this.props.timestamp);
}
@ -155,12 +155,6 @@ export class ScenePlayerImpl extends React.Component<
console.log("Trying next source in playlist");
this.player.load(this.playlist);
this.player.play();
this.player.on("firstFrame", () => {
if (this.props.timestamp > 0) {
this.player.seek(this.props.timestamp);
}
});
}
}
@ -265,7 +259,8 @@ export class ScenePlayerImpl extends React.Component<
primary: "html5",
autostart:
this.props.autoplay ||
(this.props.config ? this.props.config.autostartVideo : false),
(this.props.config ? this.props.config.autostartVideo : false) ||
this.props.timestamp > 0,
repeat,
playbackRateControls: true,
playbackRates: [0.75, 1, 1.5, 2, 3, 4],