| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>MediaStream Recoder Browser Test (w/ MediaSource)</title> | 4 <title>MediaStream Recoder Browser Test (w/ MediaSource)</title> |
| 5 </head> | 5 </head> |
| 6 <body> | 6 <body> |
| 7 <div> Record Real-Time video content browser test.</div> | 7 <div> Record Real-Time video content browser test.</div> |
| 8 <video id="video" autoplay></video> | 8 <video id="video" autoplay></video> |
| 9 <video id="remoteVideo" autoplay></video> | 9 <video id="remoteVideo" autoplay></video> |
| 10 </body> | 10 </body> |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 .then(function(stream) { | 406 .then(function(stream) { |
| 407 return createMediaRecorder(stream, DEFAULT_RECORDER_MIME_TYPE); | 407 return createMediaRecorder(stream, DEFAULT_RECORDER_MIME_TYPE); |
| 408 }) | 408 }) |
| 409 .then(function(recorder) { | 409 .then(function(recorder) { |
| 410 assertThrows(function() {recorder.pause()}, 'Calling pause() in' + | 410 assertThrows(function() {recorder.pause()}, 'Calling pause() in' + |
| 411 ' inactive state should cause a DOM error'); | 411 ' inactive state should cause a DOM error'); |
| 412 }); | 412 }); |
| 413 } | 413 } |
| 414 | 414 |
| 415 // Tests that a remote peer connection stream can be successfully recorded. | 415 // Tests that a remote peer connection stream can be successfully recorded. |
| 416 function testRecordRemotePeerConnection() { | 416 function testRecordRemotePeerConnection(codec) { |
| 417 var videoSize = 0; | 417 var videoSize = 0; |
| 418 var timeStamps = []; | 418 var timeStamps = []; |
| 419 const mimeType = codec ? "video/webm;codecs=" + String(codec) : ""; |
| 419 navigator.mediaDevices.getUserMedia(DEFAULT_CONSTRAINTS) | 420 navigator.mediaDevices.getUserMedia(DEFAULT_CONSTRAINTS) |
| 420 .then(function(localStream) { | 421 .then(function(localStream) { |
| 421 return setupPeerConnection(localStream); | 422 return setupPeerConnection(localStream); |
| 422 }) | 423 }) |
| 423 .then(function(remoteStream) { | 424 .then(function(remoteStream) { |
| 424 return createMediaRecorder(remoteStream, DEFAULT_RECORDER_MIME_TYPE); | 425 return createMediaRecorder(remoteStream, mimeType); |
| 425 }) | 426 }) |
| 426 .then(function(recorder) { | 427 .then(function(recorder) { |
| 427 recorder.ondataavailable = function(event) { | 428 recorder.ondataavailable = function(event) { |
| 428 timeStamps.push(event.timeStamp); | 429 timeStamps.push(event.timeStamp); |
| 429 videoSize += event.data.size; | 430 videoSize += event.data.size; |
| 430 }; | 431 }; |
| 431 recorder.start(); | 432 recorder.start(); |
| 432 }) | 433 }) |
| 433 .then(function() { | 434 .then(function() { |
| 434 return waitFor('Making sure the recording has data', | 435 return waitFor('Making sure the recording has data', |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 return failTest(err.toString()); | 592 return failTest(err.toString()); |
| 592 }) | 593 }) |
| 593 .then(function() { | 594 .then(function() { |
| 594 reportTestSuccess(); | 595 reportTestSuccess(); |
| 595 }); | 596 }); |
| 596 } | 597 } |
| 597 | 598 |
| 598 </script> | 599 </script> |
| 599 </body> | 600 </body> |
| 600 </html> | 601 </html> |
| OLD | NEW |