diff options
| author | bob <bcz@cs.brown.edu> | 2019-07-16 11:58:35 -0400 |
|---|---|---|
| committer | bob <bcz@cs.brown.edu> | 2019-07-16 11:58:35 -0400 |
| commit | f59e4c19bb759c9179157744bbcb46ff578351d1 (patch) | |
| tree | 02cb9c86c59e14a8b57d0241685ab2be6bb1d984 /src/client/views/collections/CollectionVideoView.tsx | |
| parent | f36afcf2b00da1df5aa39deff5d9e931a823605c (diff) | |
| parent | bbfc935958b88c7ecaeb9a1e06a255cac958ec4c (diff) | |
Merge branch 'youtubebites'
Diffstat (limited to 'src/client/views/collections/CollectionVideoView.tsx')
| -rw-r--r-- | src/client/views/collections/CollectionVideoView.tsx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client/views/collections/CollectionVideoView.tsx b/src/client/views/collections/CollectionVideoView.tsx index f731c4cef..faf507496 100644 --- a/src/client/views/collections/CollectionVideoView.tsx +++ b/src/client/views/collections/CollectionVideoView.tsx @@ -88,14 +88,14 @@ export class CollectionVideoView extends React.Component<FieldViewProps> { canvas.width = 640; canvas.height = 640 * NumCast(this.props.Document.nativeHeight) / NumCast(this.props.Document.nativeWidth); var ctx = canvas.getContext('2d');//draw image to canvas. scale to target dimensions - ctx && ctx.drawImage(this._videoBox!.player!, 0, 0, canvas.width, canvas.height); + this._videoBox!.player && ctx && ctx.drawImage(this._videoBox!.player!, 0, 0, canvas.width, canvas.height); //convert to desired file format var dataUrl = canvas.toDataURL('image/png'); // can also use 'image/png' // if you want to preview the captured image, let filename = encodeURIComponent("snapshot" + this.props.Document.title + "_" + this.props.Document.curPage).replace(/\./g, ""); - SearchBox.convertDataUri(dataUrl, filename).then((returnedFilename) => { + SearchBox.convertDataUri(dataUrl, filename).then(returnedFilename => { if (returnedFilename) { let url = DocServer.prepend(returnedFilename); let imageSummary = Docs.Create.ImageDocument(url, { |
