[mirotalksfu] - extend api room password
هذا الالتزام موجود في:
@@ -181,11 +181,12 @@ $ curl -X POST "https://sfu.mirotalk.com/api/v1/join" -H "authorization: mirotal
|
|||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
- You can `join` directly to `room` by going to
|
- You can `join` directly to `room` by going to
|
||||||
- https://sfu.mirotalk.com/join?room=test&name=mirotalksfu&audio=0&video=0&screen=0¬ify=0
|
- https://sfu.mirotalk.com/join?room=test&password=0&name=mirotalksfu&audio=0&video=0&screen=0¬ify=0
|
||||||
|
|
||||||
| Params | Type | Description |
|
| Params | Type | Description |
|
||||||
| ------ | ------- | --------------- |
|
| -------- | -------------- | --------------- |
|
||||||
| room | string | room Id |
|
| room | string | room Id |
|
||||||
|
| password | string/boolean | room password |
|
||||||
| name | string | user name |
|
| name | string | user name |
|
||||||
| audio | boolean | audio stream |
|
| audio | boolean | audio stream |
|
||||||
| video | boolean | video stream |
|
| video | boolean | video stream |
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ const fetch = require('node-fetch');
|
|||||||
|
|
||||||
const API_KEY = 'mirotalksfu_default_secret';
|
const API_KEY = 'mirotalksfu_default_secret';
|
||||||
const MIROTALK_URL = 'https://sfu.mirotalk.com/api/v1/join';
|
const MIROTALK_URL = 'https://sfu.mirotalk.com/api/v1/join';
|
||||||
|
// const MIROTALK_URL = 'http://localhost:3010/api/v1/join';
|
||||||
|
|
||||||
function getResponse() {
|
function getResponse() {
|
||||||
return fetch(MIROTALK_URL, {
|
return fetch(MIROTALK_URL, {
|
||||||
@@ -14,6 +15,7 @@ function getResponse() {
|
|||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
room: 'test',
|
room: 'test',
|
||||||
|
password: false,
|
||||||
name: 'mirotalksfu',
|
name: 'mirotalksfu',
|
||||||
audio: true,
|
audio: true,
|
||||||
video: true,
|
video: true,
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
$API_KEY = "mirotalksfu_default_secret";
|
$API_KEY = "mirotalksfu_default_secret";
|
||||||
$MIROTALK_URL = "https://sfu.mirotalk.com/api/v1/join";
|
$MIROTALK_URL = "https://sfu.mirotalk.com/api/v1/join";
|
||||||
|
// $MIROTALK_URL = "http://localhost:3010/api/v1/join";
|
||||||
|
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
curl_setopt($ch, CURLOPT_URL, $MIROTALK_URL);
|
curl_setopt($ch, CURLOPT_URL, $MIROTALK_URL);
|
||||||
@@ -17,6 +18,7 @@ curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
|||||||
|
|
||||||
$data = array(
|
$data = array(
|
||||||
"room" => "test",
|
"room" => "test",
|
||||||
|
"password" => false,
|
||||||
"name" => "mirotalksfu",
|
"name" => "mirotalksfu",
|
||||||
"audio" => true,
|
"audio" => true,
|
||||||
"video" => true,
|
"video" => true,
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
|
# pip3 install requests
|
||||||
import requests
|
import requests
|
||||||
import json
|
import json
|
||||||
|
|
||||||
API_KEY = "mirotalksfu_default_secret"
|
API_KEY = "mirotalksfu_default_secret"
|
||||||
MIROTALK_URL = "https://sfu.mirotalk.com/api/v1/join"
|
MIROTALK_URL = "https://sfu.mirotalk.com/api/v1/join"
|
||||||
|
# MIROTALK_URL = "http://localhost:3010/api/v1/join"
|
||||||
|
|
||||||
headers = {
|
headers = {
|
||||||
"authorization": API_KEY,
|
"authorization": API_KEY,
|
||||||
@@ -11,6 +13,7 @@ headers = {
|
|||||||
|
|
||||||
data = {
|
data = {
|
||||||
"room": "test",
|
"room": "test",
|
||||||
|
"password": "false",
|
||||||
"name": "mirotalksfu",
|
"name": "mirotalksfu",
|
||||||
"audio": "true",
|
"audio": "true",
|
||||||
"video": "true",
|
"video": "true",
|
||||||
|
|||||||
@@ -2,9 +2,10 @@
|
|||||||
|
|
||||||
API_KEY="mirotalksfu_default_secret"
|
API_KEY="mirotalksfu_default_secret"
|
||||||
MIROTALK_URL="https://sfu.mirotalk.com/api/v1/join"
|
MIROTALK_URL="https://sfu.mirotalk.com/api/v1/join"
|
||||||
|
# MIROTALK_URL="http://localhost:3010/api/v1/join"
|
||||||
|
|
||||||
curl $MIROTALK_URL \
|
curl $MIROTALK_URL \
|
||||||
--header "authorization: $API_KEY" \
|
--header "authorization: $API_KEY" \
|
||||||
--header "Content-Type: application/json" \
|
--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
|
--request POST
|
||||||
@@ -4,6 +4,7 @@ const fetch = require('node-fetch');
|
|||||||
|
|
||||||
const API_KEY = 'mirotalksfu_default_secret';
|
const API_KEY = 'mirotalksfu_default_secret';
|
||||||
const MIROTALK_URL = 'https://sfu.mirotalk.com/api/v1/meeting';
|
const MIROTALK_URL = 'https://sfu.mirotalk.com/api/v1/meeting';
|
||||||
|
// const MIROTALK_URL = 'http://localhost:3010/api/v1/join';
|
||||||
|
|
||||||
function getResponse() {
|
function getResponse() {
|
||||||
return fetch(MIROTALK_URL, {
|
return fetch(MIROTALK_URL, {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
$API_KEY = "mirotalksfu_default_secret";
|
$API_KEY = "mirotalksfu_default_secret";
|
||||||
$MIROTALK_URL = "https://sfu.mirotalk.com/api/v1/meeting";
|
$MIROTALK_URL = "https://sfu.mirotalk.com/api/v1/meeting";
|
||||||
|
// $MIROTALK_URL = "http://localhost:3010/api/v1/join";
|
||||||
|
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
curl_setopt($ch, CURLOPT_URL, $MIROTALK_URL);
|
curl_setopt($ch, CURLOPT_URL, $MIROTALK_URL);
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
|
# pip3 install requests
|
||||||
|
# pip3 install requests
|
||||||
import requests
|
import requests
|
||||||
import json
|
import json
|
||||||
|
|
||||||
API_KEY = "mirotalksfu_default_secret"
|
API_KEY = "mirotalksfu_default_secret"
|
||||||
MIROTALK_URL = "https://sfu.mirotalk.com/api/v1/meeting"
|
MIROTALK_URL = "https://sfu.mirotalk.com/api/v1/meeting"
|
||||||
|
# MIROTALK_URL = "http://localhost:3010/api/v1/join"
|
||||||
|
|
||||||
headers = {
|
headers = {
|
||||||
"authorization": API_KEY,
|
"authorization": API_KEY,
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
API_KEY="mirotalksfu_default_secret"
|
API_KEY="mirotalksfu_default_secret"
|
||||||
MIROTALK_URL="https://sfu.mirotalk.com/api/v1/meeting"
|
MIROTALK_URL="https://sfu.mirotalk.com/api/v1/meeting"
|
||||||
|
# MIROTALK_URL="http://localhost:3010/api/v1/join"
|
||||||
|
|
||||||
curl $MIROTALK_URL \
|
curl $MIROTALK_URL \
|
||||||
--header "authorization: $API_KEY" \
|
--header "authorization: $API_KEY" \
|
||||||
|
|||||||
@@ -180,9 +180,9 @@ app.get(['/newroom'], (req, res) => {
|
|||||||
app.get('/join/', (req, res) => {
|
app.get('/join/', (req, res) => {
|
||||||
if (hostCfg.authenticated && Object.keys(req.query).length > 0) {
|
if (hostCfg.authenticated && Object.keys(req.query).length > 0) {
|
||||||
log.debug('Direct Join', req.query);
|
log.debug('Direct Join', req.query);
|
||||||
// http://localhost:3010/join?room=test&name=mirotalksfu&audio=1&video=1&screen=1¬ify=1
|
// http://localhost:3010/join?room=test&password=0&name=mirotalksfu&audio=1&video=1&screen=1¬ify=1
|
||||||
const { room, name, audio, video, screen, notify } = req.query;
|
const { room, password, name, audio, video, screen, notify } = req.query;
|
||||||
if (room && name && audio && video && screen && notify) {
|
if (room && password && name && audio && video && screen && notify) {
|
||||||
return res.sendFile(views.room);
|
return res.sendFile(views.room);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ module.exports = class ServerApi {
|
|||||||
this._host +
|
this._host +
|
||||||
'/join?room=' +
|
'/join?room=' +
|
||||||
data.room +
|
data.room +
|
||||||
|
'&password=' +
|
||||||
|
data.password +
|
||||||
'&name=' +
|
'&name=' +
|
||||||
data.name +
|
data.name +
|
||||||
'&audio=' +
|
'&audio=' +
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ let rc = null;
|
|||||||
let producer = null;
|
let producer = null;
|
||||||
|
|
||||||
let room_id = getRoomId();
|
let room_id = getRoomId();
|
||||||
|
let room_password = getRoomPassword();
|
||||||
let peer_name = getPeerName();
|
let peer_name = getPeerName();
|
||||||
let notify = getNotify();
|
let notify = getNotify();
|
||||||
|
|
||||||
@@ -282,6 +283,18 @@ function getPeerName() {
|
|||||||
return qs.get('name');
|
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
|
// SOME PEER INFO
|
||||||
// ####################################################
|
// ####################################################
|
||||||
@@ -593,6 +606,9 @@ function roomIsReady() {
|
|||||||
document.body.addEventListener('mousemove', (e) => {
|
document.body.addEventListener('mousemove', (e) => {
|
||||||
showButtons();
|
showButtons();
|
||||||
});
|
});
|
||||||
|
if (room_password) {
|
||||||
|
lockRoomButton.click();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function hide(elem) {
|
function hide(elem) {
|
||||||
|
|||||||
@@ -2522,6 +2522,11 @@ class RoomClient {
|
|||||||
if (emit) {
|
if (emit) {
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case 'lock':
|
case 'lock':
|
||||||
|
if (room_password) {
|
||||||
|
data.password = room_password;
|
||||||
|
this.socket.emit('roomAction', data);
|
||||||
|
this.roomStatus(action);
|
||||||
|
} else {
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
allowOutsideClick: false,
|
allowOutsideClick: false,
|
||||||
allowEscapeKey: false,
|
allowEscapeKey: false,
|
||||||
@@ -2549,6 +2554,7 @@ class RoomClient {
|
|||||||
this.roomStatus(action);
|
this.roomStatus(action);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'unlock':
|
case 'unlock':
|
||||||
this.socket.emit('roomAction', data);
|
this.socket.emit('roomAction', data);
|
||||||
|
|||||||
المرجع في مشكلة جديدة
حظر مستخدم