diff options
Diffstat (limited to 'src/client/views/nodes/RecordingBox/RecordingView.tsx')
-rw-r--r-- | src/client/views/nodes/RecordingBox/RecordingView.tsx | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/client/views/nodes/RecordingBox/RecordingView.tsx b/src/client/views/nodes/RecordingBox/RecordingView.tsx index 16f750e14..6aed07c60 100644 --- a/src/client/views/nodes/RecordingBox/RecordingView.tsx +++ b/src/client/views/nodes/RecordingBox/RecordingView.tsx @@ -22,6 +22,7 @@ interface MediaSegment { interface IRecordingViewProps { setResult: (info: Upload.FileInformation) => void + setDuration: (seconds: number) => void } const MAXTIME = 1000; @@ -47,12 +48,12 @@ export function RecordingView(props: IRecordingViewProps) { const DEFAULT_MEDIA_CONSTRAINTS = { - video: true, + // video: true, // audio: true - // video: { - // width: 1280, - // height: 720, - // }, + video: { + width: 1280, + height: 720, + }, // audio: true, // audio: { // echoCancellation: true, @@ -64,6 +65,7 @@ export function RecordingView(props: IRecordingViewProps) { useEffect(() => { if (finished) { + props.setDuration(recordingTimer * 100) let allVideoChunks: any = [] console.log(videos) videos.forEach((vid) => { @@ -72,16 +74,7 @@ export function RecordingView(props: IRecordingViewProps) { }) console.log(allVideoChunks) - - const blob = new Blob(allVideoChunks, { - type: 'video/webm' - }) - const blobUrl = URL.createObjectURL(blob) - const videoFile = new File(allVideoChunks, "video", { type: allVideoChunks[0].type, lastModified: Date.now() }); - - videoElementRef.current!.srcObject = null - videoElementRef.current!.src = blobUrl - videoElementRef.current!.muted = false + const videoFile = new File(allVideoChunks, "video.mkv", { type: allVideoChunks[0].type, lastModified: Date.now() }); // const uploadVideo = async () => { // const [{ result }] = await Networking.UploadFilesToServer(videoFile); |