Created
February 2, 2019 01:07
-
-
Save perry14/2ba681778d53056b26bd1e2c815ff427 to your computer and use it in GitHub Desktop.
Check if the user has a carema and a microphone.
This file contains hidden or 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 lang="en" xmlns="http://www.w3.org/1999/xhtml"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Check if the user has a carema and a microphone.</title> | |
| <script> | |
| window.onload = function () { | |
| navigator.getMedia = ( navigator.getUserMedia || // use the proper vendor prefix | |
| navigator.webkitGetUserMedia || | |
| navigator.mozGetUserMedia || | |
| navigator.msGetUserMedia); | |
| navigator.getMedia({audio: true, video: true}, function() { | |
| // webcam is available | |
| alert("webcam and microphone are available"); | |
| }, function() { | |
| // webcam is not available | |
| alert("webcam and microphone are not available"); | |
| }); | |
| } | |
| </script> | |
| </head> | |
| <body> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment