Created
April 7, 2017 06:00
-
-
Save katapad/36080c64b5577472d9231f40bc0b9a10 to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/zozeda
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<div id="output"></div> | |
<script id="jsbin-javascript"> | |
"use strict"; | |
navigator.mediaDevices.enumerateDevices().then(function (cams) { | |
var labels = []; | |
cams.forEach(function (cam) { | |
if (cam.kind == 'videoinput') { | |
labels.push("<li>" + cam.label + "</li>"); | |
} | |
}); | |
document.getElementById("output").innerHTML = "<ul>" + labels.join("") + "</ul>"; | |
}); | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">navigator.mediaDevices.enumerateDevices().then((cams)=>{ | |
var labels = []; | |
cams.forEach((cam)=> { | |
if (cam.kind == 'videoinput') { | |
labels.push("<li>" + cam.label + "</li>"); | |
} | |
}); | |
document.getElementById("output").innerHTML = "<ul>" + labels.join("") + "</ul>" | |
});</script></body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
navigator.mediaDevices.enumerateDevices().then(function (cams) { | |
var labels = []; | |
cams.forEach(function (cam) { | |
if (cam.kind == 'videoinput') { | |
labels.push("<li>" + cam.label + "</li>"); | |
} | |
}); | |
document.getElementById("output").innerHTML = "<ul>" + labels.join("") + "</ul>"; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment