From 3d4d1dc426431c57380ac254f680e7987b9f5698 Mon Sep 17 00:00:00 2001 From: Miroslav Pejic Date: Thu, 31 Aug 2023 17:24:24 +0200 Subject: [PATCH] [mirotalksfu] - add profile tab --- public/css/Room.css | 6 ++++++ public/js/Room.js | 7 +++++++ public/js/RoomClient.js | 2 ++ public/views/Room.html | 29 +++++++++++++++++++++++++++++ 4 files changed, 44 insertions(+) diff --git a/public/css/Room.css b/public/css/Room.css index 92554416..49e16adb 100644 --- a/public/css/Room.css +++ b/public/css/Room.css @@ -318,6 +318,12 @@ body { border-radius: 5px; } +#myProfileAvatar { + margin-top: 10px; + margin-bottom: 10px; + padding: 5px; +} + .form-check-input { cursor: pointer; } diff --git a/public/js/Room.js b/public/js/Room.js index fb447837..05cb5eba 100644 --- a/public/js/Room.js +++ b/public/js/Room.js @@ -157,6 +157,7 @@ function initClient() { setTippy('tabRecordingBtn', 'Recording', 'top'); setTippy('tabRoomBtn', 'Room', 'top'); setTippy('tabVideoShareBtn', 'Video share', 'top'); + setTippy('tabProfileBtn', 'Profile', 'top'); setTippy('tabAspectBtn', 'Aspect', 'top'); setTippy('tabStylingBtn', 'Styling', 'top'); setTippy('tabLanguagesBtn', 'Languages', 'top'); @@ -815,6 +816,8 @@ function joinRoom(peer_name, room_id) { } else { console.log('05 ----> join Room ' + room_id); roomId.innerText = room_id; + userName.innerText = peer_name; + isUserPresenter.innerText = isPresenter; rc = new RoomClient( localAudio, remoteAudios, @@ -838,6 +841,7 @@ function joinRoom(peer_name, room_id) { } function roomIsReady() { + myProfileAvatar.setAttribute('src', rc.genAvatarSvg(peer_name, 64)); BUTTONS.main.exitButton && show(exitButton); BUTTONS.main.shareButton && show(shareButton); BUTTONS.main.hideMeButton && show(hideMeButton); @@ -1031,6 +1035,9 @@ function handleButtons() { tabAspectBtn.onclick = (e) => { rc.openTab(e, 'tabAspect'); }; + tabProfileBtn.onclick = (e) => { + rc.openTab(e, 'tabProfile'); + }; tabStylingBtn.onclick = (e) => { rc.openTab(e, 'tabStyling'); }; diff --git a/public/js/RoomClient.js b/public/js/RoomClient.js index 1acf4044..cf84216f 100644 --- a/public/js/RoomClient.js +++ b/public/js/RoomClient.js @@ -325,6 +325,7 @@ class RoomClient { let my_peer_info = peers.get(peer).peer_info; console.log('07.1 ----> My Peer info', my_peer_info); isPresenter = window.localStorage.isReconnected === 'true' ? isPresenter : my_peer_info.peer_presenter; + this.getId('isUserPresenter').innerText = isPresenter; window.localStorage.isReconnected = false; handleRules(isPresenter); } @@ -3937,6 +3938,7 @@ class RoomClient { // Only the presenter can lock the room if (isPresenter || res.peerCounts == 1) { isPresenter = true; + this.getId('isUserPresenter').innerText = isPresenter; data.password = room_password; this.socket.emit('roomAction', data); this.roomStatus(action); diff --git a/public/views/Room.html b/public/views/Room.html index 0702f7e2..12479266 100644 --- a/public/views/Room.html +++ b/public/views/Room.html @@ -161,6 +161,9 @@ access to use this app. + @@ -415,6 +418,32 @@ access to use this app.
+
+
+ +
+ + + + + + + +
+
+ +

Username:

+

UserName

+
+
+
+ +

Presenter:

+

true

+
+
+
+