fix seektime url parameter

fixes #120
main
Joost Wooning 2022-03-17 14:37:04 +01:00
parent 80cddf0fd8
commit 5952632816
1 changed files with 8 additions and 4 deletions

View File

@ -72,14 +72,17 @@ export default class HLS extends Component {
onSeeked = () => {
if (!this.props.playing) {
if (this.shouldInitVideoTime) {
this.videoElement.currentTime = this.props.startTime;
this.shouldInitVideoTime = false;
}
this.props.onLoadEnd();
}
};
onLoadedData = () => {
if (this.shouldInitVideoTime) {
this.videoElement.currentTime = this.props.startTime;
this.shouldInitVideoTime = false;
}
};
loadSource(source = this.props.source) {
if (this.videoElement) {
this.player.loadSource(source);
@ -112,6 +115,7 @@ export default class HLS extends Component {
onPlaying={this.props.onLoadEnd}
onSeeking={this.onSeeking}
onSeeked={this.onSeeked}
onLoadedData={this.onLoadedData}
/>
</div>
);