[mirotalksfu] - #180 start shared media on join room
هذا الالتزام موجود في:
@@ -67,6 +67,9 @@ module.exports = class Room {
|
||||
this.polls = [];
|
||||
|
||||
this.isHostProtected = config.host.protected;
|
||||
|
||||
// Share Media
|
||||
this.shareMediaData = {};
|
||||
}
|
||||
|
||||
// ####################################################
|
||||
@@ -95,10 +98,19 @@ module.exports = class Room {
|
||||
redirect: this.redirect,
|
||||
videoAIEnabled: this.videoAIEnabled,
|
||||
thereIsPolls: this.thereIsPolls(),
|
||||
shareMediaData: this.shareMediaData,
|
||||
peers: JSON.stringify([...this.peers]),
|
||||
};
|
||||
}
|
||||
|
||||
// ##############################################
|
||||
// SHARE MEDIA
|
||||
// ##############################################
|
||||
|
||||
updateShareMedia(data) {
|
||||
this.shareMediaData = data;
|
||||
}
|
||||
|
||||
// ##############################################
|
||||
// POLLS
|
||||
// ##############################################
|
||||
|
||||
@@ -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.6.25
|
||||
* @version 1.6.26
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -2086,6 +2086,8 @@ function startServer() {
|
||||
|
||||
const room = getRoom(socket);
|
||||
|
||||
room.updateShareMedia(data);
|
||||
|
||||
data.peer_id == 'all'
|
||||
? room.broadCast(socket.id, 'shareVideoAction', data)
|
||||
: room.sendTo(data.peer_id, 'shareVideoAction', data);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "mirotalksfu",
|
||||
"version": "1.6.25",
|
||||
"version": "1.6.26",
|
||||
"description": "WebRTC SFU browser-based video calls",
|
||||
"main": "Server.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -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.6.25
|
||||
* @version 1.6.26
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -4564,7 +4564,7 @@ function showAbout() {
|
||||
imageUrl: image.about,
|
||||
customClass: { image: 'img-about' },
|
||||
position: 'center',
|
||||
title: 'WebRTC SFU v1.6.25',
|
||||
title: 'WebRTC SFU v1.6.26',
|
||||
html: `
|
||||
<br />
|
||||
<div id="about">
|
||||
|
||||
@@ -601,6 +601,15 @@ class RoomClient {
|
||||
if (room.hostProtected) {
|
||||
RoomURL = window.location.origin + '/join/?room=' + room_id;
|
||||
}
|
||||
|
||||
// Share Media Data on Join
|
||||
if (
|
||||
room.shareMediaData &&
|
||||
Object.keys(room.shareMediaData).length !== 0 &&
|
||||
room.shareMediaData.action === 'open'
|
||||
) {
|
||||
this.shareVideoAction(room.shareMediaData);
|
||||
}
|
||||
}
|
||||
|
||||
// PARTICIPANTS
|
||||
@@ -6093,9 +6102,9 @@ class RoomClient {
|
||||
}).then((result) => {
|
||||
if (result.value) {
|
||||
result.value = filterXSS(result.value);
|
||||
if (!this.thereAreParticipants()) {
|
||||
return userLog('info', 'No participants detected', 'top-end');
|
||||
}
|
||||
// if (!this.thereAreParticipants()) {
|
||||
// return userLog('info', 'No participants detected', 'top-end');
|
||||
// }
|
||||
if (!this.isVideoTypeSupported(result.value)) {
|
||||
return userLog('warning', 'Something wrong, try with another Video or audio URL');
|
||||
}
|
||||
@@ -6169,8 +6178,8 @@ class RoomClient {
|
||||
}
|
||||
|
||||
shareVideoAction(data) {
|
||||
let peer_name = data.peer_name;
|
||||
let action = data.action;
|
||||
const { peer_name, action } = data;
|
||||
|
||||
switch (action) {
|
||||
case 'open':
|
||||
this.userLog('info', `${peer_name} <i class="fab fa-youtube"></i> opened the video`, 'top-end');
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم