Skip to content

Commit faafe5c

Browse files
support for safari
added playsinline, removed unused stream var
1 parent 5e6e6e0 commit faafe5c

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ <h4>Click one of the buttons below to find camera resolutions:</h4>
5555
</div>
5656
</div>
5757
<div class="row" id="videoarea">
58-
<video id="video" autoplay></video>
58+
<video id="video" autoplay muted playsinline></video>
5959
</div>
6060
<div class="row">
6161
<p id="jump" hidden>Jump to <a href="#bottom">bottom</a> of table</p>

js/resolutionScan.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
let video = $('#video')[0], //where we will put & test our video output
1111
deviceList = $('#devices')[0], //device list dropdown
1212
devices = [], //getSources object to hold various camera options
13-
stream,
1413
selectedCamera = [], //used to hold a camera's ID and other parameters
1514
tests, //holder for our test results
1615
r = 0, //used for iterating through the array
@@ -156,7 +155,7 @@ function gum(candidate, device) {
156155
console.log("trying " + candidate.label + " on " + device.label);
157156

158157
//Kill any running streams;
159-
if (stream) {
158+
if (window.stream) {
160159
stream.getTracks().forEach((track) => {
161160
track.stop();
162161
});
@@ -182,7 +181,7 @@ function gum(candidate, device) {
182181
captureResults("fail: " + error.name);
183182
}
184183
});
185-
}, (stream ? 200 : 0)); //official examples had this at 200
184+
}, (window.stream ? 200 : 0)); //official examples had this at 200
186185

187186

188187
function gotStream(mediaStream) {

0 commit comments

Comments
 (0)