diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2020-05-18 20:53:45 -0400 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2020-05-18 20:53:45 -0400 |
commit | 3f97c632bc13075a4c13a6485d2e53e6694b36fa (patch) | |
tree | 0134230c9c444bd9487994f62cf7ccd0a34971e9 /src | |
parent | aeabc1810131a249ed8bab933ee19837691bf56b (diff) | |
parent | d2d01e3c827e53977bac8f9ceeef69eda31cfa4f (diff) |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/nodes/VideoBox.tsx | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/client/views/nodes/VideoBox.tsx b/src/client/views/nodes/VideoBox.tsx index 6ec48ca89..a3abaedfa 100644 --- a/src/client/views/nodes/VideoBox.tsx +++ b/src/client/views/nodes/VideoBox.tsx @@ -123,15 +123,22 @@ export class VideoBox extends ViewBoxAnnotatableComponent<FieldViewProps, VideoD id: this.youtubeVideoId, timecode: this.layoutDoc.currentTimecode }).then(response => { - this.props.removeDocument?.(b); - this.createRealSummaryLink(response.accessPaths.agnostic.client); + const resolved = response?.accessPaths?.agnostic?.client; + if (resolved) { + this.props.removeDocument?.(b); + this.createRealSummaryLink(resolved); + } }); } else { //convert to desired file format const dataUrl = canvas.toDataURL('image/png'); // can also use 'image/png' // if you want to preview the captured image, const filename = path.basename(encodeURIComponent("snapshot" + StrCast(this.rootDoc.title).replace(/\..*$/, "") + "_" + (this.layoutDoc.currentTimecode || 0).toString().replace(/\./, "_"))); - VideoBox.convertDataUri(dataUrl, filename).then(this.createRealSummaryLink); + VideoBox.convertDataUri(dataUrl, filename).then((returnedFilename: string) => { + if (returnedFilename) { + this.createRealSummaryLink(returnedFilename); + } + }); } } |