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