[mirotalksfu] - extend api room password

هذا الالتزام موجود في:
Miroslav Pejic
2022-07-10 11:05:56 +02:00
الأصل 67c0e17133
التزام 2a8cd5577c
13 ملفات معدلة مع 85 إضافات و46 حذوفات

عرض الملف

@@ -181,11 +181,12 @@ $ curl -X POST "https://sfu.mirotalk.com/api/v1/join" -H "authorization: mirotal
<br/>
- You can `join` directly to `room` by going to
- https://sfu.mirotalk.com/join?room=test&name=mirotalksfu&audio=0&video=0&screen=0&notify=0
- https://sfu.mirotalk.com/join?room=test&password=0&name=mirotalksfu&audio=0&video=0&screen=0&notify=0
| Params | Type | Description |
| ------ | ------- | --------------- |
| -------- | -------------- | --------------- |
| room | string | room Id |
| password | string/boolean | room password |
| name | string | user name |
| audio | boolean | audio stream |
| video | boolean | video stream |

عرض الملف

@@ -4,6 +4,7 @@ const fetch = require('node-fetch');
const API_KEY = 'mirotalksfu_default_secret';
const MIROTALK_URL = 'https://sfu.mirotalk.com/api/v1/join';
// const MIROTALK_URL = 'http://localhost:3010/api/v1/join';
function getResponse() {
return fetch(MIROTALK_URL, {
@@ -14,6 +15,7 @@ function getResponse() {
},
body: JSON.stringify({
room: 'test',
password: false,
name: 'mirotalksfu',
audio: true,
video: true,

عرض الملف

@@ -2,6 +2,7 @@
$API_KEY = "mirotalksfu_default_secret";
$MIROTALK_URL = "https://sfu.mirotalk.com/api/v1/join";
// $MIROTALK_URL = "http://localhost:3010/api/v1/join";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $MIROTALK_URL);
@@ -17,6 +18,7 @@ curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$data = array(
"room" => "test",
"password" => false,
"name" => "mirotalksfu",
"audio" => true,
"video" => true,

عرض الملف

@@ -1,8 +1,10 @@
# pip3 install requests
import requests
import json
API_KEY = "mirotalksfu_default_secret"
MIROTALK_URL = "https://sfu.mirotalk.com/api/v1/join"
# MIROTALK_URL = "http://localhost:3010/api/v1/join"
headers = {
"authorization": API_KEY,
@@ -11,6 +13,7 @@ headers = {
data = {
"room": "test",
"password": "false",
"name": "mirotalksfu",
"audio": "true",
"video": "true",

عرض الملف

@@ -2,9 +2,10 @@
API_KEY="mirotalksfu_default_secret"
MIROTALK_URL="https://sfu.mirotalk.com/api/v1/join"
# MIROTALK_URL="http://localhost:3010/api/v1/join"
curl $MIROTALK_URL \
--header "authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '{"room":"test","name":"mirotalksfu","audio":"1","video":"1","screen":"1","notify":"1"}' \
--data '{"room":"test","password":"0","name":"mirotalksfu","audio":"1","video":"1","screen":"1","notify":"1"}' \
--request POST

عرض الملف

@@ -4,6 +4,7 @@ const fetch = require('node-fetch');
const API_KEY = 'mirotalksfu_default_secret';
const MIROTALK_URL = 'https://sfu.mirotalk.com/api/v1/meeting';
// const MIROTALK_URL = 'http://localhost:3010/api/v1/join';
function getResponse() {
return fetch(MIROTALK_URL, {

عرض الملف

@@ -2,6 +2,7 @@
$API_KEY = "mirotalksfu_default_secret";
$MIROTALK_URL = "https://sfu.mirotalk.com/api/v1/meeting";
// $MIROTALK_URL = "http://localhost:3010/api/v1/join";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $MIROTALK_URL);

عرض الملف

@@ -1,8 +1,11 @@
# pip3 install requests
# pip3 install requests
import requests
import json
API_KEY = "mirotalksfu_default_secret"
MIROTALK_URL = "https://sfu.mirotalk.com/api/v1/meeting"
# MIROTALK_URL = "http://localhost:3010/api/v1/join"
headers = {
"authorization": API_KEY,

عرض الملف

@@ -2,6 +2,7 @@
API_KEY="mirotalksfu_default_secret"
MIROTALK_URL="https://sfu.mirotalk.com/api/v1/meeting"
# MIROTALK_URL="http://localhost:3010/api/v1/join"
curl $MIROTALK_URL \
--header "authorization: $API_KEY" \

عرض الملف

@@ -180,9 +180,9 @@ app.get(['/newroom'], (req, res) => {
app.get('/join/', (req, res) => {
if (hostCfg.authenticated && Object.keys(req.query).length > 0) {
log.debug('Direct Join', req.query);
// http://localhost:3010/join?room=test&name=mirotalksfu&audio=1&video=1&screen=1&notify=1
const { room, name, audio, video, screen, notify } = req.query;
if (room && name && audio && video && screen && notify) {
// http://localhost:3010/join?room=test&password=0&name=mirotalksfu&audio=1&video=1&screen=1&notify=1
const { room, password, name, audio, video, screen, notify } = req.query;
if (room && password && name && audio && video && screen && notify) {
return res.sendFile(views.room);
}
}

عرض الملف

@@ -25,6 +25,8 @@ module.exports = class ServerApi {
this._host +
'/join?room=' +
data.room +
'&password=' +
data.password +
'&name=' +
data.name +
'&audio=' +

عرض الملف

@@ -33,6 +33,7 @@ let rc = null;
let producer = null;
let room_id = getRoomId();
let room_password = getRoomPassword();
let peer_name = getPeerName();
let notify = getNotify();
@@ -282,6 +283,18 @@ function getPeerName() {
return qs.get('name');
}
function getRoomPassword() {
let qs = new URLSearchParams(window.location.search);
let roomPassword = qs.get('password');
if (roomPassword) {
let queryNoRoomPassword = roomPassword === '0' || roomPassword === 'false';
if (queryNoRoomPassword != null) {
return false;
}
return roomPassword;
}
}
// ####################################################
// SOME PEER INFO
// ####################################################
@@ -593,6 +606,9 @@ function roomIsReady() {
document.body.addEventListener('mousemove', (e) => {
showButtons();
});
if (room_password) {
lockRoomButton.click();
}
}
function hide(elem) {

عرض الملف

@@ -2522,6 +2522,11 @@ class RoomClient {
if (emit) {
switch (action) {
case 'lock':
if (room_password) {
data.password = room_password;
this.socket.emit('roomAction', data);
this.roomStatus(action);
} else {
Swal.fire({
allowOutsideClick: false,
allowEscapeKey: false,
@@ -2549,6 +2554,7 @@ class RoomClient {
this.roomStatus(action);
}
});
}
break;
case 'unlock':
this.socket.emit('roomAction', data);