From 57cf1f2417858c203e1018d08e1626b1094ae68d Mon Sep 17 00:00:00 2001 From: Michael Foiani Date: Tue, 14 Jun 2022 21:47:41 -0400 Subject: change to using mobx to see when videoBox is paused or played --- src/client/views/nodes/VideoBox.tsx | 49 +++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 21 deletions(-) (limited to 'src/client/views/nodes/VideoBox.tsx') diff --git a/src/client/views/nodes/VideoBox.tsx b/src/client/views/nodes/VideoBox.tsx index cf3282d2f..ed9bcf29b 100644 --- a/src/client/views/nodes/VideoBox.tsx +++ b/src/client/views/nodes/VideoBox.tsx @@ -144,13 +144,23 @@ export class VideoBox extends ViewBoxAnnotatableComponent this._disposers[d]?.()); + this.removeCurrentlyPlaying(); + this.Pause(); + Object.keys(this._disposers).forEach(d => this._disposers[d]?.()); + + // dispose the recordingApi's observer + if (this.presentation != null) { + RecordingApi.Instance.removeVideoBox(); + } } @@ -162,13 +172,13 @@ export class VideoBox extends ViewBoxAnnotatableComponent { - if (this.presentation) { - console.log('VideoBox : Pause'); - const err = RecordingApi.Instance.pauseMovements(); - err && console.log(err); - } + // if (this.presentation) { + // console.log('VideoBox : Pause'); + // const err = RecordingApi.Instance.pauseMovements(); + // err && console.log(err); + // } this._playing = false; this.removeCurrentlyPlaying(); @@ -437,12 +447,9 @@ export class VideoBox extends ViewBoxAnnotatableComponent { - // console.log("PLAY from CONTENT") - //this.Play() - }} + onPlay={() => this.Play()} onSeeked={this.updateTimecode} - // onPause={() => this.Pause() } + onPause={() => this.Pause() } onClick={e => e.preventDefault()}> Not supported. -- cgit v1.2.3-70-g09d2