diff options
author | Michael Foiani <sotech117@Michaels-MacBook-Pro-5.local> | 2022-06-23 12:36:45 -0400 |
---|---|---|
committer | Michael Foiani <sotech117@Michaels-MacBook-Pro-5.local> | 2022-06-23 12:36:45 -0400 |
commit | 0370192be9c6c723f198fbf28d2a63ceef0e70d4 (patch) | |
tree | a02ff6f2d8391a7e922e66c8a11dfc66f652bc7a | |
parent | 64200804a1e63981593c89abecedd4ae769da3b6 (diff) |
small bug fixes and debugging
-rw-r--r-- | src/client/util/ReplayMovements.ts | 9 | ||||
-rw-r--r-- | src/client/views/nodes/VideoBox.tsx | 6 |
2 files changed, 9 insertions, 6 deletions
diff --git a/src/client/util/ReplayMovements.ts b/src/client/util/ReplayMovements.ts index 6a5746c0b..86bc4c5de 100644 --- a/src/client/util/ReplayMovements.ts +++ b/src/client/util/ReplayMovements.ts @@ -122,8 +122,10 @@ export class ReplayMovements { console.error(`docIdtoDoc did not contain docId ${docId}`) return undefined; } + // console.log('openTab', docId, doc); CollectionDockingView.AddSplit(doc, 'right'); - const docView = DocumentManager.Instance.getDocumentViewById(docId); + const docView = DocumentManager.Instance.getDocumentView(doc); + // BUG - this returns undefined if the doc is already open return docView?.ComponentView as CollectionFreeFormView; } @@ -135,7 +137,7 @@ export class ReplayMovements { document.Document._panY = panY; } - getFirstMovements = (movements: Movement[], timeViewed: number): Map<string, Movement> => { + getFirstMovements = (movements: Movement[]): Map<string, Movement> => { if (movements === null) return new Map(); // generate a set of all unique docIds const docIdtoFirstMove = new Map(); @@ -172,7 +174,7 @@ export class ReplayMovements { if (isClosed) this.openTab(firstMovement.docId, docIdtoDoc); // for the open tabs, set it to the first move - const docIdtoFirstMove = this.getFirstMovements(filteredMovements, timeViewed); + const docIdtoFirstMove = this.getFirstMovements(filteredMovements); for (const [docId, firstMove] of docIdtoFirstMove) { const colFFView = this.getCollectionFFView(docId); if (colFFView) this.zoomAndPan(firstMove, colFFView); @@ -192,6 +194,7 @@ export class ReplayMovements { } else { // tab wasn't open - open it and play the movement const openedColFFView = this.openTab(movement.docId, docIdtoDoc); + console.log('openedColFFView', openedColFFView); openedColFFView && this.zoomAndPan(movement, openedColFFView); } diff --git a/src/client/views/nodes/VideoBox.tsx b/src/client/views/nodes/VideoBox.tsx index b18d3ad1a..680c5f2a9 100644 --- a/src/client/views/nodes/VideoBox.tsx +++ b/src/client/views/nodes/VideoBox.tsx @@ -132,7 +132,9 @@ export class VideoBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProp public get player(): HTMLVideoElement | null { return this._videoRef; } - componentDidMount() { + componentDidMount() { + this._playing = false; + this.props.setContentView?.(this); // this tells the DocumentView that this VideoBox is the "content" of the document. this allows the DocumentView to indirectly call getAnchor() on the VideoBox when making a link. if (this.youtubeVideoId) { const youtubeaspect = 400 / 315; @@ -150,8 +152,6 @@ export class VideoBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProp if (this.presentation != null) { ReplayMovements.Instance.setVideoBox(this); } - - this._playing = false; } componentWillUnmount() { |