[mirotalksfu] - improve init UI

هذا الالتزام موجود في:
Miroslav Pejic
2023-12-25 21:48:18 +01:00
الأصل 682effcf97
التزام c29b3bc8ea
7 ملفات معدلة مع 61 إضافات و41 حذوفات

عرض الملف

@@ -40,7 +40,7 @@ dependencies: {
* @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon * @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970 * @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com * @author Miroslav Pejic - miroslav.pejic.85@gmail.com
* @version 1.3.47 * @version 1.3.48
* *
*/ */

عرض الملف

@@ -1,6 +1,6 @@
{ {
"name": "mirotalksfu", "name": "mirotalksfu",
"version": "1.3.47", "version": "1.3.48",
"description": "WebRTC SFU browser-based video calls", "description": "WebRTC SFU browser-based video calls",
"main": "Server.js", "main": "Server.js",
"scripts": { "scripts": {

عرض الملف

@@ -138,11 +138,41 @@ body {
# Init User # Init User
--------------------------------------------------------------*/ --------------------------------------------------------------*/
.init-modal-size {
width: 1024px !important;
height: auto !important;
}
.init-user { .init-user {
display: block; display: flex;
padding: 5px; padding: 5px;
} }
.init-video-container {
position: relative;
padding: 10px;
width: 100%;
}
.init-video-container video {
z-index: 0;
position: relative;
height: 240px;
}
.initComands {
width: 100%;
}
@media screen and (max-width: 1024px) {
.init-modal-size {
width: auto !important;
}
.init-user {
display: block;
}
}
.init-user select { .init-user select {
width: 100%; width: 100%;
margin-top: 15px; margin-top: 15px;
@@ -156,9 +186,13 @@ body {
} }
.init-user button { .init-user button {
width: 50px;
padding: 10px;
margin-top: 20px; margin-top: 20px;
margin-bottom: 10px; margin-bottom: 10px;
width: 50px; font-size: 1.2rem;
border: var(--border);
border-radius: 5px;
background-color: transparent; background-color: transparent;
} }
@@ -214,21 +248,6 @@ body {
color: red; color: red;
} }
/*--------------------------------------------------------------
# Init Audio/Video buttons
--------------------------------------------------------------*/
#initAudioButton,
#initVideoButton,
#initAudioVideoButton,
#initStartScreenButton,
#initStopScreenButton {
font-size: 1.2rem;
padding: 10px;
border: var(--border);
border-radius: 5px;
}
/*-------------------------------------------------------------- /*--------------------------------------------------------------
# Room QR # Room QR
--------------------------------------------------------------*/ --------------------------------------------------------------*/

عرض الملف

@@ -172,15 +172,6 @@
border-radius: '10px'; border-radius: '10px';
} }
.init-container {
position: relative;
}
.init-container video {
z-index: 0;
position: relative;
height: 240px;
}
video { video {
width: 100%; width: 100%;
height: 100%; height: 100%;

عرض الملف

@@ -11,7 +11,7 @@ if (location.href.substr(0, 5) !== 'https') location.href = 'https' + location.h
* @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon * @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970 * @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com * @author Miroslav Pejic - miroslav.pejic.85@gmail.com
* @version 1.3.47 * @version 1.3.48
* *
*/ */
@@ -735,6 +735,7 @@ async function whoAreYou() {
elemDisplay('initAudioVideoButton', false); elemDisplay('initAudioVideoButton', false);
elemDisplay('initVideoSelect', false); elemDisplay('initVideoSelect', false);
elemDisplay('tabVideoDevicesBtn', false); elemDisplay('tabVideoDevicesBtn', false);
initVideoContainerShow(false);
} }
if (!BUTTONS.main.startAudioButton) { if (!BUTTONS.main.startAudioButton) {
isAudioAllowed = false; isAudioAllowed = false;
@@ -761,6 +762,7 @@ async function whoAreYou() {
inputValue: default_name, inputValue: default_name,
html: initUser, // Inject HTML html: initUser, // Inject HTML
confirmButtonText: `Join meeting`, confirmButtonText: `Join meeting`,
customClass: { popup: 'init-modal-size' },
showClass: { popup: 'animate__animated animate__fadeInDown' }, showClass: { popup: 'animate__animated animate__fadeInDown' },
hideClass: { popup: 'animate__animated animate__fadeOutUp' }, hideClass: { popup: 'animate__animated animate__fadeOutUp' },
inputValidator: (name) => { inputValidator: (name) => {
@@ -777,16 +779,16 @@ async function whoAreYou() {
}).then(async () => { }).then(async () => {
if (initStream && !joinRoomWithScreen) { if (initStream && !joinRoomWithScreen) {
await stopTracks(initStream); await stopTracks(initStream);
// hide(initVideo);
elemDisplay('initVideo', false); elemDisplay('initVideo', false);
initVideoContainerShow(false);
} }
getPeerInfo(); getPeerInfo();
joinRoom(peer_name, room_id); joinRoom(peer_name, room_id);
}); });
if (!isVideoAllowed) { if (!isVideoAllowed) {
// hide(initVideo);
elemDisplay('initVideo', false); elemDisplay('initVideo', false);
initVideoContainerShow(false);
hide(initVideoSelect); hide(initVideoSelect);
} }
if (!isAudioAllowed) { if (!isAudioAllowed) {
@@ -838,13 +840,16 @@ async function handleAudioVideo() {
async function checkInitVideo(isVideoAllowed) { async function checkInitVideo(isVideoAllowed) {
if (isVideoAllowed && BUTTONS.main.startVideoButton) { if (isVideoAllowed && BUTTONS.main.startVideoButton) {
if (initVideoSelect.value) await changeCamera(initVideoSelect.value); if (initVideoSelect.value) {
initVideoContainerShow();
await changeCamera(initVideoSelect.value);
}
sound('joined'); sound('joined');
} else { } else {
if (initStream) { if (initStream) {
stopTracks(initStream); stopTracks(initStream);
// hide(initVideo);
elemDisplay('initVideo', false); elemDisplay('initVideo', false);
initVideoContainerShow(false);
sound('left'); sound('left');
} }
} }
@@ -857,6 +862,11 @@ function checkInitAudio(isAudioAllowed) {
isAudioAllowed ? sound('joined') : sound('left'); isAudioAllowed ? sound('joined') : sound('left');
} }
function initVideoContainerShow(show = true) {
initVideoContainer.style.padding = show ? '10px' : '0px';
initVideoContainer.style.width = show ? '100%' : 'auto';
}
function checkMedia() { function checkMedia() {
let qs = new URLSearchParams(window.location.search); let qs = new URLSearchParams(window.location.search);
let audio = filterXSS(qs.get('audio')); let audio = filterXSS(qs.get('audio'));
@@ -1612,8 +1622,8 @@ async function setSelectsInit() {
async function changeCamera(deviceId) { async function changeCamera(deviceId) {
if (initStream) { if (initStream) {
await stopTracks(initStream); await stopTracks(initStream);
//show(initVideo);
elemDisplay('initVideo', true); elemDisplay('initVideo', true);
initVideoContainerShow();
if (!initVideo.classList.contains('mirror')) { if (!initVideo.classList.contains('mirror')) {
initVideo.classList.toggle('mirror'); initVideo.classList.toggle('mirror');
} }
@@ -1653,8 +1663,8 @@ async function changeCamera(deviceId) {
async function toggleScreenSharing() { async function toggleScreenSharing() {
if (initStream) { if (initStream) {
await stopTracks(initStream); await stopTracks(initStream);
//show(initVideo);
elemDisplay('initVideo', true); elemDisplay('initVideo', true);
initVideoContainerShow();
} }
joinRoomWithScreen = !joinRoomWithScreen; joinRoomWithScreen = !joinRoomWithScreen;
if (joinRoomWithScreen) { if (joinRoomWithScreen) {

عرض الملف

@@ -9,7 +9,7 @@
* @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon * @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970 * @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com * @author Miroslav Pejic - miroslav.pejic.85@gmail.com
* @version 1.3.47 * @version 1.3.48
* *
*/ */

عرض الملف

@@ -109,7 +109,7 @@ access to use this app.
<section> <section>
<div id="initUser" class="init-user hidden"> <div id="initUser" class="init-user hidden">
<!-- <p>Please allow the camera & microphone access to use this app.</p> --> <!-- <p>Please allow the camera & microphone access to use this app.</p> -->
<div class="init-container"> <div id="initVideoContainer" class="init-video-container">
<video <video
id="initVideo" id="initVideo"
playsinline="true" playsinline="true"
@@ -119,7 +119,7 @@ access to use this app.
style="object-fit: contain" style="object-fit: contain"
></video> ></video>
</div> </div>
<div> <div class="initComands">
<button id="initVideoButton" class="fas fa-video" onclick="handleVideo(event)"></button> <button id="initVideoButton" class="fas fa-video" onclick="handleVideo(event)"></button>
<button id="initAudioButton" class="fas fa-microphone" onclick="handleAudio(event)"></button> <button id="initAudioButton" class="fas fa-microphone" onclick="handleAudio(event)"></button>
<button id="initAudioVideoButton" class="fas fa-eye" onclick="handleAudioVideo(event)"></button> <button id="initAudioVideoButton" class="fas fa-eye" onclick="handleAudioVideo(event)"></button>
@@ -133,10 +133,10 @@ access to use this app.
class="fas fa-stop-circle hidden" class="fas fa-stop-circle hidden"
onclick="toggleScreenSharing()" onclick="toggleScreenSharing()"
></button> ></button>
<select id="initVideoSelect" class="form-select text-light bg-dark"></select>
<select id="initMicrophoneSelect" class="form-select text-light bg-dark"></select>
<select id="initSpeakerSelect" class="form-select text-light bg-dark"></select>
</div> </div>
<select id="initVideoSelect" class="form-select text-light bg-dark"></select>
<select id="initMicrophoneSelect" class="form-select text-light bg-dark"></select>
<select id="initSpeakerSelect" class="form-select text-light bg-dark"></select>
</div> </div>
</section> </section>