public onTimestampUpdated()

in tutorials/viewer/src/tutorial_view.tsx [110:125]


    public onTimestampUpdated(timestamp: number, isUserInitiated: boolean) {
        let index = this.getCaptionAtTimestamp(timestamp);
        if (index != this.state.currentCaptionIndex) {
            if (!this.videoView.state.autoplay && !isUserInitiated && this.state.currentCaptionIndex != null) {
                this.videoView.pause();
            } else {
                this.setState({
                    currentCaptionIndex: index,
                    keepCurrentInView: true
                });
            }
        }
        if (this.state.keepCurrentInView && index != null) {
            this.scrollItemIntoView(index);
        }
    }