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

View File

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