Fixed error in live_example; Working for iOS in Safari 11 beta

This commit is contained in:
Christoph Oberhofer
2017-06-07 20:52:40 +02:00
parent 74ed8c0b60
commit e8352c7017
6 changed files with 20 additions and 8 deletions
+3 -1
View File
@@ -42,7 +42,9 @@ function initCamera(video, constraints) {
.then((stream) => {
return new Promise((resolve) => {
streamRef = stream;
video.setAttribute("autoplay", 'true');
video.setAttribute("autoplay", true);
video.setAttribute('muted', true);
video.setAttribute('playsinline', true);
video.srcObject = stream;
video.addEventListener('loadedmetadata', () => {
video.play();