[call-me] - add toggleFullScreen

This commit is contained in:
Miroslav Pejic
2024-09-28 20:54:57 +02:00
parent c73da91174
commit 94f9c8812b
3 changed files with 18 additions and 1 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "call-me",
"version": "1.0.15",
"version": "1.0.16",
"description": "Your Go-To for Instant Video Calls",
"author": "Miroslav Pejic - miroslav.pejic.85@gmail.com",
"license": "AGPLv3",
+8
View File
@@ -158,6 +158,8 @@ signInBtn.addEventListener('click', handleSignInClick);
callBtn.addEventListener('click', handleCallClick);
hideBtn.addEventListener('click', toggleLocalVideo);
hangUpBtn.addEventListener('click', handleHangUpClick);
localVideoContainer.addEventListener('click', toggleFullScreen);
remoteVideo.addEventListener('click', toggleFullScreen);
// Handle sign-in button click
function handleSignInClick() {
@@ -204,6 +206,12 @@ function handleHangUpClick() {
handleLeave();
}
// Toggle video full screen mode
function toggleFullScreen(e) {
if (!e.target.srcObject) return;
document.fullscreenElement ? document.exitFullscreen() : e.target.requestFullscreen?.();
}
// Handle ping message from the server
function handlePing(data) {
const { iceServers } = data;
+9
View File
@@ -80,10 +80,18 @@ video {
border: none;
border-radius: var(--border-radius);
object-fit: contain;
cursor: pointer;
}
video:hover {
filter: contrast(105%);
}
video::-webkit-media-controls {
display: none !important;
}
/* Local Video Styles */
#localVideoContainer {
z-index: 1;
position: absolute;
top: 10px;
left: 20px;
@@ -105,6 +113,7 @@ video {
/* Remote Video Styles */
#remoteVideo {
z-index: 2;
width: 100%;
height: auto;
background: rgba(0, 0, 0, 0.5);