[mirotalksfu] - add share YouTube to all/single

هذا الالتزام موجود في:
Miroslav Pejic
2022-04-08 13:38:47 +02:00
الأصل 5adf69d760
التزام cb6ba49566
4 ملفات معدلة مع 16 إضافات و5 حذوفات

عرض الملف

@@ -448,7 +448,11 @@ io.on('connection', (socket) => {
socket.on('youTubeAction', (data) => {
log.debug('YouTube: ', data);
roomList.get(socket.room_id).broadCast(socket.id, 'youTubeAction', data);
if (data.peer_id == 'all') {
roomList.get(socket.room_id).broadCast(socket.id, 'youTubeAction', data);
} else {
roomList.get(socket.room_id).sendTo(data.peer_id, 'youTubeAction', data);
}
});
socket.on('wbCanvasToJson', (data) => {

عرض الملف

@@ -17,4 +17,4 @@ rm csr.pem
# https://www.sslchecker.com/certdecoder
```
For trusted certificate, take a look at [Let's Encrypt](https://letsencrypt.org/i) and [Certbot](https://certbot.eff.org/).
For trusted certificate, take a look at [Let's Encrypt](https://letsencrypt.org/i) and [Certbot](https://certbot.eff.org/).

عرض الملف

@@ -22,6 +22,7 @@ const _PEER = {
ejectPeer: '<i class="fas fa-times"></i>',
sendFile: '<i class="fas fa-upload"></i>',
sendMsg: '<i class="fas fa-paper-plane"></i>',
sendYouTube: '<i class="fab fa-youtube"></i>',
};
const surveyActive = true;
@@ -724,7 +725,7 @@ function handleButtons() {
rc.selectFileToShare(rc.peer_id);
};
youTubeShareButton.onclick = () => {
rc.youTubeShareVideo();
rc.youTubeShareVideo('all');
};
youTubeCloseBtn.onclick = () => {
rc.closeYouTube(true);
@@ -1471,6 +1472,7 @@ async function getParticipantsTable(peers) {
<th></th>
<th></th>
<th></th>
<th></th>
</tr>`;
table += `
@@ -1481,6 +1483,7 @@ async function getParticipantsTable(peers) {
<td></td>
<td><button id="sendAllButton" onclick="rc.selectFileToShare('${rc.peer_id}')">${_PEER.sendFile}</button></td>
<td><button id="sendMessageToAll" onclick="rc.sendMessageTo('all')">${_PEER.sendMsg}</button></td>
<td><button id="sendYouTubeAll" onclick="rc.youTubeShareVideo('all');">${_PEER.sendYouTube}</button></td>
<td><button id="ejectAllButton" onclick="rc.peerAction('me','${rc.peer_id}','eject',true,true)">${_PEER.ejectPeer}</button></td>
</tr>
`;
@@ -1506,6 +1509,7 @@ async function getParticipantsTable(peers) {
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
`;
} else {
@@ -1517,6 +1521,7 @@ async function getParticipantsTable(peers) {
<td><button>${peer_hand}</button></td>
<td><button id='${peer_id}' onclick="rc.selectFileToShare(this.id, false)">${peer_sendFile}</button></td>
<td><button id="sendMessageTo" onclick="rc.sendMessageTo('${peer_id}')">${peer_sendMsg}</button></td>
<td><button id="sendYouTubeTo" onclick="rc.youTubeShareVideo('${peer_id}');">${_PEER.sendYouTube}</button></td>
<td><button id='${peer_id}___pEject' onclick="rc.peerAction('me',this.id,'eject')">${peer_eject}</button></td>
</tr>
`;

عرض الملف

@@ -2143,7 +2143,7 @@ class RoomClient {
// YOUTUBE SHARE VIDEO
// ####################################################
youTubeShareVideo() {
youTubeShareVideo(peer_id = 'all') {
this.sound('open');
Swal.fire({
@@ -2172,6 +2172,7 @@ class RoomClient {
let you_tube_url = this.getYoutubeEmbed(result.value);
if (you_tube_url) {
let data = {
peer_id: peer_id,
peer_name: this.peer_name,
you_tube_url: you_tube_url,
action: 'open',
@@ -2235,9 +2236,10 @@ class RoomClient {
this.sound('joined');
}
closeYouTube(emit = false) {
closeYouTube(emit = false, peer_id = 'all') {
if (emit) {
let data = {
peer_id: peer_id,
peer_name: this.peer_name,
action: 'close',
};