Skip to content

Commit

Permalink
[mirotalksfu] - fix chat
Browse files Browse the repository at this point in the history
  • Loading branch information
miroslavpejic85 committed Oct 22, 2024
1 parent dbfb374 commit 4a3df0c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion app/src/Server.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ dev dependencies: {
* @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
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
* @version 1.5.96
* @version 1.5.97
*
*/

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mirotalksfu",
"version": "1.5.96",
"version": "1.5.97",
"description": "WebRTC SFU browser-based video calls",
"main": "Server.js",
"scripts": {
Expand Down Expand Up @@ -57,7 +57,7 @@
"node": ">=18"
},
"dependencies": {
"@sentry/node": "^8.34.0",
"@sentry/node": "^8.35.0",
"axios": "^1.7.7",
"body-parser": "1.20.3",
"colors": "1.4.0",
Expand Down
10 changes: 5 additions & 5 deletions public/js/Room.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
* @version 1.5.96
* @version 1.5.97
*
*/

Expand Down Expand Up @@ -3932,7 +3932,7 @@ function getParticipantsList(peers) {

// CHAT-GPT
if (chatGPT) {
const chatgpt_active = rc.chatPeerName === 'ChatGPT' ? ' active' : '';
const chatgpt_active = !rc.isChatOpen && rc.chatPeerName === 'ChatGPT' ? ' active' : '';

li = `
<li
Expand All @@ -3953,7 +3953,7 @@ function getParticipantsList(peers) {
</li>`;
}

const public_chat_active = rc.chatPeerName === 'all' ? ' active' : '';
const public_chat_active = !rc.isChatOpen && rc.chatPeerName === 'all' ? ' active' : '';

// ALL
li += `
Expand Down Expand Up @@ -4036,7 +4036,7 @@ function getParticipantsList(peers) {
const peer_id = peer_info.peer_id;
const avatarImg = getParticipantAvatar(peer_name);

const peer_chat_active = rc.chatPeerId === peer_id ? ' active' : '';
const peer_chat_active = !rc.isChatOpen && rc.chatPeerId === peer_id ? ' active' : '';

// NOT ME
if (socket.id !== peer_id) {
Expand Down Expand Up @@ -4500,7 +4500,7 @@ function showAbout() {
imageUrl: image.about,
customClass: { image: 'img-about' },
position: 'center',
title: 'WebRTC SFU v1.5.96',
title: 'WebRTC SFU v1.5.97',
html: `
<br />
<div id="about">
Expand Down
2 changes: 1 addition & 1 deletion public/js/RoomClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @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
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
* @version 1.5.96
* @version 1.5.97
*
*/

Expand Down
9 changes: 4 additions & 5 deletions public/js/WhoAreYou.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ guestJoinRoomBtn.addEventListener('click', () => {
// Function to play sound
function playSound(name) {
if (!settings.sounds) return;

const soundSrc = `../sounds/${name}.wav`;
const audio = new Audio(soundSrc);
audio.volume = 0.5;

audio.play().catch((err) => {
console.error(`Error playing sound: ${err}`);
});
Expand All @@ -63,13 +63,13 @@ async function checkRoomStatus(roomId) {
const response = await axios.post('/isRoomActive', { roomId });
const isActive = response.data.message;
console.log('Room active status:', isActive);

roomActive = isActive;
if (roomActive) {
playSound('roomActive');
guestJoinRoomBtn.classList.remove('disabled');
presenterLoginBtn.style.display = 'none';

if (autoJoinRoom) {
guestJoinRoomBtn.click();
}
Expand Down Expand Up @@ -120,4 +120,3 @@ document.addEventListener('visibilitychange', handleVisibilityChange);
handleScreenResize(mediaQuery);
checkRoomStatus(roomId);
startRoomStatusCheck();

0 comments on commit 4a3df0c

Please sign in to comment.