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 { video {
display: block; display: block;
flex-grow: 1; flex-grow: 1;
width: 100%;
/* Black borders around video */ /* Black borders around video */
background-color: #000; background-color: #000;

View File

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