tezvyn:

Use MediaRecorder to capture a canvas stream and download as WebM

Source: developer.mozilla.orgintermediate

Tests MediaRecorder lifecycle and blob assembly. Answer: canvas.captureStream() into new MediaRecorder with video/webm, start(), collect chunks via dataavailable, stop(), then build a Blob and object URL for download.

This tests your understanding of the MediaStream Recording API lifecycle and client-side blob generation. A strong answer covers four steps: first, call canvas.captureStream() to get a MediaStream; second, instantiate MediaRecorder with mimeType video/webm and check isTypeSupported(); third, buffer event.data chunks from dataavailable and call start(); fourth, after stop(), concatenate chunks into a Blob and trigger a download via an object URL.

Read the original → developer.mozilla.org

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.

Use MediaRecorder to capture a canvas stream and download as WebM · Tezvyn