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

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) { if (this.props.timestamp > 0) {
this.player.seek(this.props.timestamp); this.player.seek(this.props.timestamp);
} }
@@ -155,12 +155,6 @@ 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);
}
});
} }
} }
@@ -265,7 +259,8 @@ export class ScenePlayerImpl extends React.Component<
primary: "html5", primary: "html5",
autostart: autostart:
this.props.autoplay || this.props.autoplay ||
(this.props.config ? this.props.config.autostartVideo : false), (this.props.config ? this.props.config.autostartVideo : false) ||
this.props.timestamp > 0,
repeat, repeat,
playbackRateControls: true, playbackRateControls: true,
playbackRates: [0.75, 1, 1.5, 2, 3, 4], playbackRates: [0.75, 1, 1.5, 2, 3, 4],