Revision 7208979a308347c4379e0669b83de1a013176a2b authored by Yutaka Hirano on 24 April 2018, 07:30:37 UTC, committed by Yutaka Hirano on 24 April 2018, 07:30:37 UTC
1 parent 5acf250
MediaStreamTrack-getSettings.https.html
<!doctype html>
<title>MediaStreamTrack GetSettings</title>
<p class="instructions">When prompted, accept to share your video stream.</p>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script>
'use strict'
// https://w3c.github.io/mediacapture-main/archives/20170605/getusermedia.html
promise_test(t => {
const constraints = {
video: true,
audio: false
};
return navigator.mediaDevices.getUserMedia(constraints)
.then(mediaStream => {
const settings1 = mediaStream.getVideoTracks()[0].getSettings();
const videoConstraints = {
deviceId: settings1.deviceId
};
return navigator.mediaDevices.getUserMedia({
video: videoConstraints,
audio: false
}).then(mediaStream => {
const settings2 = mediaStream.getVideoTracks()[0].getSettings();
assert_equals(settings1.deviceId, settings2.deviceId);
});
});
}, 'A device can be opened twice and have the same device ID');
promise_test(t => {
const constraints = {
video: true,
audio: false
};
return navigator.mediaDevices.getUserMedia(constraints)
.then(mediaStream => {
const settings1 = mediaStream.getVideoTracks()[0].getSettings();
const videoConstraints = {
deviceId: settings1.deviceId,
width: {
exact: settings1.width / 2
}
};
return navigator.mediaDevices.getUserMedia({
video: videoConstraints,
audio: false
}).then(mediaStream => {
const settings2 = mediaStream.getVideoTracks()[0].getSettings();
assert_equals(settings1.deviceId, settings2.deviceId);
assert_equals(settings1.width / 2, settings2.width);
});
});
}, 'A device can be opened twice with different resolutions');
</script>
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...