From 72631204e8ed6cfa230fd623eb02d5217efe3b04 Mon Sep 17 00:00:00 2001 From: bobzel Date: Sun, 21 Mar 2021 02:02:57 -0400 Subject: made it possible to capture screen recordings as videos. --- src/client/views/nodes/ScreenshotBox.tsx | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/client') diff --git a/src/client/views/nodes/ScreenshotBox.tsx b/src/client/views/nodes/ScreenshotBox.tsx index 94d00f429..0a62a8de1 100644 --- a/src/client/views/nodes/ScreenshotBox.tsx +++ b/src/client/views/nodes/ScreenshotBox.tsx @@ -153,22 +153,21 @@ export class ScreenshotBox extends ViewBoxBaseComponent this._chunks.push(e.data); this._recorder.onstop = async (e: any) => { - const file = new File([this._chunks], `${this.rootDoc[Id]}.mkv`, { type: this._chunks[0].type, lastModified: Date.now() }); - const [{ result }] = await Networking.UploadFilesToServer(file); + const file = new File(this._chunks, `${this.rootDoc[Id]}.mkv`, { type: this._chunks[0].type, lastModified: Date.now() }); + const completeBlob = new Blob(this._chunks, { type: this._chunks[0].type }); + (completeBlob as any).lastModifiedDate = new Date(); + (completeBlob as any).name = `${this.rootDoc[Id]}.mkv`; + const [{ result }] = await Networking.UploadFilesToServer(file);//completeBlob as File); if (!(result instanceof Error)) { this.dataDoc.type = DocumentType.VID; this.layoutDoc.layout = VideoBox.LayoutString(this.fieldKey); - this.props.Document[this.props.fieldKey] = new VideoField(Utils.prepend(result.accessPaths.agnostic.client)); + this.dataDoc[this.props.fieldKey] = new VideoField(Utils.prepend(result.accessPaths.agnostic.client)); console.log(this.props.Document[this.props.fieldKey]); - } else alert("video conversion failed") + } else alert("video conversion failed"); }; this._recorder.start(); } else { -- cgit v1.2.3-70-g09d2