diff --git a/README.md b/README.md index 8a931904..ad488030 100644 --- a/README.md +++ b/README.md @@ -287,25 +287,82 @@ To embed a meeting within `your service or app` using an iframe, you can use the - `Rest API:` The [API documentation](https://docs.mirotalk.com/mirotalk-sfu/api/) uses [swagger](https://swagger.io/) at https://localhost:3010/api/v1/docs or check it on live [here](https://sfu.mirotalk.com/api/v1/docs). +### 1. Get Server Statistics + ```bash -# The response will give you the total of rooms and users. -$ curl -X GET "http://localhost:3010/api/v1/stats" -H "authorization: mirotalksfu_default_secret" -H "Content-Type: application/json" -$ curl -X GET "https://sfu.mirotalk.com/api/v1/stats" -H "authorization: mirotalksfu_default_secret" -H "Content-Type: application/json" -# The response will give you the active meetings (default disabled). -$ curl -X GET "http://localhost:3010/api/v1/meetings" -H "authorization: mirotalksfu_default_secret" -H "Content-Type: application/json" -$ curl -X GET "https://sfu.mirotalk.com/api/v1/meetings" -H "authorization: mirotalksfu_default_secret" -H "Content-Type: application/json" -# The response will give you a entrypoint / Room URL for your meeting. -$ curl -X POST "http://localhost:3010/api/v1/meeting" -H "authorization: mirotalksfu_default_secret" -H "Content-Type: application/json" -$ curl -X POST "https://sfu.mirotalk.com/api/v1/meeting" -H "authorization: mirotalksfu_default_secret" -H "Content-Type: application/json" -# The response will give you a entrypoint / URL for the direct join to the meeting. -$ curl -X POST "http://localhost:3010/api/v1/join" -H "authorization: mirotalksfu_default_secret" -H "Content-Type: application/json" --data '{"room":"test","roomPassword":"false","name":"mirotalksfu","audio":"false","video":"false","screen":"false","notify":"false","duration":"unlimited"}' -$ curl -X POST "https://sfu.mirotalk.com/api/v1/join" -H "authorization: mirotalksfu_default_secret" -H "Content-Type: application/json" --data '{"room":"test","roomPassword":"false","name":"mirotalksfu","audio":"false","video":"false","screen":"false","notify":"false","duration":"unlimited"}' -# The response will give you a entrypoint / URL for the direct join to the meeting with a token. -$ curl -X POST "http://localhost:3010/api/v1/join" -H "authorization: mirotalksfu_default_secret" -H "Content-Type: application/json" --data '{"room":"test","roomPassword":"false","name":"mirotalksfu","audio":"false","video":"false","screen":"false","notify":"false","duration":"unlimited","token":{"username":"username","password":"password","presenter":"true", "expire":"1h"}}' -$ curl -X POST "https://sfu.mirotalk.com/api/v1/join" -H "authorization: mirotalksfu_default_secret" -H "Content-Type: application/json" --data '{"room":"test","roomPassword":"false","name":"mirotalksfu","audio":"false","video":"false","screen":"false","notify":"false","duration":"unlimited","token":{"username":"username","password":"password","presenter":"true", "expire":"1h"}}' -# The response will give you a valid token for a meeting (default diabled) -$ curl -X POST "http://localhost:3010/api/v1/token" -H "authorization: mirotalksfu_default_secret" -H "Content-Type: application/json" --data '{"username":"username","password":"password","presenter":"true", "expire":"1h"}' -$ curl -X POST "https://sfu.mirotalk.com/api/v1/token" -H "authorization: mirotalksfu_default_secret" -H "Content-Type: application/json" --data '{"username":"username","password":"password","presenter":"true", "expire":"1h"}' +curl -X GET "http://localhost:3010/api/v1/stats" \ + -H "authorization: mirotalksfu_default_secret" \ + -H "Content-Type: application/json" + +curl -X GET "https://sfu.mirotalk.com/api/v1/stats" \ + -H "authorization: mirotalksfu_default_secret" \ + -H "Content-Type: application/json" +``` + +### 2. Get Active Meetings + +```bash +curl -X GET "http://localhost:3010/api/v1/meetings" \ + -H "authorization: mirotalksfu_default_secret" \ + -H "Content-Type: application/json" + +curl -X GET "https://sfu.mirotalk.com/api/v1/meetings" \ + -H "authorization: mirotalksfu_default_secret" \ + -H "Content-Type: application/json" +``` + +### 3. Create Meeting + +```bash +curl -X POST "http://localhost:3010/api/v1/meeting" \ + -H "authorization: mirotalksfu_default_secret" \ + -H "Content-Type: application/json" + +curl -X POST "https://sfu.mirotalk.com/api/v1/meeting" \ + -H "authorization: mirotalksfu_default_secret" \ + -H "Content-Type: application/json" +``` + +### 4. Join Meeting (Basic) + +```bash +curl -X POST "http://localhost:3010/api/v1/join" \ + -H "authorization: mirotalksfu_default_secret" \ + -H "Content-Type: application/json" \ + --data '{"room":"test","roomPassword":false,"avatar":false,"name":"mirotalksfu","audio":false,"video":false,"screen":false,"notify":false,"duration":"unlimited"}' + +curl -X POST "https://sfu.mirotalk.com/api/v1/join" \ + -H "authorization: mirotalksfu_default_secret" \ + -H "Content-Type: application/json" \ + --data '{"room":"test","roomPassword":false,"name":"mirotalksfu","avatar":false,"audio":false,"video":false,"screen":false,"notify":false,"duration":"unlimited"}' +``` + +### 5. Join Meeting with Token + +```bash +curl -X POST "http://localhost:3010/api/v1/join" \ + -H "authorization: mirotalksfu_default_secret" \ + -H "Content-Type: application/json" \ + --data '{"room":"test","roomPassword":false,"name":"mirotalksfu","audio":false,"video":false,"screen":false,"notify":false,"duration":"unlimited","token":{"username":"username","password":"password","presenter":true,"expire":"1h"}}' + +curl -X POST "https://sfu.mirotalk.com/api/v1/join" \ + -H "authorization: mirotalksfu_default_secret" \ + -H "Content-Type: application/json" \ + --data '{"room":"test","roomPassword":false,"name":"mirotalksfu","audio":false,"video":false,"screen":false,"notify":false,"duration":"unlimited","token":{"username":"username","password":"password","presenter":true,"expire":"1h"}}' +``` + +### 6. Generate Token + +```bash +curl -X POST "http://localhost:3010/api/v1/token" \ + -H "authorization: mirotalksfu_default_secret" \ + -H "Content-Type: application/json" \ + --data '{"username":"username","password":"password","presenter":true,"expire":"1h"}' + +curl -X POST "https://sfu.mirotalk.com/api/v1/token" \ + -H "authorization: mirotalksfu_default_secret" \ + -H "Content-Type: application/json" \ + --data '{"username":"username","password":"password","presenter":true,"expire":"1h"}' ``` diff --git a/app/api/join/join.js b/app/api/join/join.js index 0a6efe9d..6e5c287f 100644 --- a/app/api/join/join.js +++ b/app/api/join/join.js @@ -19,9 +19,10 @@ async function getJoin() { room: 'test', roomPassword: false, name: 'mirotalksfu', - audio: true, - video: true, - screen: true, + avatar: false, + audio: false, + video: false, + screen: false, hide: false, notify: true, duration: 'unlimited', diff --git a/app/api/join/join.php b/app/api/join/join.php index eafb0626..6c223cc4 100644 --- a/app/api/join/join.php +++ b/app/api/join/join.php @@ -20,9 +20,10 @@ $data = array( "room" => "test", "roomPassword" => false, "name" => "mirotalksfu", - "audio" => true, - "video" => true, - "screen" => true, + "avatar" => false, + "audio" => false, + "video" => false, + "screen" => false, "hide" => false, "notify" => true, "duration" => "unlimited", diff --git a/app/api/join/join.py b/app/api/join/join.py index 2e737087..24dba577 100644 --- a/app/api/join/join.py +++ b/app/api/join/join.py @@ -15,9 +15,10 @@ data = { "room": "test", "roomPassword": "false", "name": "mirotalksfu", - "audio": "true", - "video": "true", - "screen": "true", + "avatar": "false", + "audio": "false", + "video": "false", + "screen": "false", "hide": "false", "notify": "true", "duration": "unlimited", diff --git a/app/api/join/join.sh b/app/api/join/join.sh index df765457..6c7df860 100755 --- a/app/api/join/join.sh +++ b/app/api/join/join.sh @@ -1,11 +1,33 @@ #!/bin/bash +# Configuration API_KEY_SECRET="mirotalksfu_default_secret" MIROTALK_URL="https://sfu.mirotalk.com/api/v1/join" +# Alternative URL for local testing: # MIROTALK_URL="http://localhost:3010/api/v1/join" -curl $MIROTALK_URL \ - --header "authorization: $API_KEY_SECRET" \ - --header "Content-Type: application/json" \ - --data '{"room":"test","roomPassword":"false","name":"mirotalksfu","audio":"true","video":"true","screen":"false","hide":"false","notify":"true","duration":"unlimited","token":{"username":"username","password":"password","presenter":"true", "expire":"1h"}}' \ - --request POST \ No newline at end of file +# Request data with proper JSON formatting +REQUEST_DATA='{ + "room": "test", + "roomPassword": false, + "name": "mirotalksfu", + "avatar": false, + "audio": false, + "video": false, + "screen": false, + "hide": false, + "notify": true, + "duration": "unlimited", + "token": { + "username": "username", + "password": "password", + "presenter": true, + "expire": "1h" + } +}' + +# Make the API request +curl -X POST "$MIROTALK_URL" \ + -H "Authorization: $API_KEY_SECRET" \ + -H "Content-Type: application/json" \ + -d "$REQUEST_DATA" \ No newline at end of file diff --git a/app/api/swagger.yaml b/app/api/swagger.yaml index 0ece6177..0eeea95c 100644 --- a/app/api/swagger.yaml +++ b/app/api/swagger.yaml @@ -162,6 +162,9 @@ definitions: name: type: string default: 'mirotalksfu' + avatar: + type: ['boolean', 'string'] # Allow boolean or string type + default: false audio: type: boolean default: false @@ -212,6 +215,8 @@ definitions: properties: name: type: string + avatar: + type: string presenter: type: boolean video: diff --git a/app/src/Peer.js b/app/src/Peer.js index 0cf114e0..bad882f7 100644 --- a/app/src/Peer.js +++ b/app/src/Peer.js @@ -10,6 +10,7 @@ module.exports = class Peer { const { peer_uuid, peer_name, + peer_avatar, peer_presenter, peer_audio, peer_audio_volume, @@ -23,6 +24,7 @@ module.exports = class Peer { this.peer_info = peer_info; this.peer_uuid = peer_uuid; this.peer_name = peer_name; + this.peer_avatar = peer_avatar; this.peer_presenter = peer_presenter; this.peer_audio = peer_audio; this.peer_video = peer_video; diff --git a/app/src/Server.js b/app/src/Server.js index a87adb74..d0672592 100644 --- a/app/src/Server.js +++ b/app/src/Server.js @@ -64,7 +64,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.8.12 + * @version 1.8.13 * */ diff --git a/app/src/ServerApi.js b/app/src/ServerApi.js index 9f600ca5..afb20204 100644 --- a/app/src/ServerApi.js +++ b/app/src/ServerApi.js @@ -68,11 +68,12 @@ module.exports = class ServerApi { getJoinURL(data) { // Get data - const { room, roomPassword, name, audio, video, screen, hide, notify, duration, token } = data; + const { room, roomPassword, name, avatar, audio, video, screen, hide, notify, duration, token } = data; const roomValue = room || uuidV4(); - const nameValue = name || 'User-' + this.getRandomNumber(); const roomPasswordValue = roomPassword || false; + const nameValue = name || 'User-' + this.getRandomNumber(); + const avatarValue = avatar || false; const audioValue = audio || false; const videoValue = video || false; const screenValue = screen || false; @@ -88,6 +89,7 @@ module.exports = class ServerApi { `room=${roomValue}` + `&roomPassword=${roomPasswordValue}` + `&name=${encodeURIComponent(nameValue)}` + + `&avatar=${encodeURIComponent(avatarValue)}` + `&audio=${audioValue}` + `&video=${videoValue}` + `&screen=${screenValue}` + diff --git a/package.json b/package.json index bc3f0224..cd527336 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mirotalksfu", - "version": "1.8.12", + "version": "1.8.13", "description": "WebRTC SFU browser-based video calls", "main": "Server.js", "scripts": { @@ -81,7 +81,7 @@ "mediasoup": "3.15.7", "mediasoup-client": "3.9.5", "nodemailer": "^6.10.0", - "openai": "^4.91.1", + "openai": "^4.92.1", "qs": "6.14.0", "sanitize-filename": "^1.6.3", "socket.io": "4.8.1", @@ -99,7 +99,7 @@ "proxyquire": "^2.1.3", "should": "^13.2.3", "sinon": "^20.0.0", - "webpack": "^5.98.0", + "webpack": "^5.99.1", "webpack-cli": "^6.0.1" } } diff --git a/public/images/admin.png b/public/images/admin.png new file mode 100644 index 00000000..07856acd Binary files /dev/null and b/public/images/admin.png differ diff --git a/public/js/Brand.js b/public/js/Brand.js index 041c0ff6..4dcd51a6 100644 --- a/public/js/Brand.js +++ b/public/js/Brand.js @@ -64,7 +64,7 @@ let BRAND = { }, about: { imageUrl: '../images/mirotalk-logo.gif', - title: 'WebRTC SFU v1.8.12', + title: 'WebRTC SFU v1.8.13', html: `