<!DOCTYPEhtml>
<html>
<head><meta charset="UTF-8"></head>
<body>
<div id="message"></div>
<button id="gum">getUserMedia</button>
<script>
// Specifies whether we are using fake streams to run this automation var useFakeStreams = true;
try { var audioDevice = SpecialPowers.getCharPref("media.audio_loopback_dev"); var videoDevice = SpecialPowers.getCharPref("media.video_loopback_dev");
dump("TEST DEVICES: Using media devices:\n");
dump("audio: " + audioDevice + "\nvideo: " + videoDevice + "\n");
useFakeStreams = false;
} catch (e) {
dump("TEST DEVICES: No test devices found (in media.{audio,video}_loopback_dev, using fake streams.\n");
useFakeStreams = true;
}
function message(m) {
document.getElementById("message").innerHTML += `${m}<br>`;
top.postMessage(m, "*");
}
var gStreams = []; var gVideoEvents = []; var gAudioEvents = [];
/**
* Queue a getUserMedia request to be triggered by abutton click.
* The button click needs to be handled by the caller.
*
* @param {boolean} aAudio - Whether to request audio.
* @param {boolean} aVideo - Whether to request video.
* @param {number} aShare - The type of screen sharing.
* @param {boolean} aBadDevice - Whether to use a bad device ID.
* @param {boolean} withUserActivation - Whether to simulate user activation.
* @returns {Promise} - Resolves when the requestDevice call completes.
*/
function queueRequestDeviceViaBtn(aAudio, aVideo, aShare, aBadDevice = false) {
return new Promise((resolve) => {
let button = document.getElementById("gum"); button.addEventListener("click", () => { button.innerText = "getUserMedia";
requestDevice(aAudio, aVideo, aShare, aBadDevice).then(resolve);
}, {once: true}); button.innerText =
`getUserMedia(${aAudio}, ${aVideo}, ${aShare}, ${aBadDevice})`;
});
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.