Created
July 20, 2018 16:19
-
-
Save modeverv/701c90bf07c0d4b2f12491575a7fe6ec to your computer and use it in GitHub Desktop.
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 lang="en"> | |
<head> | |
<title></title> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
</head> | |
<body> | |
<h1>home</h1> | |
<audio id="player" controls></audio> | |
<script> | |
var player = document.getElementById('player'); | |
var handleSuccess = function (stream) { | |
if (window.URL) { | |
player.src = window.URL.createObjectURL(stream); | |
} else { | |
player.src = stream; | |
} | |
}; | |
navigator.mediaDevices.getUserMedia({ | |
audio: true, | |
video: false | |
}).then(handleSuccess) | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment