Skip to content

Commit f97c875

Browse files
[mirotalksfu] - improve geoLocation error handle, update dep
1 parent a10bbcd commit f97c875

File tree

8 files changed

+41
-17
lines changed

8 files changed

+41
-17
lines changed

.env.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ====================================================
2-
# MiroTalk SFU v.2.0.39 - Environment Configuration
2+
# MiroTalk SFU v.2.0.40 - Environment Configuration
33
# ====================================================
44

55
# config.js - Main configuration with:

app/src/Server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ dev dependencies: {
6464
* @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon
6565
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
6666
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
67-
* @version 2.0.39
67+
* @version 2.0.40
6868
*
6969
*/
7070

app/src/config.template.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
/**
44
* ==============================================
5-
* MiroTalk SFU v2.0.39 - Configuration File
5+
* MiroTalk SFU v2.0.40 - Configuration File
66
* ==============================================
77
*
88
* This file contains all configurable settings for the MiroTalk SFU application.

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mirotalksfu",
3-
"version": "2.0.39",
3+
"version": "2.0.40",
44
"description": "WebRTC SFU browser-based video calls",
55
"main": "Server.js",
66
"scripts": {
@@ -100,7 +100,7 @@
100100
"mocha": "^11.7.5",
101101
"node-fetch": "^3.3.2",
102102
"nodemon": "^3.1.11",
103-
"prettier": "3.7.2",
103+
"prettier": "3.7.3",
104104
"proxyquire": "^2.1.3",
105105
"should": "^13.2.3",
106106
"sinon": "^21.0.0",

public/js/Brand.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ let BRAND = {
8080
},
8181
about: {
8282
imageUrl: '../images/mirotalk-logo.gif',
83-
title: '<strong>WebRTC SFU v2.0.39</strong>',
83+
title: '<strong>WebRTC SFU v2.0.40</strong>',
8484
html: `
8585
<button
8686
id="support-button"

public/js/Room.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ if (location.href.substr(0, 5) !== 'https') location.href = 'https' + location.h
1111
* @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon
1212
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
1313
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
14-
* @version 2.0.39
14+
* @version 2.0.40
1515
*
1616
*/
1717

@@ -5835,7 +5835,7 @@ function showAbout() {
58355835
position: 'center',
58365836
imageUrl: BRAND.about?.imageUrl && BRAND.about.imageUrl.trim() !== '' ? BRAND.about.imageUrl : image.about,
58375837
customClass: { image: 'img-about' },
5838-
title: BRAND.about?.title && BRAND.about.title.trim() !== '' ? BRAND.about.title : 'WebRTC SFU v2.0.39',
5838+
title: BRAND.about?.title && BRAND.about.title.trim() !== '' ? BRAND.about.title : 'WebRTC SFU v2.0.40',
58395839
html: `
58405840
<br />
58415841
<div id="about">

public/js/RoomClient.js

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon
1010
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
1111
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
12-
* @version 2.0.39
12+
* @version 2.0.40
1313
*
1414
*/
1515

@@ -425,6 +425,14 @@ class RoomClient {
425425
this.debug = false;
426426
this.debug ? window.localStorage.setItem('debug', 'mediasoup*') : window.localStorage.removeItem('debug');
427427

428+
// TEST PURPOSES
429+
this.test = {
430+
device: {
431+
enabled: false,
432+
handlerName: 'Chrome111', // |Chrome74|Firefox120|Safari12|ReactNative106|
433+
},
434+
};
435+
428436
console.log('06 ----> Load MediaSoup Client v', mediasoupClient.version);
429437
console.log('06.1 ----> PEER_ID', this.peer_id);
430438

@@ -789,8 +797,10 @@ class RoomClient {
789797

790798
let device;
791799
try {
792-
device = await this.mediasoupClient.Device.factory();
793-
// device = await this.mediasoupClient.Device.factory({ handlerName: 'Safari12' }); // for testing only
800+
device = this.test.device.enabled
801+
? await this.mediasoupClient.Device.factory({ handlerName: this.test.device.handlerName })
802+
: await this.mediasoupClient.Device.factory();
803+
794804
console.log('Device created successfully:', device.handlerName);
795805
} catch (error) {
796806
if (error.name === 'UnsupportedError') {
@@ -9884,9 +9894,23 @@ class RoomClient {
98849894
case error.UNKNOWN_ERROR:
98859895
geoError = 'An unknown error occurred';
98869896
break;
9897+
case 'NOT_SUPPORTED':
9898+
geoError = 'Geolocation is not supported by this browser';
9899+
break;
98879900
default:
9901+
geoError =
9902+
'Unable to retrieve your location. Please ensure location services are enabled in your device and browser settings, and try again';
98889903
break;
98899904
}
9905+
// Add suggestion for unknown errors
9906+
if (
9907+
error.code === error.UNKNOWN_ERROR ||
9908+
error.code === undefined ||
9909+
geoError.startsWith('Unable to retrieve')
9910+
) {
9911+
geoError +=
9912+
' If the problem persists, check your device and browser location permissions, and ensure you have a clear view of the sky (for GPS)';
9913+
}
98909914
rc.sendPeerGeoLocation(peer_id, 'geoLocationKO', `${rc.peer_name}: ${geoError}`);
98919915
rc.userLog('warning', geoError, 'top-end', 5000);
98929916
},

0 commit comments

Comments
 (0)