From 92418deea1b59c770612ced35c9b1ea66759a7c4 Mon Sep 17 00:00:00 2001 From: Miroslav Pejic Date: Tue, 3 Feb 2026 17:05:41 +0100 Subject: [PATCH] [mirotalk] - add room duration --- .env.template | 2 +- README.md | 36 +++++----- app/api/join/join.js | 1 + app/api/join/join.php | 1 + app/api/join/join.py | 1 + app/api/join/join.sh | 1 + app/api/swagger.yaml | 3 + app/src/api.js | 4 +- app/src/config.template.js | 2 +- app/src/server.js | 6 +- package-lock.json | 4 +- package.json | 2 +- public/js/brand.js | 2 +- public/js/client.js | 120 ++++++++++++++++++++++++++------ public/js/customizeRoom.js | 19 ++++- public/js/iframe.js | 2 + public/views/customizeRoom.html | 15 ++++ public/views/iframe.html | 1 + tests/test-api.js | 5 +- widgets/example-5.html | 1 + 20 files changed, 177 insertions(+), 51 deletions(-) diff --git a/.env.template b/.env.template index e0c895d7..4fab1ecc 100644 --- a/.env.template +++ b/.env.template @@ -1,5 +1,5 @@ # ==================================================== -# MiroTalk P2P v.1.7.19 - Environment Configuration +# MiroTalk P2P v.1.7.20 - Environment Configuration # ==================================================== # App environment diff --git a/README.md b/README.md index 72a36a88..cf26385e 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,7 @@ This project is proudly sponsored by - Push-to-talk functionality, similar to a walkie-talkie. - Advanced collaborative whiteboard for teachers. - Real-time sharing of YouTube embed videos, video files (MP4, WebM, OGG), and audio files (MP3). +- Meeting Duration (HH:MM:SS): Set the meeting time in hours, minutes, and seconds for precise duration control. - Full-screen mode with one-click video element zooming and pin/unpin. - Customizable UI themes. - Right-click options on video elements for additional controls. @@ -120,21 +121,22 @@ This project is proudly sponsored by
- You can `directly join a room` by using links like: -- https://p2p.mirotalk.com/join?room=test&name=random&avatar=0&audio=0&video=0&screen=0&chat=0&hide=0¬ify=0 -- https://mirotalk.up.railway.app/join?room=test&name=random&avatar=0&audio=0&video=0&screen=0&chat=0&hide=0¬ify=0 +- https://p2p.mirotalk.com/join?room=test&name=random&avatar=0&audio=0&video=0&screen=0&chat=0&hide=0¬ify=0&duration=unlimited +- https://mirotalk.up.railway.app/join?room=test&name=random&avatar=0&audio=0&video=0&screen=0&chat=0&hide=0¬ify=0&duration=unlimited - | Params | Type | Description | - | ------ | ------- | --------------- | - | room | string | Room Id | - | name | string | User name | - | avatar | Mixed | User avatar | - | audio | boolean | Audio stream | - | video | boolean | Video stream | - | screen | boolean | Screen stream | - | chat. | boolean | Chat | - | hide | boolean | Hide myself | - | notify | boolean | Welcome message | - | token | string | jwt token | + | Params | Type | Description | + | -------- | ------- | ------------------------- | + | room | string | Room Id | + | name | string | User name | + | avatar | Mixed | User avatar | + | audio | boolean | Audio stream | + | video | boolean | Video stream | + | screen | boolean | Screen stream | + | chat. | boolean | Chat | + | hide | boolean | Hide myself | + | notify | boolean | Welcome message | + | duration | string | Meeting duration HH:MM:SS | + | token | string | jwt token | > **Note** > @@ -353,9 +355,9 @@ curl -X POST "https://mirotalk.up.railway.app/api/v1/meeting" -H "authorization: ### 4. Join Meeting (Basic) ```bash -curl -X POST "http://localhost:3000/api/v1/join" -H "authorization: mirotalkp2p_default_secret" -H "Content-Type: application/json" --data '{"room":"test","name":"random","avatar":false,"audio":true,"video":true,"screen":false,"chat":false,"hide":false,"notify":true}' -curl -X POST "https://p2p.mirotalk.com/api/v1/join" -H "authorization: mirotalkp2p_default_secret" -H "Content-Type: application/json" --data '{"room":"test","name":"random","avatar":false,"audio":true,"video":true,"screen":false,"chat":false,"hide":false,"notify":true}' -curl -X POST "https://mirotalk.up.railway.app/api/v1/join" -H "authorization: mirotalkp2p_default_secret" -H "Content-Type: application/json" --data '{"room":"test","name":"random","avatar":false,"audio":true,"video":true,"screen":false,"chat":false,"hide":false,"notify":true}' +curl -X POST "http://localhost:3000/api/v1/join" -H "authorization: mirotalkp2p_default_secret" -H "Content-Type: application/json" --data '{"room":"test","name":"random","avatar":false,"audio":true,"video":true,"screen":false,"chat":false,"hide":false,"notify":true,"duration":"unlimited"}' +curl -X POST "https://p2p.mirotalk.com/api/v1/join" -H "authorization: mirotalkp2p_default_secret" -H "Content-Type: application/json" --data '{"room":"test","name":"random","avatar":false,"audio":true,"video":true,"screen":false,"chat":false,"hide":false,"notify":true,"duration":"unlimited"}' +curl -X POST "https://mirotalk.up.railway.app/api/v1/join" -H "authorization: mirotalkp2p_default_secret" -H "Content-Type: application/json" --data '{"room":"test","name":"random","avatar":false,"audio":true,"video":true,"screen":false,"chat":false,"hide":false,"notify":true,"duration":"unlimited"}' ``` ### 5. Join Meeting with Token diff --git a/app/api/join/join.js b/app/api/join/join.js index ba54764b..e0da7f88 100644 --- a/app/api/join/join.js +++ b/app/api/join/join.js @@ -28,6 +28,7 @@ async function getJoin() { chat: false, hide: false, notify: true, + duration: 'unlimited', token: { username: 'username', password: 'password', diff --git a/app/api/join/join.php b/app/api/join/join.php index 1ed3c04d..a51538d5 100644 --- a/app/api/join/join.php +++ b/app/api/join/join.php @@ -27,6 +27,7 @@ $data = array( "chat" => false, "hide" => false, "notify" => true, + "duration" => "unlimited", "token" => array( "username" => "username", "password" => "password", diff --git a/app/api/join/join.py b/app/api/join/join.py index e20e0afd..87ae4f1d 100644 --- a/app/api/join/join.py +++ b/app/api/join/join.py @@ -22,6 +22,7 @@ data = { "chat": "false", "hide": "false", "notify": "true", + "duration": "unlimited", "token": { "username": "username", "password": "password", diff --git a/app/api/join/join.sh b/app/api/join/join.sh index 15ca89d8..24303cbf 100755 --- a/app/api/join/join.sh +++ b/app/api/join/join.sh @@ -18,6 +18,7 @@ REQUEST_DATA='{ "chat": false, "hide": false, "notify": true, + "duration": "unlimited", "token": { "username": "username", "password": "password", diff --git a/app/api/swagger.yaml b/app/api/swagger.yaml index aa10d0e7..10300958 100644 --- a/app/api/swagger.yaml +++ b/app/api/swagger.yaml @@ -105,6 +105,9 @@ paths: notify: type: boolean default: false + duration: + type: string + default: 'unlimited' token: type: object description: | diff --git a/app/src/api.js b/app/src/api.js index 47b73ea4..35aa8324 100644 --- a/app/src/api.js +++ b/app/src/api.js @@ -58,7 +58,7 @@ module.exports = class ServerApi { getJoinURL(data) { // Get data - const { room, name, avatar, audio, video, screen, chat, notify, hide, token } = data; + const { room, name, avatar, audio, video, screen, chat, notify, hide, duration, token } = data; const roomValue = room || uuidV4(); const nameValue = name || 'User-' + this.getRandomNumber(); @@ -69,6 +69,7 @@ module.exports = class ServerApi { const chatValue = chat || false; const hideValue = hide || false; const notifyValue = notify || false; + const durationValue = duration || 'unlimited'; const jwtToken = token ? '&token=' + this.getToken(token) : ''; const joinURL = @@ -84,6 +85,7 @@ module.exports = class ServerApi { `&chat=${chatValue}` + `&hide=${hideValue}` + `¬ify=${notifyValue}` + + `&duration=${durationValue}` + jwtToken; return joinURL; diff --git a/app/src/config.template.js b/app/src/config.template.js index 00864983..89910d38 100644 --- a/app/src/config.template.js +++ b/app/src/config.template.js @@ -2,7 +2,7 @@ /** * ============================================== - * MiroTalk P2P v.1.7.19 - Configuration File + * MiroTalk P2P v.1.7.20 - Configuration File * ============================================== * * Branding and customizations require a license: diff --git a/app/src/server.js b/app/src/server.js index ba78bfa9..222fb113 100755 --- a/app/src/server.js +++ b/app/src/server.js @@ -45,7 +45,7 @@ dependencies: { * @license For commercial use or closed source, contact us at license.mirotalk@gmail.com or purchase directly from CodeCanyon * @license CodeCanyon: https://codecanyon.net/item/mirotalk-p2p-webrtc-realtime-video-conferences/38376661 * @author Miroslav Pejic - miroslav.pejic.85@gmail.com - * @version 1.7.19 + * @version 1.7.20 * */ @@ -640,10 +640,10 @@ app.get('/join/', async (req, res) => { log.debug('Request Query', req.query); /* http://localhost:3000/join?room=test&name=mirotalk&audio=1&video=1&screen=0&chat=1¬ify=0&hide=0 - https://p2p.mirotalk.com/join?room=test&name=mirotalk&audio=1&video=1&screen=0&chat=1¬ify=0&hide=0 + https://p2p.mirotalk.com/join?room=test&name=mirotalk&audio=1&video=1&screen=0&chat=1¬ify=0&hide=0&duration=00:00:30 https://mirotalk.up.railway.app/join?room=test&name=mirotalk&audio=1&video=1&screen=0&chat=1¬ify=0&hide=0 */ - const { room, name, audio, video, screen, chat, notify, hide, token } = checkXSS(req.query); + const { room, name, audio, video, screen, chat, notify, hide, duration, token } = checkXSS(req.query); if (!room) { log.warn('/join/params room empty', room); diff --git a/package-lock.json b/package-lock.json index 5ee7b9dd..cbab96eb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "mirotalk", - "version": "1.7.19", + "version": "1.7.20", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "mirotalk", - "version": "1.7.19", + "version": "1.7.20", "license": "AGPL-3.0", "dependencies": { "@mattermost/client": "11.3.0", diff --git a/package.json b/package.json index f2317475..944b54ba 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mirotalk", - "version": "1.7.19", + "version": "1.7.20", "description": "A free WebRTC browser-based video call", "main": "server.js", "scripts": { diff --git a/public/js/brand.js b/public/js/brand.js index 4abed967..fa27ecd3 100644 --- a/public/js/brand.js +++ b/public/js/brand.js @@ -79,7 +79,7 @@ let brand = { }, about: { imageUrl: '../images/mirotalk-logo.gif', - title: 'WebRTC P2P v1.7.19', + title: 'WebRTC P2P v1.7.20', html: `