[mirotalk] - improve session time

This commit is contained in:
Miroslav Pejic
2025-12-22 15:08:48 +01:00
parent 1d883bda58
commit 6cbb605997
8 changed files with 65 additions and 33 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
# ====================================================
# MiroTalk P2P v.1.6.96 - Environment Configuration
# MiroTalk P2P v.1.6.97 - Environment Configuration
# ====================================================
# App environment
+1 -1
View File
@@ -2,7 +2,7 @@
/**
* ==============================================
* MiroTalk P2P v.1.6.96 - Configuration File
* MiroTalk P2P v.1.6.97 - Configuration File
* ==============================================
*
* Branding and customizations require a license:
+1 -1
View File
@@ -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.6.96
* @version 1.6.97
*
*/
+7 -17
View File
@@ -1,12 +1,12 @@
{
"name": "mirotalk",
"version": "1.6.96",
"version": "1.6.97",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "mirotalk",
"version": "1.6.96",
"version": "1.6.97",
"license": "AGPL-3.0",
"dependencies": {
"@mattermost/client": "11.2.0",
@@ -29,7 +29,7 @@
"js-yaml": "^4.1.1",
"jsdom": "^27.3.0",
"jsonwebtoken": "^9.0.3",
"nodemailer": "^7.0.11",
"nodemailer": "^7.0.12",
"openai": "^6.15.0",
"qs": "^6.14.0",
"socket.io": "^4.8.1",
@@ -226,7 +226,6 @@
}
],
"license": "MIT",
"peer": true,
"engines": {
"node": ">=18"
},
@@ -271,7 +270,6 @@
}
],
"license": "MIT",
"peer": true,
"engines": {
"node": ">=18"
}
@@ -573,7 +571,6 @@
"resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz",
"integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==",
"license": "Apache-2.0",
"peer": true,
"engines": {
"node": ">=8.0.0"
}
@@ -595,7 +592,6 @@
"resolved": "https://registry.npmjs.org/@opentelemetry/context-async-hooks/-/context-async-hooks-2.2.0.tgz",
"integrity": "sha512-qRkLWiUEZNAmYapZ7KGS5C4OmBLcP/H2foXeOEaowYCR0wi89fHejrfYfbuLVCMLp/dWZXKvQusdbUEZjERfwQ==",
"license": "Apache-2.0",
"peer": true,
"engines": {
"node": "^18.19.0 || >=20.6.0"
},
@@ -608,7 +604,6 @@
"resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-2.2.0.tgz",
"integrity": "sha512-FuabnnUm8LflnieVxs6eP7Z383hgQU4W1e3KJS6aOG3RxWxcHyBxH8fDMHNgu/gFx/M2jvTOW/4/PHhLz6bjWw==",
"license": "Apache-2.0",
"peer": true,
"dependencies": {
"@opentelemetry/semantic-conventions": "^1.29.0"
},
@@ -624,7 +619,6 @@
"resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.208.0.tgz",
"integrity": "sha512-Eju0L4qWcQS+oXxi6pgh7zvE2byogAkcsVv0OjHF/97iOz1N/aKE6etSGowYkie+YA1uo6DNwdSxaaNnLvcRlA==",
"license": "Apache-2.0",
"peer": true,
"dependencies": {
"@opentelemetry/api-logs": "0.208.0",
"import-in-the-middle": "^2.0.0",
@@ -1012,7 +1006,6 @@
"resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-2.2.0.tgz",
"integrity": "sha512-1pNQf/JazQTMA0BiO5NINUzH0cbLbbl7mntLa4aJNmCCXSj0q03T5ZXXL0zw4G55TjdL9Tz32cznGClf+8zr5A==",
"license": "Apache-2.0",
"peer": true,
"dependencies": {
"@opentelemetry/core": "2.2.0",
"@opentelemetry/semantic-conventions": "^1.29.0"
@@ -1029,7 +1022,6 @@
"resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-2.2.0.tgz",
"integrity": "sha512-xWQgL0Bmctsalg6PaXExmzdedSp3gyKV8mQBwK/j9VGdCDu2fmXIb2gAehBKbkXCpJ4HPkgv3QfoJWRT4dHWbw==",
"license": "Apache-2.0",
"peer": true,
"dependencies": {
"@opentelemetry/core": "2.2.0",
"@opentelemetry/resources": "2.2.0",
@@ -1047,7 +1039,6 @@
"resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.38.0.tgz",
"integrity": "sha512-kocjix+/sSggfJhwXqClZ3i9Y/MI0fp7b+g7kCRm6psy2dsf8uApTRclwG18h8Avm7C9+fnt+O36PspJ/OzoWg==",
"license": "Apache-2.0",
"peer": true,
"engines": {
"node": ">=14"
}
@@ -1431,7 +1422,6 @@
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz",
"integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",
"license": "MIT",
"peer": true,
"bin": {
"acorn": "bin/acorn"
},
@@ -2742,7 +2732,6 @@
"resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz",
"integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==",
"license": "MIT",
"peer": true,
"dependencies": {
"accepts": "^2.0.0",
"body-parser": "^2.2.1",
@@ -4697,6 +4686,7 @@
}
],
"license": "MIT",
"peer": true,
"bin": {
"nanoid": "bin/nanoid.cjs"
},
@@ -4753,9 +4743,9 @@
}
},
"node_modules/nodemailer": {
"version": "7.0.11",
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-7.0.11.tgz",
"integrity": "sha512-gnXhNRE0FNhD7wPSCGhdNh46Hs6nm+uTyg+Kq0cZukNQiYdnCsoQjodNP9BQVG9XrcK/v6/MgpAPBUFyzh9pvw==",
"version": "7.0.12",
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-7.0.12.tgz",
"integrity": "sha512-H+rnK5bX2Pi/6ms3sN4/jRQvYSMltV6vqup/0SFOrxYYY/qoNvhXPlYq3e+Pm9RFJRwrMGbMIwi81M4dxpomhA==",
"license": "MIT-0",
"engines": {
"node": ">=6.0.0"
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "mirotalk",
"version": "1.6.96",
"version": "1.6.97",
"description": "A free WebRTC browser-based video call",
"main": "server.js",
"scripts": {
@@ -61,7 +61,7 @@
"js-yaml": "^4.1.1",
"jsdom": "^27.3.0",
"jsonwebtoken": "^9.0.3",
"nodemailer": "^7.0.11",
"nodemailer": "^7.0.12",
"openai": "^6.15.0",
"qs": "^6.14.0",
"socket.io": "^4.8.1",
+16 -4
View File
@@ -217,16 +217,22 @@ body {
background: var(--body-bg);
}
/*--------------------------------------------------------------
# Right extra buttons after my settings
--------------------------------------------------------------*/
.fa-phone-slash,
.fa-microphone-slash,
.fa-video-slash {
color: red !important;
}
/*--------------------------------------------------------------
# Session Time
--------------------------------------------------------------*/
#myCurrentSessionTime {
font-size: 14px;
color: white;
margin-right: 5px;
}
/*--------------------------------------------------------------
# Bottom buttons
--------------------------------------------------------------*/
@@ -495,6 +501,9 @@ body {
top: 1px;
right: 1px;
}
#myCurrentSessionTime {
font-size: 12px;
}
}
@media (max-width: 400px) {
@@ -505,6 +514,9 @@ body {
top: 0px;
right: 0px;
}
#myCurrentSessionTime {
font-size: 10px;
}
}
/*--------------------------------------------------------------
+1 -1
View File
@@ -77,7 +77,7 @@ let brand = {
},
about: {
imageUrl: '../images/mirotalk-logo.gif',
title: 'WebRTC P2P v1.6.96',
title: 'WebRTC P2P v1.6.97',
html: `
<button
id="support-button"
+36 -6
View File
@@ -15,7 +15,7 @@
* @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.6.96
* @version 1.6.97
*
*/
@@ -541,7 +541,6 @@ let thisMaxRoomParticipants = 8;
// misc
let swBg = 'rgba(0, 0, 0, 0.7)'; // swAlert background color
let callElapsedTime; // count time
let isDocumentOnFullScreen = false;
let isToggleExtraBtnClicked = false;
@@ -3560,6 +3559,7 @@ async function loadLocalMedia(stream, kind) {
// html elements
const myVideoNavBar = document.createElement('div');
const myCurrentSessionTime = document.createElement('span');
const myVideoPeerName = document.createElement('p');
const myHandStatusIcon = document.createElement('button');
const myVideoToImgBtn = document.createElement('button');
@@ -3577,6 +3577,10 @@ async function loadLocalMedia(stream, kind) {
const myPitchMeter = document.createElement('div');
const myPitchBar = document.createElement('div');
//my current session time
myCurrentSessionTime.setAttribute('id', 'myCurrentSessionTime');
myCurrentSessionTime.className = 'notranslate';
// my peer name
myVideoPeerName.setAttribute('id', 'myVideoPeerName');
myVideoPeerName.className = 'videoPeerName notranslate';
@@ -3660,6 +3664,8 @@ async function loadLocalMedia(stream, kind) {
// my video nav bar
myVideoNavBar.className = 'navbar fadein';
myVideoNavBar.appendChild(myCurrentSessionTime);
!isMobileDevice && myVideoNavBar.appendChild(myVideoPinBtn);
buttons.local.showVideoFocusBtn && myVideoNavBar.appendChild(myVideoFocusBtn);
@@ -5354,11 +5360,17 @@ function takeSnapshot(video) {
* Start session time
*/
function startSessionTime() {
callElapsedTime = 0;
let callStartTime = Date.now();
let callElapsedSecondsTime = 0;
elemDisplay(mySessionTime, true);
setInterval(function printTime() {
callElapsedTime++;
mySessionTime.innerText = secondsToHms(callElapsedTime);
callElapsedSecondsTime++;
let callElapsedTime = Date.now() - callStartTime;
mySessionTime.innerText = getTimeToString(callElapsedTime);
const myCurrentSessionTime = getId('myCurrentSessionTime');
if (myCurrentSessionTime) {
myCurrentSessionTime.innerText = secondsToHms(callElapsedSecondsTime);
}
}, 1000);
}
@@ -8330,6 +8342,24 @@ function handleRecordingError(error, popupLog = true) {
if (popupLog) userLog('error', error);
}
/**
* Get time to string HH:MM:SS
* @param {number} time in milliseconds
* @return {string} format HH:MM:SS
*/
function getTimeToString(time) {
let diffInHrs = time / 3600000;
let hh = Math.floor(diffInHrs);
let diffInMin = (diffInHrs - hh) * 60;
let mm = Math.floor(diffInMin);
let diffInSec = (diffInMin - mm) * 60;
let ss = Math.floor(diffInSec);
let formattedHH = hh.toString().padStart(2, '0');
let formattedMM = mm.toString().padStart(2, '0');
let formattedSS = ss.toString().padStart(2, '0');
return `${formattedHH}:${formattedMM}:${formattedSS}`;
}
/**
* Seconds to HMS
* @param {number} d
@@ -13516,7 +13546,7 @@ function showAbout() {
Swal.fire({
background: swBg,
position: 'center',
title: brand.about?.title && brand.about.title.trim() !== '' ? brand.about.title : 'WebRTC P2P v1.6.96',
title: brand.about?.title && brand.about.title.trim() !== '' ? brand.about.title : 'WebRTC P2P v1.6.97',
imageUrl: brand.about?.imageUrl && brand.about.imageUrl.trim() !== '' ? brand.about.imageUrl : images.about,
customClass: { image: 'img-about' },
html: `