screen share btn waits to update, remove outline, fade out logo

This commit is contained in:
ian ramzy 2020-03-28 13:43:08 -04:00
parent 57ffef0c51
commit e783f9e488
2 changed files with 16 additions and 10 deletions

View File

@ -164,6 +164,10 @@ button {
padding: 10px; padding: 10px;
} }
button:focus {
outline: none;
}
button:hover { button:hover {
color: white; color: white;
border-radius: 100px; border-radius: 100px;

View File

@ -63,7 +63,7 @@ var VideoChat = {
}).then(stream => { }).then(stream => {
VideoChat.onMediaStream(stream); VideoChat.onMediaStream(stream);
$('#local-video-text').text("Drag Me"); $('#local-video-text').text("Drag Me");
setTimeout(() => $('#local-video-text').hide(), 5000); setTimeout(() => $('#local-video-text').fadeOut(), 5000);
}).catch(error => { }).catch(error => {
logIt(error); logIt(error);
logIt('Failed to get local webcam video, check webcam privacy settings'); logIt('Failed to get local webcam video, check webcam privacy settings');
@ -341,12 +341,13 @@ function pauseVideo() {
} }
//Show and hide buttons automatically // Fade out / show UI on mouse move
var timedelay = 1; var timedelay = 1;
function delayCheck() { function delayCheck() {
if (timedelay === 5) { if (timedelay === 5) {
$('.multi-button').fadeOut(); $('.multi-button').fadeOut();
$('#header').fadeOut();
timedelay = 1; timedelay = 1;
} }
timedelay = timedelay + 1; timedelay = timedelay + 1;
@ -354,6 +355,7 @@ function delayCheck() {
$(document).mousemove(function () { $(document).mousemove(function () {
$('.multi-button').fadeIn(); $('.multi-button').fadeIn();
$('#header').fadeIn();
timedelay = 1; timedelay = 1;
clearInterval(_delay); clearInterval(_delay);
_delay = setInterval(delayCheck, 500); _delay = setInterval(delayCheck, 500);
@ -399,25 +401,25 @@ function swap() {
const swapIcon = document.getElementById("swap-icon"); const swapIcon = document.getElementById("swap-icon");
const swapText = document.getElementById("swap-text"); const swapText = document.getElementById("swap-text");
if (mode === "camera") { if (mode === "camera") {
mode = "screen";
swapIcon.classList.remove("fa-desktop");
swapIcon.classList.add("fa-camera");
swapText.innerText = "Share Webcam";
navigator.mediaDevices.getDisplayMedia({ navigator.mediaDevices.getDisplayMedia({
video: true, video: true,
audio: true audio: true
}).then(function (stream) { }).then(function (stream) {
mode = "screen";
swapIcon.classList.remove("fa-desktop");
swapIcon.classList.add("fa-camera");
swapText.innerText = "Share Webcam";
switchStreamHelper(stream); switchStreamHelper(stream);
}); });
} else { } else {
mode = "camera";
swapIcon.classList.remove("fa-camera");
swapIcon.classList.add("fa-desktop");
swapText.innerText = "Share Screen";
navigator.mediaDevices.getUserMedia({ navigator.mediaDevices.getUserMedia({
video: true, video: true,
audio: true audio: true
}).then(function (stream) { }).then(function (stream) {
mode = "camera";
swapIcon.classList.remove("fa-camera");
swapIcon.classList.add("fa-desktop");
swapText.innerText = "Share Screen";
switchStreamHelper(stream); switchStreamHelper(stream);
}); });
} }