зеркало из https://github.com/mozilla/gecko-dev.git
46 строки
1.5 KiB
HTML
46 строки
1.5 KiB
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<!--
|
|
https://bugzilla.mozilla.org/show_bug.cgi?id=781534
|
|
-->
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>mozGetUserMedia Basic Video & Audio Test</title>
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
|
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
<script type="application/javascript" src="head.js"></script>
|
|
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
|
|
</head>
|
|
<body>
|
|
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=781534">mozGetUserMedia Basic Video & Audio Test</a>
|
|
<p id="display"></p>
|
|
<div id="content" style="display: none">
|
|
<video id="testVideoAudio"></video>
|
|
</div>
|
|
<pre id="test">
|
|
<script type="application/javascript">
|
|
/**
|
|
* Run a test to verify that we can complete a start and stop media playback
|
|
* cycle for a video and audio LocalMediaStream on a video HTMLMediaElement.
|
|
*/
|
|
runTest(function () {
|
|
var testVideoAudio = document.getElementById('testVideoAudio');
|
|
var constraints = {video: true, audio: true};
|
|
|
|
getUserMedia(constraints, function (aStream) {
|
|
checkMediaStreamTracks(constraints, aStream);
|
|
|
|
var playback = new LocalMediaStreamPlayback(testVideoAudio, aStream);
|
|
playback.playMedia(false, function () {
|
|
aStream.stop();
|
|
SimpleTest.finish();
|
|
}, unexpectedCallbackAndFinish());
|
|
|
|
}, unexpectedCallbackAndFinish());
|
|
});
|
|
|
|
</script>
|
|
</pre>
|
|
</body>
|
|
</html>
|