Skip to content

Commit

Permalink
[mirotalksfu] - refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
miroslavpejic85 committed Jan 7, 2025
1 parent c0423f9 commit f3df0c6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions 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 [email protected] or purchase directly via CodeCanyon
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
* @author Miroslav Pejic - [email protected]
* @version 1.6.84
* @version 1.6.85
*
*/

Expand Down Expand Up @@ -1400,7 +1400,7 @@ function startServer() {
is_presenter =
presenter === '1' ||
presenter === 'true' ||
(config.presenters.join_first && room.getPeers().size === 0);
(config.presenters.join_first && room.getPeersCount() === 0);

log.debug('[Join] - HOST PROTECTED - USER AUTH check peer', {
ip: peer_ip,
Expand Down Expand Up @@ -2211,7 +2211,7 @@ function startServer() {

const room = getRoom(socket);

const peerCounts = room.getPeers().size;
const peerCounts = room.getPeersCount();

const data = {
room_id: socket.room_id,
Expand Down Expand Up @@ -2802,7 +2802,7 @@ function startServer() {

room.removePeer(socket.id);

if (room.getPeers().size === 0) {
if (room.getPeersCount() === 0) {
//
stopRTMPActiveStreams(isPresenter, room);

Expand Down Expand Up @@ -2847,7 +2847,7 @@ function startServer() {

room.broadCast(socket.id, 'removeMe', removeMeData(room, peer_name, isPresenter));

if (room.getPeers().size === 0) {
if (room.getPeersCount() === 0) {
//
stopRTMPActiveStreams(isPresenter, room);

Expand Down Expand Up @@ -2918,7 +2918,7 @@ function startServer() {

function removeMeData(room, peerName, isPresenter) {
const roomId = room && socket.room_id;
const peerCounts = room && room.getPeers().size;
const peerCounts = room && room.getPeersCount();
const data = {
room_id: roomId,
peer_id: socket.id,
Expand Down Expand Up @@ -3117,7 +3117,7 @@ function startServer() {
const roomIds = Array.from(roomList.keys());
const roomPeersArray = roomIds.map((roomId) => {
const room = roomList.get(roomId);
const peerCount = (room && room.getPeers().size) || 0;
const peerCount = (room && room.getPeersCount()) || 0;
const broadcasting = (room && room.isBroadcasting()) || false;
return {
room: roomId,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mirotalksfu",
"version": "1.6.84",
"version": "1.6.85",
"description": "WebRTC SFU browser-based video calls",
"main": "Server.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 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 [email protected] or purchase directly via CodeCanyon
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
* @author Miroslav Pejic - [email protected]
* @version 1.6.84
* @version 1.6.85
*
*/

Expand Down Expand Up @@ -4676,7 +4676,7 @@ function showAbout() {
imageUrl: image.about,
customClass: { image: 'img-about' },
position: 'center',
title: 'WebRTC SFU v1.6.84',
title: 'WebRTC SFU v1.6.85',
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 [email protected] or purchase directly via CodeCanyon
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
* @author Miroslav Pejic - [email protected]
* @version 1.6.84
* @version 1.6.85
*
*/

Expand Down

0 comments on commit f3df0c6

Please sign in to comment.