diff options
| author | Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> | 2024-10-03 02:47:23 -0400 |
|---|---|---|
| committer | Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> | 2024-10-03 02:47:23 -0400 |
| commit | b21d8cc9d1b25ccd2e0103f47ad132dd6f04612d (patch) | |
| tree | de6de9f556dd647f132a1f707a93c77a38946f1c /src/client/views/nodes/VideoBox.tsx | |
| parent | b013de245c77e40487e9842650239eff20c0e361 (diff) | |
| parent | 7af6d22556467c115809222db77d4056b42f390f (diff) | |
Merge branch 'nathan-starter' of https://github.com/brown-dash/Dash-Web into nathan-starter
Diffstat (limited to 'src/client/views/nodes/VideoBox.tsx')
| -rw-r--r-- | src/client/views/nodes/VideoBox.tsx | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/client/views/nodes/VideoBox.tsx b/src/client/views/nodes/VideoBox.tsx index 4933869a7..d653b27d7 100644 --- a/src/client/views/nodes/VideoBox.tsx +++ b/src/client/views/nodes/VideoBox.tsx @@ -298,18 +298,19 @@ export class VideoBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { const retitled = StrCast(this.Document.title).replace(/[ -.:]/g, ''); const encodedFilename = encodeURIComponent(('snapshot' + retitled + '_' + (this.layoutDoc._layout_currentTimecode || 0).toString()).replace(/[./?=]/g, '_')); const filename = basename(encodedFilename); - ClientUtils.convertDataUri(dataUrl, filename).then((returnedFilename: string) => returnedFilename && (cb ?? this.createSnapshotLink)(returnedFilename, downX, downY)); + return ClientUtils.convertDataUri(dataUrl, filename).then((returnedFilename: string) => { + if (returnedFilename) (cb ?? this.createSnapshotLink)(returnedFilename, downX, downY); + }); } + return new Promise<void>(res => res()); }; - updateIcon = () => { - const makeIcon = (returnedfilename: string) => { + updateIcon = () => + this.Snapshot(undefined, undefined, (returnedfilename: string) => { this.dataDoc.icon = new ImageField(returnedfilename); this.dataDoc.icon_nativeWidth = NumCast(this.layoutDoc._width); this.dataDoc.icon_nativeHeight = NumCast(this.layoutDoc._height); - }; - this.Snapshot(undefined, undefined, makeIcon); - }; + }); // creates link for snapshot createSnapshotLink = (imagePath: string, downX?: number, downY?: number) => { @@ -459,7 +460,7 @@ export class VideoBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { const url = field.url.href; const subitems: ContextMenuProps[] = []; subitems.push({ description: 'Full Screen', event: this.FullScreen, icon: 'expand' }); - subitems.push({ description: 'Take Snapshot', event: this.Snapshot, icon: 'expand-arrows-alt' }); + subitems.push({ description: 'Take Snapshot', event: () => this.Snapshot(), icon: 'expand-arrows-alt' }); this.Document.type === DocumentType.SCREENSHOT && subitems.push({ description: 'Screen Capture', |
