Fix player width

This commit is contained in:
Alexandre Iooss 2020-10-18 19:14:49 +02:00
parent e1a0897cc4
commit 55245208b4
No known key found for this signature in database
GPG Key ID: 6C79278F3FCDCC02
2 changed files with 4 additions and 11 deletions

View File

@ -2,6 +2,7 @@
video {
display: block;
flex-grow: 1;
width: 100%;
/* Black borders around video */
background-color: #000;

View File

@ -76,7 +76,7 @@ startPeerConnection = () => {
// Register keyboard events
let viewer = document.getElementById("viewer")
window.onkeydown = (event) => {
window.addEventListener("keydown", (event) => {
switch (event.key) {
case 'f':
// F key put player in fullscreen
@ -90,16 +90,8 @@ window.onkeydown = (event) => {
case ' ':
// M and space key mute player
viewer.muted = !viewer.muted
event.preventDefault()
viewer.play()
break
}
}
// On click, mute and demute
viewer.addEventListener("play", (event) => {
event.preventDefault()
viewer.muted = !viewer.muted
})
viewer.addEventListener("pause", (event) => {
event.preventDefault()
viewer.muted = !viewer.muted
})