aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionVideoView.tsx
diff options
context:
space:
mode:
authormonikahedman <monika_hedman@brown.edu>2019-07-16 14:47:24 -0400
committermonikahedman <monika_hedman@brown.edu>2019-07-16 14:47:24 -0400
commitb49f13d72033ab74bfecea00889fa81c85bfd533 (patch)
tree286cbfde9864c9a46f9501cd2975fb854a0d6f13 /src/client/views/collections/CollectionVideoView.tsx
parent189bb0ffd14fb0b8db0edbe813efe19f143a30fd (diff)
parent98c3a06256d2cbd720b2c193e5aa282c5dc25350 (diff)
Merge branch 'search_virt' of https://github.com/browngraphicslab/Dash-Web into search_virt
Diffstat (limited to 'src/client/views/collections/CollectionVideoView.tsx')
-rw-r--r--src/client/views/collections/CollectionVideoView.tsx4
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..096e7e9d1 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, {