MediaRecorder-start.html (884B)
1 <!doctype html> 2 <html> 3 <head> 4 <title>MediaRecorder Start</title> 5 <link rel="help" href="https://w3c.github.io/mediacapture-record/MediaRecorder.html#dom-mediarecorder-start"> 6 <script src="/resources/testharness.js"></script> 7 <script src="/resources/testharnessreport.js"></script> 8 </head> 9 <body> 10 <canvas id="canvas" width="200" height="200"> 11 </canvas> 12 <script> 13 function createVideoStream() { 14 canvas.getContext('2d'); 15 return canvas.captureStream(); 16 } 17 18 test(t => { 19 const mimeType = [ 'audio/aac', 'audio/ogg', 'audio/webm', 'audio/mp4' ].find(MediaRecorder.isTypeSupported); 20 const mediaRecorder = new MediaRecorder(createVideoStream(), {mimeType}); 21 assert_throws_dom("NotSupportedError", () => mediaRecorder.start()); 22 }, "MediaRecorder cannot record the stream using the current configuration"); 23 </script> 24 </body> 25 </html>