removed fullscreen, fixed pause video button not update on swap

This commit is contained in:
Ian Ramzy 2020-04-03 21:02:44 -04:00
parent f62100cd0d
commit 42f26b1fc0
2 changed files with 53 additions and 50 deletions

View File

@ -44,7 +44,7 @@
</div>
<p id="remote-video-text"></p>
<video id="remote-video" autoplay ondblclick="{openFullscreen()}"></video>
<video id="remote-video" autoplay></video>
<div id="moveable">
<p id="local-video-text">No webcam input</p>
<video id="local-video" autoplay muted></video>
@ -67,12 +67,12 @@
<div class="HoverState" id="mic-text">Mute</div>
</div>
<div class="buttonContainer">
<button class="hoverButton" onclick="{openFullscreen()}">
<i class="fas fa-compress fa-xs"></i>
</button>
<div class="HoverState">Fullscreen</div>
</div>
<!-- <div class="buttonContainer">-->
<!-- <button class="hoverButton" onclick="{openFullscreen()}">-->
<!-- <i class="fas fa-compress fa-xs"></i>-->
<!-- </button>-->
<!-- <div class="HoverState">Fullscreen</div>-->
<!-- </div>-->
<div class="buttonContainer">
<button class="hoverButton" onclick="{pauseVideo()}">

View File

@ -6,7 +6,7 @@ const browserName = getBrowserName();
const url = window.location.href;
const roomHash = url.substring(url.lastIndexOf("/") + 1).toLowerCase();
var mode = "camera";
var isFullscreen = false;
// var isFullscreen = false;
var sendingCaptions = false;
var receivingCaptions = false;
const isWebRTCSupported =
@ -373,48 +373,48 @@ function windowResized() {
// Fullscreen
//
function openFullscreen() {
try {
// var elem = document.getElementById("remote-video");
var elem = document.getElementById("body");
if (!isFullscreen) {
VideoChat.remoteVideo.classList.add("fullscreen");
isFullscreen = true;
if (elem.requestFullscreen) {
elem.requestFullscreen();
} else if (elem.mozRequestFullScreen) {
/* Firefox */
elem.mozRequestFullScreen();
} else if (elem.webkitRequestFullscreen) {
/* Chrome, Safari and Opera */
elem.webkitRequestFullscreen();
setTimeout(windowResized, 1000);
} else if (elem.msRequestFullscreen) {
/* IE/Edge */
elem.msRequestFullscreen();
}
} else {
isFullscreen = false;
VideoChat.remoteVideo.classList.remove("fullscreen");
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.mozCancelFullScreen) {
/* Firefox */
document.mozCancelFullScreen();
} else if (document.webkitExitFullscreen) {
/* Chrome, Safari and Opera */
document.webkitExitFullscreen();
} else if (document.msExitFullscreen) {
/* IE/Edge */
document.msExitFullscreen();
}
}
} catch (e) {
logIt(e);
}
setTimeout(windowResized, 1000);
}
// function openFullscreen() {
// try {
// // var elem = document.getElementById("remote-video");
// var elem = document.getElementById("body");
// if (!isFullscreen) {
// VideoChat.remoteVideo.classList.add("fullscreen");
// isFullscreen = true;
// if (elem.requestFullscreen) {
// elem.requestFullscreen();
// } else if (elem.mozRequestFullScreen) {
// /* Firefox */
// elem.mozRequestFullScreen();
// } else if (elem.webkitRequestFullscreen) {
// /* Chrome, Safari and Opera */
//
// elem.webkitRequestFullscreen();
// setTimeout(windowResized, 1000);
// } else if (elem.msRequestFullscreen) {
// /* IE/Edge */
// elem.msRequestFullscreen();
// }
// } else {
// isFullscreen = false;
// VideoChat.remoteVideo.classList.remove("fullscreen");
// if (document.exitFullscreen) {
// document.exitFullscreen();
// } else if (document.mozCancelFullScreen) {
// /* Firefox */
// document.mozCancelFullScreen();
// } else if (document.webkitExitFullscreen) {
// /* Chrome, Safari and Opera */
// document.webkitExitFullscreen();
// } else if (document.msExitFullscreen) {
// /* IE/Edge */
// document.msExitFullscreen();
// }
// }
// } catch (e) {
// logIt(e);
// }
// setTimeout(windowResized, 1000);
// }
//
// End Fullscreen
@ -560,6 +560,9 @@ function switchStreamHelper(stream) {
}
VideoChat.localStream = videoTrack;
VideoChat.localVideo.srcObject = stream;
if (videoIsPaused) {
pauseVideo();
}
}
//