Merge pull request #33 from beatriceo/contacts-video

asdf
This commit is contained in:
Beatrice Olivera 2018-08-31 15:49:51 +01:00 committed by GitHub
commit 8cc007e315
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 2 deletions

View File

@ -73,7 +73,7 @@ a:hover {
.video-content { .video-content {
height: 485px; height: 485px;
background-color: black; // background-color: black;
} }
.half { .half {

View File

@ -0,0 +1,14 @@
const contactsVideo = document.getElementById("contacts-video")
try {
const contactsStream = navigator.mediaDevices.getUserMedia({
audio: false,
video: true
}).then(stream => {
contactsVideo.srcObject = stream;
contactsVideo.muted = true;
})
} catch(e) {
console.error(e);
contactsVideo.innerHTML = "Unable to getUserMedia()";
}

View File

@ -15,7 +15,7 @@
</div> </div>
<div class="video-feed half"> <div class="video-feed half">
<div class="video-content"> <div class="video-content">
<!-- <video id="contacts-video" autoplay=""></video> --> <video id="contacts-video" autoplay=""></video>
</div> </div>
</div> </div>
</div> </div>
@ -29,5 +29,6 @@
</form> </form>
<%= javascript_pack_tag 'notifications' %> <%= javascript_pack_tag 'notifications' %>
<%= javascript_pack_tag 'local_video' %>