@snapcall/stream-ui 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/stream-ui.esm.js +576 -344
- package/dist/stream-ui.js +576 -344
- package/dist/stream-ui.umd.js +233 -162
- package/dist/types.d.ts +81 -48
- package/package.json +1 -1
package/dist/stream-ui.js
CHANGED
|
@@ -9,6 +9,7 @@ var $jQDcL$uuid = require("uuid");
|
|
|
9
9
|
var $jQDcL$protooclient = require("protoo-client");
|
|
10
10
|
var $jQDcL$mediasoupclient = require("mediasoup-client");
|
|
11
11
|
var $jQDcL$sentrybrowser = require("@sentry/browser");
|
|
12
|
+
var $jQDcL$mediasoupclientlibProducer = require("mediasoup-client/lib/Producer");
|
|
12
13
|
var $jQDcL$qrcode = require("qrcode");
|
|
13
14
|
|
|
14
15
|
function $parcel$export(e, n, v, s) {
|
|
@@ -517,6 +518,7 @@ const $3575c8a563f2a1da$export$4a210166cc9cb64b = async (src)=>{
|
|
|
517
518
|
|
|
518
519
|
|
|
519
520
|
|
|
521
|
+
|
|
520
522
|
const $1dedebd5ff3002eb$export$818d60b2e626da0c = {
|
|
521
523
|
WEBRTC_FAILED: "WRTC1",
|
|
522
524
|
WEBRTC_RECOVER_ERROR: "WRTC2",
|
|
@@ -531,7 +533,8 @@ const $1dedebd5ff3002eb$export$d21ffcc5eb136bfa = {
|
|
|
531
533
|
},
|
|
532
534
|
height: {
|
|
533
535
|
ideal: 240
|
|
534
|
-
}
|
|
536
|
+
},
|
|
537
|
+
qualityIndex: 3
|
|
535
538
|
},
|
|
536
539
|
vga: {
|
|
537
540
|
width: {
|
|
@@ -539,7 +542,8 @@ const $1dedebd5ff3002eb$export$d21ffcc5eb136bfa = {
|
|
|
539
542
|
},
|
|
540
543
|
height: {
|
|
541
544
|
ideal: 480
|
|
542
|
-
}
|
|
545
|
+
},
|
|
546
|
+
qualityIndex: 2
|
|
543
547
|
},
|
|
544
548
|
hd: {
|
|
545
549
|
width: {
|
|
@@ -547,7 +551,8 @@ const $1dedebd5ff3002eb$export$d21ffcc5eb136bfa = {
|
|
|
547
551
|
},
|
|
548
552
|
height: {
|
|
549
553
|
ideal: 720
|
|
550
|
-
}
|
|
554
|
+
},
|
|
555
|
+
qualityIndex: 1
|
|
551
556
|
}
|
|
552
557
|
};
|
|
553
558
|
const $1dedebd5ff3002eb$var$WEBCAM_SIMULCAST_ENCODINGS = [
|
|
@@ -574,19 +579,12 @@ const $1dedebd5ff3002eb$var$SCREEN_SHARING_SIMULCAST_ENCODINGS = [
|
|
|
574
579
|
maxBitrate: 6000000
|
|
575
580
|
},
|
|
576
581
|
];
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
}
|
|
584
|
-
}).then((response)=>{
|
|
585
|
-
if (response.ok) return response.json();
|
|
586
|
-
throw new Error("Invalid agent info");
|
|
587
|
-
});
|
|
588
|
-
return agent;
|
|
589
|
-
};
|
|
582
|
+
class $1dedebd5ff3002eb$var$SnapcallEvent extends CustomEvent {
|
|
583
|
+
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
584
|
+
constructor(name, data){
|
|
585
|
+
super(name, data);
|
|
586
|
+
}
|
|
587
|
+
}
|
|
590
588
|
const $1dedebd5ff3002eb$var$StreamerEventTargetType = EventTarget;
|
|
591
589
|
class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$StreamerEventTargetType {
|
|
592
590
|
pendingDeviceRequest = {};
|
|
@@ -595,14 +593,19 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
|
|
|
595
593
|
constructor(){
|
|
596
594
|
super();
|
|
597
595
|
navigator.mediaDevices.addEventListener("devicechange", ()=>this.onDeviceChange());
|
|
598
|
-
this.
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
596
|
+
this.config = {
|
|
597
|
+
apiUrl: String("https://api.snapcall.io/v2"),
|
|
598
|
+
streamerServer: String("wss://g.snapcall.io/stream"),
|
|
599
|
+
streamerApi: String("https://g.snapcall.io/stream"),
|
|
600
|
+
iceServers: [
|
|
601
|
+
{
|
|
602
|
+
urls: "turns:t.snapcall.io:443?transport=tcp,turns:t2.snapcall.io:443?transport=tcp"?.split(",") || [],
|
|
603
|
+
username: "test",
|
|
604
|
+
credential: "test",
|
|
605
|
+
credentialType: "password"
|
|
606
|
+
},
|
|
607
|
+
]
|
|
608
|
+
};
|
|
606
609
|
this.peers = new Map();
|
|
607
610
|
this.consumers = new Map();
|
|
608
611
|
this.webcams = new Map();
|
|
@@ -623,6 +626,7 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
|
|
|
623
626
|
this.screenshareProducer = null;
|
|
624
627
|
this.customMessages = new Map();
|
|
625
628
|
this.audioRenderers = {};
|
|
629
|
+
this.profile = {};
|
|
626
630
|
}
|
|
627
631
|
getState() {
|
|
628
632
|
const peers = [];
|
|
@@ -648,14 +652,14 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
|
|
|
648
652
|
});
|
|
649
653
|
peers.push({
|
|
650
654
|
peerId: key,
|
|
651
|
-
|
|
655
|
+
profile: peer.profile,
|
|
652
656
|
deviceState: deviceState
|
|
653
657
|
});
|
|
654
658
|
});
|
|
655
659
|
return {
|
|
656
660
|
roomId: this.roomId,
|
|
657
661
|
peerId: this.peerId,
|
|
658
|
-
|
|
662
|
+
profile: this.profile,
|
|
659
663
|
callId: undefined,
|
|
660
664
|
deviceState: this.getDevicesState(),
|
|
661
665
|
peers: peers
|
|
@@ -663,9 +667,10 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
|
|
|
663
667
|
}
|
|
664
668
|
onStartSpeak() {
|
|
665
669
|
if (this.micProducer && !this.micProducer.paused) {
|
|
666
|
-
const event = new
|
|
670
|
+
const event = new $1dedebd5ff3002eb$var$SnapcallEvent("localStartSpeak", {
|
|
667
671
|
cancelable: true,
|
|
668
|
-
bubbles: true
|
|
672
|
+
bubbles: true,
|
|
673
|
+
detail: {}
|
|
669
674
|
});
|
|
670
675
|
this.dispatchEvent(event);
|
|
671
676
|
this.protoo.notify("startSpeak");
|
|
@@ -673,13 +678,15 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
|
|
|
673
678
|
}
|
|
674
679
|
onStopSpeak() {
|
|
675
680
|
if (this.micProducer && !this.micProducer.paused) {
|
|
676
|
-
const event = new
|
|
681
|
+
const event = new $1dedebd5ff3002eb$var$SnapcallEvent("localStopSpeak", {
|
|
682
|
+
detail: {}
|
|
683
|
+
});
|
|
677
684
|
this.dispatchEvent(event);
|
|
678
685
|
this.protoo.notify("stopSpeak");
|
|
679
686
|
}
|
|
680
687
|
}
|
|
681
688
|
onCriticalError(code) {
|
|
682
|
-
const event = new
|
|
689
|
+
const event = new $1dedebd5ff3002eb$var$SnapcallEvent("criticalError", {
|
|
683
690
|
detail: {
|
|
684
691
|
code: code
|
|
685
692
|
}
|
|
@@ -687,7 +694,7 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
|
|
|
687
694
|
this.dispatchEvent(event);
|
|
688
695
|
}
|
|
689
696
|
async generateToken(bid) {
|
|
690
|
-
const url =
|
|
697
|
+
const url = this.config.streamerApi;
|
|
691
698
|
const { token: token } = await fetch(`${url}/stream`, {
|
|
692
699
|
method: "post",
|
|
693
700
|
headers: {
|
|
@@ -706,7 +713,7 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
|
|
|
706
713
|
if (!this.peerId) this.peerId = (0, $jQDcL$uuid.v4)();
|
|
707
714
|
let url;
|
|
708
715
|
try {
|
|
709
|
-
const { instanceId: instanceId } = await fetch(`${
|
|
716
|
+
const { instanceId: instanceId } = await fetch(`${this.config.streamerApi}/instance/${this.roomId}`, {
|
|
710
717
|
method: "get",
|
|
711
718
|
headers: {
|
|
712
719
|
"Content-Type": "application/json"
|
|
@@ -715,9 +722,11 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
|
|
|
715
722
|
if (response.ok) return response.json();
|
|
716
723
|
throw new Error("Invalid room ID");
|
|
717
724
|
});
|
|
718
|
-
url = `${
|
|
725
|
+
url = `${this.config.streamerServer}/${instanceId}/?roomId=${room}&peerId=${this.peerId}`;
|
|
719
726
|
} catch (roomError) {
|
|
720
|
-
const event = new
|
|
727
|
+
const event = new $1dedebd5ff3002eb$var$SnapcallEvent("invalidRoom", {
|
|
728
|
+
detail: {}
|
|
729
|
+
});
|
|
721
730
|
this.dispatchEvent(event);
|
|
722
731
|
}
|
|
723
732
|
if (!url) throw new Error("Invalid socket URL");
|
|
@@ -743,17 +752,18 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
|
|
|
743
752
|
this.protoo.on("notification", async (notification)=>{
|
|
744
753
|
console.log("notification", notification);
|
|
745
754
|
if (notification.method === "newPeer") {
|
|
746
|
-
const { id: id ,
|
|
755
|
+
const { id: id , profile: profile } = notification.data;
|
|
747
756
|
this.peers.set(id, {
|
|
748
757
|
id: id,
|
|
749
758
|
peerId: id,
|
|
750
|
-
|
|
759
|
+
profile: profile,
|
|
751
760
|
producersData: []
|
|
752
761
|
});
|
|
753
|
-
const event = new
|
|
762
|
+
const event = new $1dedebd5ff3002eb$var$SnapcallEvent("newPeer", {
|
|
754
763
|
detail: {
|
|
755
764
|
peerId: id,
|
|
756
|
-
displayName:
|
|
765
|
+
displayName: profile.name,
|
|
766
|
+
profile: profile
|
|
757
767
|
}
|
|
758
768
|
});
|
|
759
769
|
this.dispatchEvent(event);
|
|
@@ -773,7 +783,7 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
|
|
|
773
783
|
consumerId: consumer.id
|
|
774
784
|
});
|
|
775
785
|
});
|
|
776
|
-
const event = new
|
|
786
|
+
const event = new $1dedebd5ff3002eb$var$SnapcallEvent("peerClosed", {
|
|
777
787
|
detail: {
|
|
778
788
|
peerId: peerId
|
|
779
789
|
}
|
|
@@ -786,39 +796,60 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
|
|
|
786
796
|
});
|
|
787
797
|
} else if (notification.method === "displayName") {
|
|
788
798
|
const { peerId: peerId , displayName: displayName } = notification.data;
|
|
789
|
-
const event = new
|
|
799
|
+
const event = new $1dedebd5ff3002eb$var$SnapcallEvent("displayName", {
|
|
800
|
+
detail: {
|
|
801
|
+
peerId: peerId,
|
|
802
|
+
displayName: displayName,
|
|
803
|
+
profile: {}
|
|
804
|
+
}
|
|
805
|
+
});
|
|
806
|
+
this.dispatchEvent(event);
|
|
807
|
+
} else if (notification.method === "profile") {
|
|
808
|
+
const { peerId: peerId , profile: profile } = notification.data;
|
|
809
|
+
const event = new CustomEvent("profileUpdate", {
|
|
790
810
|
detail: {
|
|
791
811
|
peerId: peerId,
|
|
792
|
-
|
|
812
|
+
profile: profile
|
|
793
813
|
}
|
|
794
814
|
});
|
|
795
815
|
this.dispatchEvent(event);
|
|
796
816
|
} else if (notification.method === "requestDevice") {
|
|
797
817
|
this.pendingDeviceRequest[notification.data.requestId] = notification.data;
|
|
798
|
-
const event = new
|
|
818
|
+
const event = new $1dedebd5ff3002eb$var$SnapcallEvent("requestDevice", {
|
|
799
819
|
detail: notification.data
|
|
800
820
|
});
|
|
801
821
|
this.dispatchEvent(event);
|
|
802
822
|
} else if (notification.method === "startSpeak") ;
|
|
803
823
|
else if (notification.method === "stopSpeak") ;
|
|
804
824
|
else if (notification.method === "producerPaused" || notification.method === "producerResumed") {
|
|
825
|
+
const { peerId: peerId , producerId: producerId , deviceType: deviceType } = notification.data;
|
|
805
826
|
if (notification.data?.deviceType === "microphone") {
|
|
806
|
-
const { peerId: peerId , producerId: producerId } = notification.data;
|
|
807
827
|
const microphoneData = this.peers.get(peerId)?.producersData.find((ele)=>producerId === ele.producerId);
|
|
808
828
|
if (microphoneData) microphoneData.paused = notification.method === "producerPaused" ? true : false;
|
|
809
829
|
}
|
|
810
|
-
|
|
811
|
-
|
|
830
|
+
let id = producerId;
|
|
831
|
+
for (let [, value] of Array.from(this.consumers.entries()))if (value.mediaSoupConsumer.producerId === producerId) {
|
|
832
|
+
id = value.mediaSoupConsumer.id;
|
|
833
|
+
break;
|
|
834
|
+
}
|
|
835
|
+
const eventName = notification.method === "producerPaused" ? "mediaPause" : "mediaResume";
|
|
836
|
+
const event = new $1dedebd5ff3002eb$var$SnapcallEvent(eventName, {
|
|
837
|
+
detail: {
|
|
838
|
+
mediaId: id,
|
|
839
|
+
peerId: peerId,
|
|
840
|
+
deviceType: deviceType,
|
|
841
|
+
paused: notification.method === "producerPaused"
|
|
842
|
+
}
|
|
812
843
|
});
|
|
813
844
|
this.dispatchEvent(event);
|
|
814
845
|
} else if (notification.method === "requestDeviceResult") {
|
|
815
|
-
const event = new
|
|
846
|
+
const event = new $1dedebd5ff3002eb$var$SnapcallEvent(notification.method, {
|
|
816
847
|
detail: notification.data
|
|
817
848
|
});
|
|
818
849
|
this.dispatchEvent(event);
|
|
819
850
|
} else if (notification.method === "terminateRoom") {
|
|
820
851
|
this.release();
|
|
821
|
-
const event = new
|
|
852
|
+
const event = new $1dedebd5ff3002eb$var$SnapcallEvent(notification.method, {
|
|
822
853
|
detail: notification.data
|
|
823
854
|
});
|
|
824
855
|
this.dispatchEvent(event);
|
|
@@ -843,7 +874,7 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
|
|
|
843
874
|
const sortedChunks = message.chunks.sort((a, b)=>a.index - b.index);
|
|
844
875
|
const mergedChunks = sortedChunks.reduce((originalMessage, chunk)=>originalMessage + chunk.data, "");
|
|
845
876
|
const parsedEvent = JSON.parse(mergedChunks);
|
|
846
|
-
const event = new
|
|
877
|
+
const event = new $1dedebd5ff3002eb$var$SnapcallEvent("customMessage", {
|
|
847
878
|
detail: {
|
|
848
879
|
...notification.data,
|
|
849
880
|
event: parsedEvent
|
|
@@ -902,7 +933,7 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
|
|
|
902
933
|
role: "auto"
|
|
903
934
|
},
|
|
904
935
|
sctpParameters: transportInfo.sctpParameters,
|
|
905
|
-
iceServers: this.iceServers,
|
|
936
|
+
iceServers: this.config.iceServers,
|
|
906
937
|
proprietaryConstraints: {
|
|
907
938
|
optional: [
|
|
908
939
|
{
|
|
@@ -1009,11 +1040,11 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
|
|
|
1009
1040
|
}
|
|
1010
1041
|
// now we join
|
|
1011
1042
|
if (this.joinOptions.apiKey && this.joinOptions.email) try {
|
|
1012
|
-
const agentInfo = await
|
|
1043
|
+
const agentInfo = await this.fetchAgentInfo({
|
|
1013
1044
|
apiKey: this.joinOptions.apiKey,
|
|
1014
1045
|
email: this.joinOptions.email
|
|
1015
1046
|
});
|
|
1016
|
-
if (agentInfo) this.dispatchEvent(new
|
|
1047
|
+
if (agentInfo) this.dispatchEvent(new $1dedebd5ff3002eb$var$SnapcallEvent("agentIdentity", {
|
|
1017
1048
|
detail: {
|
|
1018
1049
|
success: true,
|
|
1019
1050
|
email: this.joinOptions.email
|
|
@@ -1021,7 +1052,7 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
|
|
|
1021
1052
|
}));
|
|
1022
1053
|
} catch (agentInfoError) {
|
|
1023
1054
|
console.warn(agentInfoError);
|
|
1024
|
-
this.dispatchEvent(new
|
|
1055
|
+
this.dispatchEvent(new $1dedebd5ff3002eb$var$SnapcallEvent("agentIdentity", {
|
|
1025
1056
|
detail: {
|
|
1026
1057
|
success: false
|
|
1027
1058
|
}
|
|
@@ -1039,7 +1070,7 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
|
|
|
1039
1070
|
},
|
|
1040
1071
|
]));
|
|
1041
1072
|
const callId = await this.getCallId();
|
|
1042
|
-
this.dispatchEvent(new
|
|
1073
|
+
this.dispatchEvent(new $1dedebd5ff3002eb$var$SnapcallEvent("enterRoom", {
|
|
1043
1074
|
detail: {
|
|
1044
1075
|
peerId: this.peerId,
|
|
1045
1076
|
peers: peers.map((peer)=>{
|
|
@@ -1053,6 +1084,7 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
|
|
|
1053
1084
|
}));
|
|
1054
1085
|
console.log("peers", peers);
|
|
1055
1086
|
if (this.joinOptions.displayName) await this.setDisplayName(this.joinOptions.displayName);
|
|
1087
|
+
if (this.joinOptions.profile) await this.setProfile(this.joinOptions.profile);
|
|
1056
1088
|
// Consume Peers
|
|
1057
1089
|
peers.forEach((peer)=>{
|
|
1058
1090
|
this.consumePeer({
|
|
@@ -1093,7 +1125,9 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
|
|
|
1093
1125
|
const producerId = this.micProducer?.id;
|
|
1094
1126
|
this.micProducer?.close();
|
|
1095
1127
|
this.micProducer = undefined;
|
|
1096
|
-
const event = new
|
|
1128
|
+
const event = new $1dedebd5ff3002eb$var$SnapcallEvent("microphoneMute", {
|
|
1129
|
+
detail: {}
|
|
1130
|
+
});
|
|
1097
1131
|
this.dispatchEvent(event);
|
|
1098
1132
|
await this.protoo.request("closeProducer", {
|
|
1099
1133
|
producerId: producerId
|
|
@@ -1101,7 +1135,9 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
|
|
|
1101
1135
|
}
|
|
1102
1136
|
async onDeviceChange() {
|
|
1103
1137
|
console.log("detecting device change");
|
|
1104
|
-
const deviceListChangeEvent = new
|
|
1138
|
+
const deviceListChangeEvent = new $1dedebd5ff3002eb$var$SnapcallEvent("devicesListChange", {
|
|
1139
|
+
detail: {}
|
|
1140
|
+
});
|
|
1105
1141
|
this.dispatchEvent(deviceListChangeEvent);
|
|
1106
1142
|
if (!this.protoo.closed && this.micProducer) {
|
|
1107
1143
|
const lists = await navigator.mediaDevices.enumerateDevices();
|
|
@@ -1128,7 +1164,7 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
|
|
|
1128
1164
|
}
|
|
1129
1165
|
console.log("detecting audio input change");
|
|
1130
1166
|
if (!this.audioInputDefaultDevice || this.audioInputDefaultDevice.label !== defaultDevice.label) {
|
|
1131
|
-
const event = new
|
|
1167
|
+
const event = new $1dedebd5ff3002eb$var$SnapcallEvent("defaultAudioDeviceChange", {
|
|
1132
1168
|
detail: defaultDevice
|
|
1133
1169
|
});
|
|
1134
1170
|
this.audioInputDefaultDevice = defaultDevice;
|
|
@@ -1175,7 +1211,9 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
|
|
|
1175
1211
|
});
|
|
1176
1212
|
this.micProducer = micProducer;
|
|
1177
1213
|
this.muted = false;
|
|
1178
|
-
const event = new
|
|
1214
|
+
const event = new $1dedebd5ff3002eb$var$SnapcallEvent("microphoneEnabled", {
|
|
1215
|
+
detail: {}
|
|
1216
|
+
});
|
|
1179
1217
|
this.dispatchEvent(event);
|
|
1180
1218
|
}
|
|
1181
1219
|
}
|
|
@@ -1187,7 +1225,9 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
|
|
|
1187
1225
|
producerId: this.micProducer?.id
|
|
1188
1226
|
});
|
|
1189
1227
|
this.muted = true;
|
|
1190
|
-
const event = new
|
|
1228
|
+
const event = new $1dedebd5ff3002eb$var$SnapcallEvent("microphoneMute", {
|
|
1229
|
+
detail: {}
|
|
1230
|
+
});
|
|
1191
1231
|
this.dispatchEvent(event);
|
|
1192
1232
|
}
|
|
1193
1233
|
}
|
|
@@ -1199,7 +1239,9 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
|
|
|
1199
1239
|
producerId: this.micProducer.id
|
|
1200
1240
|
});
|
|
1201
1241
|
this.muted = false;
|
|
1202
|
-
const event = new
|
|
1242
|
+
const event = new $1dedebd5ff3002eb$var$SnapcallEvent("microphoneUnmute", {
|
|
1243
|
+
detail: {}
|
|
1244
|
+
});
|
|
1203
1245
|
this.dispatchEvent(event);
|
|
1204
1246
|
}
|
|
1205
1247
|
}
|
|
@@ -1237,10 +1279,12 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
|
|
|
1237
1279
|
}
|
|
1238
1280
|
endCall() {
|
|
1239
1281
|
this.release();
|
|
1240
|
-
const event = new
|
|
1282
|
+
const event = new $1dedebd5ff3002eb$var$SnapcallEvent("leaveRoom", {
|
|
1283
|
+
detail: {}
|
|
1284
|
+
});
|
|
1241
1285
|
this.dispatchEvent(event);
|
|
1242
1286
|
const deprecatedEvent = new CustomEvent("snapcallEvent_callEnd");
|
|
1243
|
-
|
|
1287
|
+
window.dispatchEvent(deprecatedEvent);
|
|
1244
1288
|
}
|
|
1245
1289
|
terminateRoom() {
|
|
1246
1290
|
this.protoo.request("terminateRoom");
|
|
@@ -1254,7 +1298,7 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
|
|
|
1254
1298
|
}
|
|
1255
1299
|
if (this.webcams.size === 0) this.webcam.device = null;
|
|
1256
1300
|
else if (!this.webcam.device) this.webcam.device = this.webcams.values().next().value;
|
|
1257
|
-
const event = new
|
|
1301
|
+
const event = new $1dedebd5ff3002eb$var$SnapcallEvent("webcamsUpdate", {
|
|
1258
1302
|
detail: {
|
|
1259
1303
|
numberOfAvailableWebcams: this.webcams.size
|
|
1260
1304
|
}
|
|
@@ -1311,7 +1355,16 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
|
|
|
1311
1355
|
});
|
|
1312
1356
|
}
|
|
1313
1357
|
}
|
|
1314
|
-
|
|
1358
|
+
scaleVideoMediasConstraintsParameter(scale) {
|
|
1359
|
+
let videoResolution = $1dedebd5ff3002eb$export$d21ffcc5eb136bfa["hd"];
|
|
1360
|
+
if (scale === 2) videoResolution = $1dedebd5ff3002eb$export$d21ffcc5eb136bfa["vga"];
|
|
1361
|
+
else if (scale > 2) videoResolution = $1dedebd5ff3002eb$export$d21ffcc5eb136bfa["qvga"];
|
|
1362
|
+
if (!this.webcam.resolution || $1dedebd5ff3002eb$export$d21ffcc5eb136bfa[this.webcam.resolution].qualityIndex >= videoResolution.qualityIndex) {
|
|
1363
|
+
console.log(`scaling video by ${scale}`, videoResolution);
|
|
1364
|
+
this.webcamProducer?.track?.applyConstraints(videoResolution);
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1367
|
+
scaleVideoEncodingsParameter() {
|
|
1315
1368
|
try {
|
|
1316
1369
|
let videoCount = 0;
|
|
1317
1370
|
this.consumers.forEach((consumer)=>{
|
|
@@ -1327,10 +1380,12 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
|
|
|
1327
1380
|
if (videoCount >= 9) scale = {
|
|
1328
1381
|
scaleResolutionDownBy: 4
|
|
1329
1382
|
};
|
|
1383
|
+
if (!(0, $jQDcL$mediasoupclientlibProducer.Producer).prototype.setRtpEncodingParameters) return this.scaleVideoMediasConstraintsParameter(scale.scaleResolutionDownBy);
|
|
1330
1384
|
if (this.webcamProducer && !this.webcamProducer.closed) {
|
|
1331
1385
|
console.log(`scaling video by ${scale.scaleResolutionDownBy}`);
|
|
1332
1386
|
this.webcamProducer?.setRtpEncodingParameters?.(scale).catch((err)=>{
|
|
1333
1387
|
console.error("scaleResolutionDownBy not supported", err);
|
|
1388
|
+
this.scaleVideoMediasConstraintsParameter(scale.scaleResolutionDownBy);
|
|
1334
1389
|
});
|
|
1335
1390
|
}
|
|
1336
1391
|
} catch (error) {
|
|
@@ -1373,7 +1428,7 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
|
|
|
1373
1428
|
min: capabilities?.zoom?.min || 0,
|
|
1374
1429
|
max: capabilities?.zoom?.max || 0
|
|
1375
1430
|
};
|
|
1376
|
-
const event = new
|
|
1431
|
+
const event = new $1dedebd5ff3002eb$var$SnapcallEvent("localVideoChange", {
|
|
1377
1432
|
detail: {
|
|
1378
1433
|
camera: this.getCurrentWebcam()
|
|
1379
1434
|
}
|
|
@@ -1415,14 +1470,14 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
|
|
|
1415
1470
|
deviceType: deviceType
|
|
1416
1471
|
}
|
|
1417
1472
|
});
|
|
1418
|
-
this.
|
|
1473
|
+
this.scaleVideoEncodingsParameter();
|
|
1419
1474
|
this.webcamProducer.on("transportclose", ()=>{
|
|
1420
1475
|
this.webcamProducer = null;
|
|
1421
1476
|
});
|
|
1422
1477
|
this.webcamProducer.on("trackended", ()=>{
|
|
1423
1478
|
this.disableVideo().catch(()=>{});
|
|
1424
1479
|
});
|
|
1425
|
-
const event = new
|
|
1480
|
+
const event = new $1dedebd5ff3002eb$var$SnapcallEvent("localVideoAvailable", {
|
|
1426
1481
|
detail: {
|
|
1427
1482
|
camera: this.getCurrentWebcam()
|
|
1428
1483
|
}
|
|
@@ -1463,7 +1518,9 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
|
|
|
1463
1518
|
producerId: this.webcamProducer.id
|
|
1464
1519
|
});
|
|
1465
1520
|
this.webcamProducer = null;
|
|
1466
|
-
const event = new
|
|
1521
|
+
const event = new $1dedebd5ff3002eb$var$SnapcallEvent("localVideoUnavailable", {
|
|
1522
|
+
detail: {}
|
|
1523
|
+
});
|
|
1467
1524
|
this.dispatchEvent(event);
|
|
1468
1525
|
}
|
|
1469
1526
|
async enableScreenshare() {
|
|
@@ -1506,7 +1563,9 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
|
|
|
1506
1563
|
this.screenshareProducer.on("trackended", ()=>{
|
|
1507
1564
|
this.disableScreenshare().catch(()=>{});
|
|
1508
1565
|
});
|
|
1509
|
-
const event = new
|
|
1566
|
+
const event = new $1dedebd5ff3002eb$var$SnapcallEvent("screenshareEnabled", {
|
|
1567
|
+
detail: {}
|
|
1568
|
+
});
|
|
1510
1569
|
this.dispatchEvent(event);
|
|
1511
1570
|
}
|
|
1512
1571
|
async disableScreenshare() {
|
|
@@ -1517,7 +1576,9 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
|
|
|
1517
1576
|
});
|
|
1518
1577
|
this.screenshareProducer = null;
|
|
1519
1578
|
}
|
|
1520
|
-
const event = new
|
|
1579
|
+
const event = new $1dedebd5ff3002eb$var$SnapcallEvent("screenshareDisabled", {
|
|
1580
|
+
detail: {}
|
|
1581
|
+
});
|
|
1521
1582
|
this.dispatchEvent(event);
|
|
1522
1583
|
}
|
|
1523
1584
|
onConsumerClose({ consumerId: consumerId }) {
|
|
@@ -1530,19 +1591,21 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
|
|
|
1530
1591
|
});
|
|
1531
1592
|
consumer.mediaSoupConsumer.close();
|
|
1532
1593
|
this.consumers.delete(consumerId);
|
|
1533
|
-
this.
|
|
1534
|
-
const event = new
|
|
1594
|
+
this.scaleVideoEncodingsParameter();
|
|
1595
|
+
const event = new $1dedebd5ff3002eb$var$SnapcallEvent("mediaStop", {
|
|
1535
1596
|
detail: {
|
|
1536
|
-
|
|
1537
|
-
|
|
1597
|
+
mediaId: consumerId,
|
|
1598
|
+
peerId: String(consumer.mediaSoupConsumer.appData.peerId),
|
|
1599
|
+
deviceType: consumer.deviceType,
|
|
1600
|
+
paused: false
|
|
1538
1601
|
}
|
|
1539
1602
|
});
|
|
1540
1603
|
if (consumer.deviceType === "microphone") this.deleteAudioRenderer(consumerId);
|
|
1541
1604
|
this.dispatchEvent(event);
|
|
1542
1605
|
}
|
|
1543
1606
|
}
|
|
1544
|
-
requestVideo({
|
|
1545
|
-
const consumer = this.consumers.get(
|
|
1607
|
+
requestVideo({ mediaId: mediaId , element: element }) {
|
|
1608
|
+
const consumer = this.consumers.get(mediaId);
|
|
1546
1609
|
if (consumer) {
|
|
1547
1610
|
const mediaStream = new MediaStream();
|
|
1548
1611
|
mediaStream.onremovetrack = ()=>console.log("Remove Track");
|
|
@@ -1624,11 +1687,11 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
|
|
|
1624
1687
|
mediaSoupConsumer: consumer,
|
|
1625
1688
|
deviceType: deviceType
|
|
1626
1689
|
});
|
|
1627
|
-
this.
|
|
1628
|
-
const event = new
|
|
1690
|
+
this.scaleVideoEncodingsParameter();
|
|
1691
|
+
const event = new $1dedebd5ff3002eb$var$SnapcallEvent("mediaStart", {
|
|
1629
1692
|
detail: {
|
|
1630
1693
|
peerId: peerId,
|
|
1631
|
-
|
|
1694
|
+
mediaId: consumer.id,
|
|
1632
1695
|
deviceType: deviceType,
|
|
1633
1696
|
paused: paused
|
|
1634
1697
|
}
|
|
@@ -1651,13 +1714,27 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
|
|
|
1651
1714
|
}
|
|
1652
1715
|
}
|
|
1653
1716
|
async setDisplayName(displayName) {
|
|
1654
|
-
this.
|
|
1655
|
-
|
|
1656
|
-
displayName: displayName
|
|
1717
|
+
await this.setProfile({
|
|
1718
|
+
name: displayName
|
|
1657
1719
|
});
|
|
1658
|
-
const event = new
|
|
1720
|
+
const event = new $1dedebd5ff3002eb$var$SnapcallEvent("selfDisplayName", {
|
|
1659
1721
|
detail: {
|
|
1660
|
-
|
|
1722
|
+
peerId: this.peerId,
|
|
1723
|
+
displayName: this.profile?.name,
|
|
1724
|
+
profile: this.profile
|
|
1725
|
+
}
|
|
1726
|
+
});
|
|
1727
|
+
this.dispatchEvent(event);
|
|
1728
|
+
}
|
|
1729
|
+
async setProfile(profile) {
|
|
1730
|
+
const newProfile = await this.protoo.request("setProfile", profile);
|
|
1731
|
+
this.profile = {
|
|
1732
|
+
...newProfile
|
|
1733
|
+
};
|
|
1734
|
+
const event = new $1dedebd5ff3002eb$var$SnapcallEvent("selfProfileUpdate", {
|
|
1735
|
+
detail: {
|
|
1736
|
+
peerId: this.peerId,
|
|
1737
|
+
profile: this.profile
|
|
1661
1738
|
}
|
|
1662
1739
|
});
|
|
1663
1740
|
this.dispatchEvent(event);
|
|
@@ -1750,16 +1827,13 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
|
|
|
1750
1827
|
getCurrentWebcam() {
|
|
1751
1828
|
return this.webcam;
|
|
1752
1829
|
}
|
|
1753
|
-
getWebcamsList() {
|
|
1754
|
-
return this.webcams;
|
|
1755
|
-
}
|
|
1756
1830
|
async setWebcamResolution(resolution) {
|
|
1757
1831
|
if (this.webcam.device) await this.switchWebcam({
|
|
1758
1832
|
resolution: resolution
|
|
1759
1833
|
});
|
|
1760
1834
|
else {
|
|
1761
1835
|
this.webcam.resolution = resolution;
|
|
1762
|
-
const e = new
|
|
1836
|
+
const e = new $1dedebd5ff3002eb$var$SnapcallEvent("localVideoChange", {
|
|
1763
1837
|
detail: {
|
|
1764
1838
|
camera: this.getCurrentWebcam()
|
|
1765
1839
|
}
|
|
@@ -1796,6 +1870,25 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
|
|
|
1796
1870
|
});
|
|
1797
1871
|
return data;
|
|
1798
1872
|
}
|
|
1873
|
+
async fetchAgentInfo({ apiKey: apiKey , email: email }) {
|
|
1874
|
+
const apiURL = this.config.apiUrl;
|
|
1875
|
+
const agent = await fetch(`${apiURL}/agents/${email}`, {
|
|
1876
|
+
method: "get",
|
|
1877
|
+
headers: {
|
|
1878
|
+
Authorization: `Bearer ${apiKey}`
|
|
1879
|
+
}
|
|
1880
|
+
}).then((response)=>{
|
|
1881
|
+
if (response.ok) return response.json();
|
|
1882
|
+
throw new Error("Invalid agent info");
|
|
1883
|
+
});
|
|
1884
|
+
return agent;
|
|
1885
|
+
}
|
|
1886
|
+
setConfig(config) {
|
|
1887
|
+
this.config = {
|
|
1888
|
+
...this.config,
|
|
1889
|
+
...config
|
|
1890
|
+
};
|
|
1891
|
+
}
|
|
1799
1892
|
}
|
|
1800
1893
|
|
|
1801
1894
|
|
|
@@ -1819,7 +1912,7 @@ let $a4027a5418fcd07a$export$96a9662a3eda31f6;
|
|
|
1819
1912
|
StreamsReducerActionTypes1[StreamsReducerActionTypes1["UNMUTE"] = 5] = "UNMUTE";
|
|
1820
1913
|
StreamsReducerActionTypes1[StreamsReducerActionTypes1["SET_HIGHLIGHTED_TILE"] = 6] = "SET_HIGHLIGHTED_TILE";
|
|
1821
1914
|
StreamsReducerActionTypes1[StreamsReducerActionTypes1["UNSET_HIGHLIGHTED_TILE"] = 7] = "UNSET_HIGHLIGHTED_TILE";
|
|
1822
|
-
StreamsReducerActionTypes1[StreamsReducerActionTypes1["
|
|
1915
|
+
StreamsReducerActionTypes1[StreamsReducerActionTypes1["SET_STREAM_PROFILE"] = 8] = "SET_STREAM_PROFILE";
|
|
1823
1916
|
StreamsReducerActionTypes1[StreamsReducerActionTypes1["SET_STREAM_SPEAKING"] = 9] = "SET_STREAM_SPEAKING";
|
|
1824
1917
|
})($a4027a5418fcd07a$export$96a9662a3eda31f6 || ($a4027a5418fcd07a$export$96a9662a3eda31f6 = {}));
|
|
1825
1918
|
const $a4027a5418fcd07a$export$7fc21eab2c971c9c = {
|
|
@@ -1851,7 +1944,7 @@ const $a4027a5418fcd07a$export$43fc78ab8758f39 = (state, action)=>{
|
|
|
1851
1944
|
};
|
|
1852
1945
|
case $a4027a5418fcd07a$export$96a9662a3eda31f6.DEVICE_UPDATE:
|
|
1853
1946
|
{
|
|
1854
|
-
const { streamId: streamId ,
|
|
1947
|
+
const { streamId: streamId , mediaId: mediaId , device: device , available: available , paused: paused } = action.payload;
|
|
1855
1948
|
return {
|
|
1856
1949
|
...state,
|
|
1857
1950
|
streams: state.streams.map((stream)=>{
|
|
@@ -1860,7 +1953,7 @@ const $a4027a5418fcd07a$export$43fc78ab8758f39 = (state, action)=>{
|
|
|
1860
1953
|
if (device === "microphone") muted = paused;
|
|
1861
1954
|
return {
|
|
1862
1955
|
...stream,
|
|
1863
|
-
[device]: available ?
|
|
1956
|
+
[device]: available ? mediaId : null,
|
|
1864
1957
|
muted: muted
|
|
1865
1958
|
};
|
|
1866
1959
|
}
|
|
@@ -1900,13 +1993,13 @@ const $a4027a5418fcd07a$export$43fc78ab8758f39 = (state, action)=>{
|
|
|
1900
1993
|
...state,
|
|
1901
1994
|
highlightedTile: null
|
|
1902
1995
|
};
|
|
1903
|
-
case $a4027a5418fcd07a$export$96a9662a3eda31f6.
|
|
1996
|
+
case $a4027a5418fcd07a$export$96a9662a3eda31f6.SET_STREAM_PROFILE:
|
|
1904
1997
|
return {
|
|
1905
1998
|
...state,
|
|
1906
1999
|
streams: state.streams.map((stream)=>{
|
|
1907
2000
|
if (stream.id === action.payload.streamId) return {
|
|
1908
2001
|
...stream,
|
|
1909
|
-
|
|
2002
|
+
profile: action.payload.profile
|
|
1910
2003
|
};
|
|
1911
2004
|
return stream;
|
|
1912
2005
|
})
|
|
@@ -3178,13 +3271,23 @@ const $66c45b20958474ec$export$f6525863ef5a71a9 = (0, ($parcel$interopDefault($j
|
|
|
3178
3271
|
align-items: center;
|
|
3179
3272
|
width: 14px;
|
|
3180
3273
|
height: 14px;
|
|
3181
|
-
padding: 3px 4px;
|
|
3182
3274
|
box-sizing: border-box;
|
|
3183
3275
|
background-color: #2d2d2d;
|
|
3184
3276
|
border-radius: 50px;
|
|
3185
3277
|
font-size: 9px;
|
|
3186
3278
|
font-weight: 700;
|
|
3187
3279
|
line-height: 8px;
|
|
3280
|
+
|
|
3281
|
+
svg {
|
|
3282
|
+
width: 8px;
|
|
3283
|
+
height: 8px;
|
|
3284
|
+
}
|
|
3285
|
+
`;
|
|
3286
|
+
const $66c45b20958474ec$export$a7a74ab5cffd1455 = (0, ($parcel$interopDefault($jQDcL$styledcomponents))).img`
|
|
3287
|
+
width: 100%;
|
|
3288
|
+
height: 100%;
|
|
3289
|
+
border-radius: inherit;
|
|
3290
|
+
object-fit: cover;
|
|
3188
3291
|
`;
|
|
3189
3292
|
const $66c45b20958474ec$export$f217faec90120a0c = (0, ($parcel$interopDefault($jQDcL$styledcomponents))).div`
|
|
3190
3293
|
display: flex;
|
|
@@ -3263,11 +3366,6 @@ const $66c45b20958474ec$export$a2930b41faa750f4 = (0, ($parcel$interopDefault($j
|
|
|
3263
3366
|
line-height: 20px;
|
|
3264
3367
|
color: #fff;
|
|
3265
3368
|
`;
|
|
3266
|
-
const $66c45b20958474ec$export$2d75367b6e042d67 = (0, ($parcel$interopDefault($jQDcL$styledcomponents))).img`
|
|
3267
|
-
width: inherit;
|
|
3268
|
-
height: inherit;
|
|
3269
|
-
border-radius: inherit;
|
|
3270
|
-
`;
|
|
3271
3369
|
const $66c45b20958474ec$export$26fe7ec9351ff761 = (0, ($parcel$interopDefault($jQDcL$styledcomponents))).img`
|
|
3272
3370
|
border: 2px solid #fff;
|
|
3273
3371
|
border-radius: 8px;
|
|
@@ -3508,6 +3606,17 @@ const $2c45d365ee8aa1ab$export$500c3c5544c37412 = (0, ($parcel$interopDefault($j
|
|
|
3508
3606
|
font-weight: 700;
|
|
3509
3607
|
line-height: 13px;
|
|
3510
3608
|
`;
|
|
3609
|
+
const $2c45d365ee8aa1ab$export$88248b9be937544a = (0, ($parcel$interopDefault($jQDcL$styledcomponents))).div`
|
|
3610
|
+
display: flex;
|
|
3611
|
+
align-items: center;
|
|
3612
|
+
font-size: 18px;
|
|
3613
|
+
line-height: 15px;
|
|
3614
|
+
|
|
3615
|
+
svg {
|
|
3616
|
+
width: 12px;
|
|
3617
|
+
height: 12px;
|
|
3618
|
+
}
|
|
3619
|
+
`;
|
|
3511
3620
|
|
|
3512
3621
|
|
|
3513
3622
|
|
|
@@ -3526,7 +3635,7 @@ const $07e749066c746c7c$var$StreamTile = ({ stream: stream , width: width = 0 ,
|
|
|
3526
3635
|
const { highlightedTile: highlightedTile } = (0, $3f6e908c45fcc5b3$export$b5633a7cfbe42d9f)();
|
|
3527
3636
|
const isSharingScreen = highlightedTile?.type === "screenshare" && highlightedTile.peerId === selfPeerId;
|
|
3528
3637
|
const microphoneActive = stream.microphone && !stream.muted;
|
|
3529
|
-
const showRequestDevice = !requestingDevice && hover && !highlightedTile && (!microphoneActive || !stream.webcam);
|
|
3638
|
+
const showRequestDevice = !requestingDevice && hover && !highlightedTile && (!microphoneActive || !stream.webcam || !isSharingScreen);
|
|
3530
3639
|
const tileWidth = `${width}px`;
|
|
3531
3640
|
const tileHeight = `${height}px`;
|
|
3532
3641
|
const videoMaxHeight = "100%";
|
|
@@ -3548,7 +3657,7 @@ const $07e749066c746c7c$var$StreamTile = ({ stream: stream , width: width = 0 ,
|
|
|
3548
3657
|
(0, $jQDcL$react.useEffect)(()=>{
|
|
3549
3658
|
if (!videoElementRef.current) throw new Error("videoElementRef not available");
|
|
3550
3659
|
if (stream.webcam && videoElementRef.current) (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).requestVideo({
|
|
3551
|
-
|
|
3660
|
+
mediaId: stream.webcam,
|
|
3552
3661
|
element: videoElementRef.current
|
|
3553
3662
|
});
|
|
3554
3663
|
else if (!stream.webcam) videoElementRef.current.srcObject = null;
|
|
@@ -3579,7 +3688,7 @@ const $07e749066c746c7c$var$StreamTile = ({ stream: stream , width: width = 0 ,
|
|
|
3579
3688
|
setRequestingDevice(null);
|
|
3580
3689
|
if (result !== true) {
|
|
3581
3690
|
let message = "Your request has been declined.";
|
|
3582
|
-
if (stream.
|
|
3691
|
+
if (stream.profile.name) message = `${stream.profile.name} has declined your request.`;
|
|
3583
3692
|
(0, ($parcel$interopDefault($jQDcL$reacthottoast)))(message, {
|
|
3584
3693
|
className: "error"
|
|
3585
3694
|
});
|
|
@@ -3592,7 +3701,7 @@ const $07e749066c746c7c$var$StreamTile = ({ stream: stream , width: width = 0 ,
|
|
|
3592
3701
|
};
|
|
3593
3702
|
}, [
|
|
3594
3703
|
stream.id,
|
|
3595
|
-
stream.
|
|
3704
|
+
stream.profile
|
|
3596
3705
|
]);
|
|
3597
3706
|
(0, $jQDcL$react.useEffect)(()=>{
|
|
3598
3707
|
const onCustomMessage = async (event)=>{
|
|
@@ -3605,8 +3714,7 @@ const $07e749066c746c7c$var$StreamTile = ({ stream: stream , width: width = 0 ,
|
|
|
3605
3714
|
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).removeEventListener("customMessage", onCustomMessage);
|
|
3606
3715
|
};
|
|
3607
3716
|
}, [
|
|
3608
|
-
stream.id
|
|
3609
|
-
stream.displayName
|
|
3717
|
+
stream.id
|
|
3610
3718
|
]);
|
|
3611
3719
|
return /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $66c45b20958474ec$export$798352b46783b18d), {
|
|
3612
3720
|
onMouseEnter: onMouseEnter,
|
|
@@ -3686,24 +3794,25 @@ const $07e749066c746c7c$var$StreamTile = ({ stream: stream , width: width = 0 ,
|
|
|
3686
3794
|
]
|
|
3687
3795
|
}),
|
|
3688
3796
|
!requestingDevice && !showRequestDevice && !stream.webcam && /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $66c45b20958474ec$export$f217faec90120a0c), {
|
|
3689
|
-
children: /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.
|
|
3690
|
-
children:
|
|
3691
|
-
stream.
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
]
|
|
3797
|
+
children: /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $66c45b20958474ec$export$6ddfb572d7b6d164), {
|
|
3798
|
+
children: stream.profile.image ? /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $66c45b20958474ec$export$a7a74ab5cffd1455), {
|
|
3799
|
+
src: stream.profile.image
|
|
3800
|
+
}) : stream.profile.name ? /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $66c45b20958474ec$export$a2930b41faa750f4), {
|
|
3801
|
+
children: stream.profile.name.slice(0, 1).toUpperCase()
|
|
3802
|
+
}) : /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $0319693440f03062$export$2e2bcd8739ae039), {})
|
|
3696
3803
|
})
|
|
3697
3804
|
}),
|
|
3698
3805
|
!showRequestDevice && /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $66c45b20958474ec$export$a878cdfb933a1421), {
|
|
3699
3806
|
children: [
|
|
3700
3807
|
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $66c45b20958474ec$export$f6525863ef5a71a9), {
|
|
3701
|
-
children: stream.
|
|
3702
|
-
|
|
3808
|
+
children: stream.profile.image ? /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $66c45b20958474ec$export$a7a74ab5cffd1455), {
|
|
3809
|
+
src: stream.profile.image
|
|
3810
|
+
}) : stream.profile.name ? /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)("span", {
|
|
3811
|
+
children: stream.profile.name.slice(0, 1).toUpperCase()
|
|
3703
3812
|
}) : /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $0319693440f03062$export$2e2bcd8739ae039), {})
|
|
3704
3813
|
}),
|
|
3705
3814
|
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $66c45b20958474ec$export$b430fec6b171ceb5), {
|
|
3706
|
-
children: stream.
|
|
3815
|
+
children: stream.profile.name || "User"
|
|
3707
3816
|
})
|
|
3708
3817
|
]
|
|
3709
3818
|
})
|
|
@@ -3776,10 +3885,10 @@ const $dc81c0e96fbbb967$var$AudioTile = ({ stream: stream })=>{
|
|
|
3776
3885
|
children: [
|
|
3777
3886
|
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $52dcfd8b6b2d6e61$export$235e35bd03f702fb), {
|
|
3778
3887
|
children: [
|
|
3779
|
-
stream.
|
|
3780
|
-
children: stream.
|
|
3888
|
+
stream.profile.name && /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $66c45b20958474ec$export$a2930b41faa750f4), {
|
|
3889
|
+
children: stream.profile.name.slice(0, 1).toUpperCase()
|
|
3781
3890
|
}),
|
|
3782
|
-
!stream.
|
|
3891
|
+
!stream.profile.name && /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $0319693440f03062$export$2e2bcd8739ae039), {}),
|
|
3783
3892
|
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $52dcfd8b6b2d6e61$export$95156eef6a2de99c), {
|
|
3784
3893
|
children: /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $0ac48791ff0bcc8e$export$2e2bcd8739ae039), {
|
|
3785
3894
|
redSlash: !isMicrophoneActive
|
|
@@ -3788,7 +3897,7 @@ const $dc81c0e96fbbb967$var$AudioTile = ({ stream: stream })=>{
|
|
|
3788
3897
|
]
|
|
3789
3898
|
}),
|
|
3790
3899
|
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $52dcfd8b6b2d6e61$export$a87ec69641e9884), {
|
|
3791
|
-
children: stream.
|
|
3900
|
+
children: stream.profile.name
|
|
3792
3901
|
})
|
|
3793
3902
|
]
|
|
3794
3903
|
});
|
|
@@ -3826,7 +3935,7 @@ const $6f36db3b1217f099$var$Cross = ()=>/*#__PURE__*/ (0, $jQDcL$reactjsxruntime
|
|
|
3826
3935
|
fill: "none",
|
|
3827
3936
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3828
3937
|
children: /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)("path", {
|
|
3829
|
-
d: "
|
|
3938
|
+
d: "m13.41 12 6.3-6.29a1.004 1.004 0 0 0-1.42-1.42L12 10.59l-6.29-6.3a1.004 1.004 0 1 0-1.42 1.42l6.3 6.29-6.3 6.29a.999.999 0 0 0 0 1.42 1 1 0 0 0 1.42 0l6.29-6.3 6.29 6.3a1.001 1.001 0 0 0 1.639-.325 1 1 0 0 0-.22-1.095L13.41 12Z",
|
|
3830
3939
|
fill: "#fff"
|
|
3831
3940
|
})
|
|
3832
3941
|
});
|
|
@@ -3969,7 +4078,7 @@ const $379218382afed0e6$var$DeviceRequest = ({ device: device , requesterId: req
|
|
|
3969
4078
|
}),
|
|
3970
4079
|
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $2c45d365ee8aa1ab$export$517ec31e58d61d2e), {
|
|
3971
4080
|
children: [
|
|
3972
|
-
requesterStream?.
|
|
4081
|
+
requesterStream?.profile?.name || "Someone",
|
|
3973
4082
|
" would like you to share your",
|
|
3974
4083
|
" ",
|
|
3975
4084
|
$379218382afed0e6$var$deviceNames[device]
|
|
@@ -4171,7 +4280,7 @@ const $8393b5c887e16c8c$var$SelfStreamTile = ({ isSomeonePresenting: isSomeonePr
|
|
|
4171
4280
|
const videoElementRef = (0, $jQDcL$react.useRef)(null);
|
|
4172
4281
|
const videoMediaProviderRef = (0, $jQDcL$react.useRef)(null);
|
|
4173
4282
|
const SelfTileRef = (0, $jQDcL$react.useRef)(null);
|
|
4174
|
-
const { videosContainerRef: videosContainerRef , remoteTilesContainerRef: remoteTilesContainerRef ,
|
|
4283
|
+
const { videosContainerRef: videosContainerRef , remoteTilesContainerRef: remoteTilesContainerRef , profile: profile , muted: muted , streaming: streaming , orientation: orientation , options: options , } = (0, $jQDcL$react.useContext)((0, $8b39f32976a7698a$export$2e2bcd8739ae039));
|
|
4175
4284
|
const { streams: streams } = (0, $3f6e908c45fcc5b3$export$b5633a7cfbe42d9f)();
|
|
4176
4285
|
const [containerWidth, containerHeight] = (0, $56e1e7a85d8bf4bb$export$2b86bedf890eab8)(videosContainerRef.current);
|
|
4177
4286
|
const isAlone = streams.length < 1;
|
|
@@ -4223,7 +4332,7 @@ const $8393b5c887e16c8c$var$SelfStreamTile = ({ isSomeonePresenting: isSomeonePr
|
|
|
4223
4332
|
const base64Image = await (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).captureVideo(videoElementRef.current);
|
|
4224
4333
|
setSnapshotImage(base64Image);
|
|
4225
4334
|
try {
|
|
4226
|
-
const { objectUrl: objectUrl } = await fetch(`${
|
|
4335
|
+
const { objectUrl: objectUrl } = await fetch(`${options.streamApiURL}/uploadSnapshot`, {
|
|
4227
4336
|
method: "POST",
|
|
4228
4337
|
body: JSON.stringify({
|
|
4229
4338
|
file: base64Image
|
|
@@ -4234,7 +4343,7 @@ const $8393b5c887e16c8c$var$SelfStreamTile = ({ isSomeonePresenting: isSomeonePr
|
|
|
4234
4343
|
imageSrc: objectUrl
|
|
4235
4344
|
});
|
|
4236
4345
|
let notificationMessage = "Snapshot sent to users.";
|
|
4237
|
-
if (streams.length === 1) notificationMessage = `Snapshot sent to ${streams[0].
|
|
4346
|
+
if (streams.length === 1) notificationMessage = `Snapshot sent to ${streams[0].profile.name || "user"}.`;
|
|
4238
4347
|
(0, $84c6cbcbb594d072$export$3a57e165650c636f)(notificationMessage, {
|
|
4239
4348
|
icon: /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $2c45d365ee8aa1ab$export$26fe7ec9351ff761), {
|
|
4240
4349
|
src: base64Image
|
|
@@ -4254,7 +4363,6 @@ const $8393b5c887e16c8c$var$SelfStreamTile = ({ isSomeonePresenting: isSomeonePr
|
|
|
4254
4363
|
if (SelfTileRef.current) (0, $4ee7c4b0b3646a08$export$ab7d69e250642927)({
|
|
4255
4364
|
element: SelfTileRef.current
|
|
4256
4365
|
});
|
|
4257
|
-
if (deviceType === "screen") return;
|
|
4258
4366
|
setDeviceRequest({
|
|
4259
4367
|
device: deviceType,
|
|
4260
4368
|
requesterId: peerId
|
|
@@ -4352,10 +4460,10 @@ const $8393b5c887e16c8c$var$SelfStreamTile = ({ isSomeonePresenting: isSomeonePr
|
|
|
4352
4460
|
!streaming && /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $66c45b20958474ec$export$f217faec90120a0c), {
|
|
4353
4461
|
children: /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $66c45b20958474ec$export$6ddfb572d7b6d164), {
|
|
4354
4462
|
children: [
|
|
4355
|
-
|
|
4356
|
-
children:
|
|
4463
|
+
profile.name && /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $66c45b20958474ec$export$a2930b41faa750f4), {
|
|
4464
|
+
children: profile.name.slice(0, 1).toUpperCase()
|
|
4357
4465
|
}),
|
|
4358
|
-
!
|
|
4466
|
+
!profile.name && /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $0319693440f03062$export$2e2bcd8739ae039), {})
|
|
4359
4467
|
]
|
|
4360
4468
|
})
|
|
4361
4469
|
}),
|
|
@@ -4387,12 +4495,14 @@ const $8393b5c887e16c8c$var$SelfStreamTile = ({ isSomeonePresenting: isSomeonePr
|
|
|
4387
4495
|
onClick: onSnapshotClick,
|
|
4388
4496
|
children: /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $5dc09a23669bcbcf$export$c58e349a67ffa055), {})
|
|
4389
4497
|
}),
|
|
4390
|
-
zoomAvailable && /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.
|
|
4498
|
+
zoomAvailable && /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $2c45d365ee8aa1ab$export$e07ea3386b3cb3d9), {
|
|
4391
4499
|
onClick: onZoomClick,
|
|
4392
|
-
children:
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4500
|
+
children: /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $2c45d365ee8aa1ab$export$88248b9be937544a), {
|
|
4501
|
+
children: [
|
|
4502
|
+
zoom ? "2" : "1",
|
|
4503
|
+
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $6f36db3b1217f099$export$2e2bcd8739ae039), {})
|
|
4504
|
+
]
|
|
4505
|
+
})
|
|
4396
4506
|
}),
|
|
4397
4507
|
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)("span", {
|
|
4398
4508
|
style: {
|
|
@@ -4477,12 +4587,12 @@ const $6e25dd2638faaf71$var$ScreenshareTile = (tile)=>{
|
|
|
4477
4587
|
const videoElementRef = (0, $jQDcL$react.useRef)(null);
|
|
4478
4588
|
const isSelf = tile.peerId === selfPeerId;
|
|
4479
4589
|
(0, $jQDcL$react.useEffect)(()=>{
|
|
4480
|
-
if (tile.data.
|
|
4481
|
-
|
|
4590
|
+
if (tile.data.mediaId && videoElementRef.current) (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).requestVideo({
|
|
4591
|
+
mediaId: tile.data.mediaId,
|
|
4482
4592
|
element: videoElementRef.current
|
|
4483
4593
|
});
|
|
4484
4594
|
}, [
|
|
4485
|
-
tile.data.
|
|
4595
|
+
tile.data.mediaId
|
|
4486
4596
|
]);
|
|
4487
4597
|
(0, $jQDcL$react.useEffect)(()=>{
|
|
4488
4598
|
if (isSelf && videoElementRef.current) {
|
|
@@ -4860,12 +4970,20 @@ const $65992ea9297d23d9$export$a06f1c675e846f6f = (0, ($parcel$interopDefault($j
|
|
|
4860
4970
|
justify-content: center;
|
|
4861
4971
|
`;
|
|
4862
4972
|
const $65992ea9297d23d9$export$f9985cea9f8ad92f = (0, ($parcel$interopDefault($jQDcL$styledcomponents))).button`
|
|
4973
|
+
display: flex;
|
|
4974
|
+
justify-content: center;
|
|
4975
|
+
align-items: center;
|
|
4863
4976
|
width: 36px;
|
|
4864
4977
|
height: 36px;
|
|
4865
4978
|
padding: 7px;
|
|
4866
4979
|
background: rgba(28, 32, 36, 0.5);
|
|
4867
4980
|
border: none;
|
|
4868
4981
|
border-radius: 50px;
|
|
4982
|
+
|
|
4983
|
+
svg {
|
|
4984
|
+
width: 17px;
|
|
4985
|
+
height: 17px;
|
|
4986
|
+
}
|
|
4869
4987
|
`;
|
|
4870
4988
|
const $65992ea9297d23d9$export$26fe7ec9351ff761 = (0, ($parcel$interopDefault($jQDcL$styledcomponents))).img`
|
|
4871
4989
|
border: 2px solid #fff;
|
|
@@ -4995,8 +5113,8 @@ const $1c0fa9be050932fe$var$ScreenshareEvents = ()=>{
|
|
|
4995
5113
|
const { dispatch: dispatch , highlightedTile: highlightedTile } = (0, $3f6e908c45fcc5b3$export$b5633a7cfbe42d9f)();
|
|
4996
5114
|
(0, $jQDcL$react.useEffect)(()=>{
|
|
4997
5115
|
const onRemoteScreensharingUpdate = (event)=>{
|
|
4998
|
-
const { peerId: peerId ,
|
|
4999
|
-
const available = event.type === "
|
|
5116
|
+
const { peerId: peerId , mediaId: mediaId , deviceType: deviceType } = event.detail;
|
|
5117
|
+
const available = event.type === "mediaStart";
|
|
5000
5118
|
if (deviceType === "screen" && available) dispatch({
|
|
5001
5119
|
type: (0, $a4027a5418fcd07a$export$96a9662a3eda31f6).SET_HIGHLIGHTED_TILE,
|
|
5002
5120
|
payload: {
|
|
@@ -5004,7 +5122,7 @@ const $1c0fa9be050932fe$var$ScreenshareEvents = ()=>{
|
|
|
5004
5122
|
peerId: peerId,
|
|
5005
5123
|
isGlobal: true,
|
|
5006
5124
|
data: {
|
|
5007
|
-
|
|
5125
|
+
mediaId: mediaId
|
|
5008
5126
|
}
|
|
5009
5127
|
}
|
|
5010
5128
|
});
|
|
@@ -5029,13 +5147,13 @@ const $1c0fa9be050932fe$var$ScreenshareEvents = ()=>{
|
|
|
5029
5147
|
type: (0, $a4027a5418fcd07a$export$96a9662a3eda31f6).UNSET_HIGHLIGHTED_TILE
|
|
5030
5148
|
});
|
|
5031
5149
|
};
|
|
5032
|
-
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).addEventListener("
|
|
5033
|
-
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).addEventListener("
|
|
5150
|
+
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).addEventListener("mediaStart", onRemoteScreensharingUpdate);
|
|
5151
|
+
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).addEventListener("mediaStop", onRemoteScreensharingUpdate);
|
|
5034
5152
|
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).addEventListener("screenshareEnabled", onScreensharingUpdate);
|
|
5035
5153
|
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).addEventListener("screenshareDisabled", onScreensharingUpdate);
|
|
5036
5154
|
return ()=>{
|
|
5037
|
-
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).removeEventListener("
|
|
5038
|
-
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).removeEventListener("
|
|
5155
|
+
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).removeEventListener("mediaStart", onRemoteScreensharingUpdate);
|
|
5156
|
+
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).removeEventListener("mediaStop", onRemoteScreensharingUpdate);
|
|
5039
5157
|
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).removeEventListener("screenshareEnabled", onScreensharingUpdate);
|
|
5040
5158
|
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).removeEventListener("screenshareDisabled", onScreensharingUpdate);
|
|
5041
5159
|
};
|
|
@@ -5107,15 +5225,15 @@ const $e447bd93acbe2b63$var$SnapshotEvents = ()=>{
|
|
|
5107
5225
|
if (type === "snapshot") {
|
|
5108
5226
|
const sender = streams.find((stream)=>stream.id === peerId);
|
|
5109
5227
|
if (sender) {
|
|
5110
|
-
const statusIcon = sender.
|
|
5111
|
-
children: sender.
|
|
5228
|
+
const statusIcon = sender.profile.name ? /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $65992ea9297d23d9$export$49ac927a2aaad85), {
|
|
5229
|
+
children: sender.profile.name.slice(0, 1).toUpperCase()
|
|
5112
5230
|
}) : /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $65992ea9297d23d9$export$49ac927a2aaad85), {
|
|
5113
5231
|
children: /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $0319693440f03062$export$2e2bcd8739ae039), {})
|
|
5114
5232
|
});
|
|
5115
5233
|
const createdAtDate = new Date();
|
|
5116
5234
|
const notificationStatus = {
|
|
5117
5235
|
text: "From",
|
|
5118
|
-
boldText: sender.
|
|
5236
|
+
boldText: sender.profile.name || "User",
|
|
5119
5237
|
icon: statusIcon
|
|
5120
5238
|
};
|
|
5121
5239
|
(0, $84c6cbcbb594d072$export$3a57e165650c636f)("Snapshot shared.", {
|
|
@@ -5161,8 +5279,8 @@ const $e447bd93acbe2b63$var$SnapshotEvents = ()=>{
|
|
|
5161
5279
|
border: "2px solid #fff"
|
|
5162
5280
|
},
|
|
5163
5281
|
statusText: notificationStatus.boldText,
|
|
5164
|
-
statusIconLetter: sender.
|
|
5165
|
-
statusIconUser: sender.
|
|
5282
|
+
statusIconLetter: sender.profile.name ? sender.profile.name.slice(0, 1).toUpperCase() : undefined,
|
|
5283
|
+
statusIconUser: sender.profile.name ? false : true
|
|
5166
5284
|
});
|
|
5167
5285
|
}
|
|
5168
5286
|
}
|
|
@@ -5353,7 +5471,7 @@ var $537dcc6df507dc4a$export$2e2bcd8739ae039 = $537dcc6df507dc4a$var$tooltip;
|
|
|
5353
5471
|
|
|
5354
5472
|
|
|
5355
5473
|
const $88b23a8428e67b66$var$Video = ()=>{
|
|
5356
|
-
const { selfPeerId: selfPeerId , videosContainerRef: videosContainerRef , remoteTilesContainerRef: remoteTilesContainerRef , options: options , muted: selfMuted ,
|
|
5474
|
+
const { selfPeerId: selfPeerId , videosContainerRef: videosContainerRef , remoteTilesContainerRef: remoteTilesContainerRef , options: options , muted: selfMuted , profile: profile1 , orientation: orientation , userInteractionTriggered: userInteractionTriggered , } = (0, $jQDcL$react.useContext)((0, $8b39f32976a7698a$export$2e2bcd8739ae039));
|
|
5357
5475
|
const [tileSize, setTileSize] = (0, $jQDcL$react.useState)({
|
|
5358
5476
|
width: 0,
|
|
5359
5477
|
height: 0
|
|
@@ -5403,32 +5521,32 @@ const $88b23a8428e67b66$var$Video = ()=>{
|
|
|
5403
5521
|
]);
|
|
5404
5522
|
(0, $jQDcL$react.useEffect)(()=>{
|
|
5405
5523
|
const onNewPeer = (event)=>{
|
|
5406
|
-
const { peerId: peerId ,
|
|
5524
|
+
const { peerId: peerId , profile: profile } = event.detail;
|
|
5407
5525
|
dispatch({
|
|
5408
5526
|
type: (0, $a4027a5418fcd07a$export$96a9662a3eda31f6).ADD_STREAM,
|
|
5409
5527
|
payload: {
|
|
5410
5528
|
id: peerId,
|
|
5411
|
-
|
|
5529
|
+
profile: profile
|
|
5412
5530
|
}
|
|
5413
5531
|
});
|
|
5414
5532
|
};
|
|
5415
|
-
const
|
|
5416
|
-
const { peerId: peerId ,
|
|
5417
|
-
const available = event.type === "
|
|
5533
|
+
const onMediaEvent = (event)=>{
|
|
5534
|
+
const { peerId: peerId , mediaId: mediaId , deviceType: deviceType , paused: paused } = event.detail;
|
|
5535
|
+
const available = event.type === "mediaStart";
|
|
5418
5536
|
if (deviceType !== "screen") dispatch({
|
|
5419
5537
|
type: (0, $a4027a5418fcd07a$export$96a9662a3eda31f6).DEVICE_UPDATE,
|
|
5420
5538
|
payload: {
|
|
5421
5539
|
streamId: peerId,
|
|
5422
|
-
|
|
5540
|
+
mediaId: mediaId,
|
|
5423
5541
|
device: deviceType,
|
|
5424
5542
|
available: available,
|
|
5425
5543
|
paused: paused
|
|
5426
5544
|
}
|
|
5427
5545
|
});
|
|
5428
5546
|
};
|
|
5429
|
-
const
|
|
5547
|
+
const onMediaStateChange = (event)=>{
|
|
5430
5548
|
const { peerId: peerId , deviceType: deviceType } = event.detail;
|
|
5431
|
-
const isPaused = event.type === "
|
|
5549
|
+
const isPaused = event.type === "mediaPause";
|
|
5432
5550
|
if (deviceType === "microphone" && isPaused) dispatch({
|
|
5433
5551
|
type: (0, $a4027a5418fcd07a$export$96a9662a3eda31f6).MUTE,
|
|
5434
5552
|
payload: {
|
|
@@ -5446,7 +5564,7 @@ const $88b23a8428e67b66$var$Video = ()=>{
|
|
|
5446
5564
|
const { peers: peers } = event.detail;
|
|
5447
5565
|
const roomStreams = peers.map((peer)=>({
|
|
5448
5566
|
id: peer.peerId,
|
|
5449
|
-
|
|
5567
|
+
profile: peer.profile
|
|
5450
5568
|
}));
|
|
5451
5569
|
dispatch({
|
|
5452
5570
|
type: (0, $a4027a5418fcd07a$export$96a9662a3eda31f6).SET_STREAMS,
|
|
@@ -5462,13 +5580,13 @@ const $88b23a8428e67b66$var$Video = ()=>{
|
|
|
5462
5580
|
}
|
|
5463
5581
|
});
|
|
5464
5582
|
};
|
|
5465
|
-
const
|
|
5466
|
-
const { peerId: peerId ,
|
|
5583
|
+
const onProfileUpdate = (event)=>{
|
|
5584
|
+
const { peerId: peerId , profile: profile } = event.detail;
|
|
5467
5585
|
dispatch({
|
|
5468
|
-
type: (0, $a4027a5418fcd07a$export$96a9662a3eda31f6).
|
|
5586
|
+
type: (0, $a4027a5418fcd07a$export$96a9662a3eda31f6).SET_STREAM_PROFILE,
|
|
5469
5587
|
payload: {
|
|
5470
5588
|
streamId: peerId,
|
|
5471
|
-
|
|
5589
|
+
profile: profile
|
|
5472
5590
|
}
|
|
5473
5591
|
});
|
|
5474
5592
|
};
|
|
@@ -5486,22 +5604,22 @@ const $88b23a8428e67b66$var$Video = ()=>{
|
|
|
5486
5604
|
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).addEventListener("enterRoom", onEnterRoom);
|
|
5487
5605
|
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).addEventListener("newPeer", onNewPeer);
|
|
5488
5606
|
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).addEventListener("peerClosed", onPeerClosed);
|
|
5489
|
-
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).addEventListener("
|
|
5490
|
-
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).addEventListener("
|
|
5491
|
-
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).addEventListener("
|
|
5492
|
-
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).addEventListener("
|
|
5493
|
-
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).addEventListener("
|
|
5607
|
+
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).addEventListener("mediaStart", onMediaEvent);
|
|
5608
|
+
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).addEventListener("mediaStop", onMediaEvent);
|
|
5609
|
+
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).addEventListener("mediaPause", onMediaStateChange);
|
|
5610
|
+
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).addEventListener("mediaResume", onMediaStateChange);
|
|
5611
|
+
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).addEventListener("profileUpdate", onProfileUpdate);
|
|
5494
5612
|
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).addEventListener("peerStartSpeak", onPeerSpeakingUpdate);
|
|
5495
5613
|
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).addEventListener("peerStopSpeak", onPeerSpeakingUpdate);
|
|
5496
5614
|
return ()=>{
|
|
5497
5615
|
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).removeEventListener("enterRoom", onEnterRoom);
|
|
5498
5616
|
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).removeEventListener("newPeer", onNewPeer);
|
|
5499
5617
|
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).removeEventListener("peerClosed", onPeerClosed);
|
|
5500
|
-
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).removeEventListener("
|
|
5501
|
-
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).removeEventListener("
|
|
5502
|
-
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).removeEventListener("
|
|
5503
|
-
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).removeEventListener("
|
|
5504
|
-
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).removeEventListener("
|
|
5618
|
+
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).removeEventListener("mediaStart", onMediaEvent);
|
|
5619
|
+
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).removeEventListener("mediaStop", onMediaEvent);
|
|
5620
|
+
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).removeEventListener("mediaPause", onMediaStateChange);
|
|
5621
|
+
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).removeEventListener("mediaResume", onMediaStateChange);
|
|
5622
|
+
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).removeEventListener("profileUpdate", onProfileUpdate);
|
|
5505
5623
|
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).removeEventListener("peerStartSpeak", onPeerSpeakingUpdate);
|
|
5506
5624
|
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).removeEventListener("peerStopSpeak", onPeerSpeakingUpdate);
|
|
5507
5625
|
};
|
|
@@ -5531,7 +5649,7 @@ const $88b23a8428e67b66$var$Video = ()=>{
|
|
|
5531
5649
|
stream: {
|
|
5532
5650
|
id: String(selfPeerId),
|
|
5533
5651
|
muted: selfMuted,
|
|
5534
|
-
|
|
5652
|
+
profile: profile1
|
|
5535
5653
|
}
|
|
5536
5654
|
}),
|
|
5537
5655
|
streams.map((stream)=>{
|
|
@@ -6076,7 +6194,7 @@ const $b387679730856fb1$export$51760c3b0f5567d2 = (0, ($parcel$interopDefault($j
|
|
|
6076
6194
|
const $681806ce8015ae4d$var$QuickConnect = ()=>{
|
|
6077
6195
|
const QuickConnectContainerRef = (0, $jQDcL$react.useRef)(null);
|
|
6078
6196
|
const QuickConnectRef = (0, $jQDcL$react.useRef)(null);
|
|
6079
|
-
const { selfPeerId: selfPeerId ,
|
|
6197
|
+
const { selfPeerId: selfPeerId , profile: profile , isQuickConnectPopupVisible: isQuickConnectPopupVisible , setIsQuickConnectPopupVisible: setIsQuickConnectPopupVisible , options: options , orientation: orientation , } = (0, $jQDcL$react.useContext)((0, $8b39f32976a7698a$export$2e2bcd8739ae039));
|
|
6080
6198
|
(0, $326cea7dbbcb019a$export$71b2224f1ce5e08e)(QuickConnectContainerRef, ()=>{
|
|
6081
6199
|
if (isQuickConnectPopupVisible) setIsQuickConnectPopupVisible(false);
|
|
6082
6200
|
});
|
|
@@ -6092,13 +6210,13 @@ const $681806ce8015ae4d$var$QuickConnect = ()=>{
|
|
|
6092
6210
|
url.searchParams.set("microphone-enabled", "0");
|
|
6093
6211
|
url.searchParams.set("camera-enabled", "1");
|
|
6094
6212
|
url.searchParams.set("quick-connect", selfPeerId);
|
|
6095
|
-
if (
|
|
6213
|
+
if (profile.name) url.searchParams.set("name", profile.name);
|
|
6096
6214
|
}
|
|
6097
6215
|
return url.href;
|
|
6098
6216
|
}, [
|
|
6099
6217
|
options.sharedURL,
|
|
6100
6218
|
selfPeerId,
|
|
6101
|
-
|
|
6219
|
+
profile.name
|
|
6102
6220
|
]);
|
|
6103
6221
|
const onQuickConnectPopupCloseClick = ()=>setIsQuickConnectPopupVisible(false);
|
|
6104
6222
|
(0, $jQDcL$react.useEffect)(()=>{
|
|
@@ -6127,8 +6245,12 @@ const $681806ce8015ae4d$var$QuickConnect = ()=>{
|
|
|
6127
6245
|
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).sendCustomMessage(quickConnectParam, {
|
|
6128
6246
|
type: "quick_connect_close"
|
|
6129
6247
|
});
|
|
6130
|
-
if (quickConnectNameParam) (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).
|
|
6131
|
-
|
|
6248
|
+
if (quickConnectNameParam) (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).setProfile({
|
|
6249
|
+
name: `${quickConnectNameParam} (mobile)`
|
|
6250
|
+
});
|
|
6251
|
+
else (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).setProfile({
|
|
6252
|
+
name: "Mobile"
|
|
6253
|
+
});
|
|
6132
6254
|
}
|
|
6133
6255
|
}
|
|
6134
6256
|
}, [
|
|
@@ -6341,8 +6463,10 @@ const $5f1594faf2dff407$export$db1aade9877208c7 = (0, ($parcel$interopDefault($j
|
|
|
6341
6463
|
border-radius: 10px;
|
|
6342
6464
|
justify-content: space-between;
|
|
6343
6465
|
align-items: center;
|
|
6344
|
-
padding:
|
|
6466
|
+
padding: 15px;
|
|
6345
6467
|
font-size: 14px;
|
|
6468
|
+
font-weight: 600;
|
|
6469
|
+
line-height: 20px;
|
|
6346
6470
|
color: ${(props)=>props.theme.settingsTextColor};
|
|
6347
6471
|
|
|
6348
6472
|
span {
|
|
@@ -6487,39 +6611,48 @@ var $54c346ed2df7d69f$export$2e2bcd8739ae039 = $54c346ed2df7d69f$var$LanguageSub
|
|
|
6487
6611
|
|
|
6488
6612
|
|
|
6489
6613
|
|
|
6614
|
+
|
|
6615
|
+
|
|
6490
6616
|
const $96bb6d4b0a403c60$var$AudioSubMenu = ({ back: back })=>{
|
|
6491
|
-
const [
|
|
6492
|
-
const [currentMic, setCurrentMic] = (0, $jQDcL$react.useState)(
|
|
6493
|
-
const [
|
|
6494
|
-
const
|
|
6495
|
-
const
|
|
6496
|
-
const
|
|
6497
|
-
|
|
6498
|
-
|
|
6499
|
-
|
|
6500
|
-
|
|
6501
|
-
|
|
6502
|
-
|
|
6503
|
-
|
|
6504
|
-
|
|
6505
|
-
|
|
6506
|
-
|
|
6507
|
-
const onMicClick = (0, $jQDcL$react.useCallback)(async (mic)=>{
|
|
6617
|
+
const [audioDevices, setAudioDevices] = (0, $jQDcL$react.useState)([]);
|
|
6618
|
+
const [currentMic, setCurrentMic] = (0, $jQDcL$react.useState)();
|
|
6619
|
+
const [currentSpeaker, setCurrentSpeaker] = (0, $jQDcL$react.useState)();
|
|
6620
|
+
const microphoneDevices = audioDevices.filter((device)=>device.kind === "audioinput");
|
|
6621
|
+
const speakerDevices = audioDevices.filter((device)=>device.kind === "audiooutput");
|
|
6622
|
+
const isMicrophoneAccessBlocked = microphoneDevices.length && audioDevices.every((device)=>device.deviceId === "");
|
|
6623
|
+
const canChangeSpeakers = "setSinkId" in HTMLAudioElement.prototype;
|
|
6624
|
+
const listDevices = async ()=>{
|
|
6625
|
+
const audioDevicesList = await (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).listAudioDevices();
|
|
6626
|
+
setAudioDevices(audioDevicesList);
|
|
6627
|
+
const speaker = audioDevicesList.find((device)=>device.kind === "audiooutput" && device.deviceId === "default");
|
|
6628
|
+
const mic = audioDevicesList.find((device)=>device.kind === "audioinput" && device.deviceId === "default");
|
|
6629
|
+
setCurrentMic(mic);
|
|
6630
|
+
setCurrentSpeaker(speaker);
|
|
6631
|
+
};
|
|
6632
|
+
const onMicClick = async (mic)=>{
|
|
6508
6633
|
if (currentMic?.deviceId === mic.deviceId) return;
|
|
6509
6634
|
await (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).switchMicrophone(mic.deviceId);
|
|
6510
6635
|
setCurrentMic(mic);
|
|
6511
|
-
(0, $84c6cbcbb594d072$export$3a57e165650c636f)(`Connected to ${mic.label}
|
|
6512
|
-
|
|
6513
|
-
|
|
6514
|
-
|
|
6515
|
-
|
|
6636
|
+
(0, $84c6cbcbb594d072$export$3a57e165650c636f)(`Connected to ${mic.label}`, {
|
|
6637
|
+
duration: 3000,
|
|
6638
|
+
icon: /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $0ac48791ff0bcc8e$export$2e2bcd8739ae039), {}),
|
|
6639
|
+
messageStyle: {
|
|
6640
|
+
fontWeight: 600
|
|
6641
|
+
}
|
|
6642
|
+
});
|
|
6643
|
+
};
|
|
6644
|
+
const onSpeakerClick = (speaker)=>{
|
|
6516
6645
|
if (currentSpeaker?.deviceId === speaker.deviceId) return;
|
|
6517
6646
|
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).setAudioSink(speaker.deviceId);
|
|
6518
6647
|
setCurrentSpeaker(speaker);
|
|
6519
|
-
(0, $84c6cbcbb594d072$export$3a57e165650c636f)(`Connected to ${speaker.label}
|
|
6520
|
-
|
|
6521
|
-
|
|
6522
|
-
|
|
6648
|
+
(0, $84c6cbcbb594d072$export$3a57e165650c636f)(`Connected to ${speaker.label}`, {
|
|
6649
|
+
duration: 3000,
|
|
6650
|
+
icon: /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $802dd6755664a000$export$2e2bcd8739ae039), {}),
|
|
6651
|
+
messageStyle: {
|
|
6652
|
+
fontWeight: 600
|
|
6653
|
+
}
|
|
6654
|
+
});
|
|
6655
|
+
};
|
|
6523
6656
|
(0, $jQDcL$react.useEffect)(()=>{
|
|
6524
6657
|
listDevices();
|
|
6525
6658
|
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).addEventListener("devicesListChange", listDevices);
|
|
@@ -6540,61 +6673,64 @@ const $96bb6d4b0a403c60$var$AudioSubMenu = ({ back: back })=>{
|
|
|
6540
6673
|
})
|
|
6541
6674
|
]
|
|
6542
6675
|
}),
|
|
6543
|
-
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.
|
|
6544
|
-
children:
|
|
6545
|
-
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $5f1594faf2dff407$export$
|
|
6546
|
-
children: [
|
|
6547
|
-
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $5f1594faf2dff407$export$5caf84ac7a22e7b5), {
|
|
6548
|
-
children: "Microphone"
|
|
6549
|
-
}),
|
|
6550
|
-
canChangeSpeakers && micDevices.map((mic)=>{
|
|
6551
|
-
const checked = mic.deviceId === currentMic?.deviceId;
|
|
6552
|
-
return /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $5f1594faf2dff407$export$db1aade9877208c7), {
|
|
6553
|
-
onClick: ()=>onMicClick(mic),
|
|
6554
|
-
children: [
|
|
6555
|
-
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $5f1594faf2dff407$export$f132d77f01dce0a3), {
|
|
6556
|
-
children: mic.label
|
|
6557
|
-
}),
|
|
6558
|
-
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)("span", {
|
|
6559
|
-
children: checked && /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $41e530447f5fd995$export$2e2bcd8739ae039), {})
|
|
6560
|
-
})
|
|
6561
|
-
]
|
|
6562
|
-
}, mic.deviceId);
|
|
6563
|
-
}),
|
|
6564
|
-
!canChangeSpeakers && micDevices.length < 1 && /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $5f1594faf2dff407$export$87d6be27a51dc3c4), {
|
|
6565
|
-
children: [
|
|
6566
|
-
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $5f1594faf2dff407$export$30ccd51431e4a7b0), {
|
|
6567
|
-
children: "Microphone is blocked."
|
|
6568
|
-
}),
|
|
6569
|
-
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $5f1594faf2dff407$export$73afb47ae3e10bf1), {
|
|
6570
|
-
children: "Please accept microphone sharing before accessing these options."
|
|
6571
|
-
})
|
|
6572
|
-
]
|
|
6573
|
-
})
|
|
6574
|
-
]
|
|
6575
|
-
}),
|
|
6576
|
-
canChangeSpeakers && /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $5f1594faf2dff407$export$38050e761cbb2b1d), {
|
|
6676
|
+
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $5f1594faf2dff407$export$b286f91cddfedb5a), {
|
|
6677
|
+
children: isMicrophoneAccessBlocked ? /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $5f1594faf2dff407$export$38050e761cbb2b1d), {
|
|
6678
|
+
children: /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $5f1594faf2dff407$export$87d6be27a51dc3c4), {
|
|
6577
6679
|
children: [
|
|
6578
|
-
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $5f1594faf2dff407$export$
|
|
6579
|
-
children: "
|
|
6680
|
+
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $5f1594faf2dff407$export$30ccd51431e4a7b0), {
|
|
6681
|
+
children: "Microphone is blocked."
|
|
6580
6682
|
}),
|
|
6581
|
-
|
|
6582
|
-
|
|
6583
|
-
return /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $5f1594faf2dff407$export$db1aade9877208c7), {
|
|
6584
|
-
onClick: ()=>onSpeakerClick(speaker),
|
|
6585
|
-
children: [
|
|
6586
|
-
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $5f1594faf2dff407$export$f132d77f01dce0a3), {
|
|
6587
|
-
children: speaker.label
|
|
6588
|
-
}),
|
|
6589
|
-
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)("span", {
|
|
6590
|
-
children: checked && /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $41e530447f5fd995$export$2e2bcd8739ae039), {})
|
|
6591
|
-
})
|
|
6592
|
-
]
|
|
6593
|
-
}, speaker.deviceId);
|
|
6683
|
+
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $5f1594faf2dff407$export$73afb47ae3e10bf1), {
|
|
6684
|
+
children: "Please accept microphone sharing before accessing these options."
|
|
6594
6685
|
})
|
|
6595
6686
|
]
|
|
6596
6687
|
})
|
|
6597
|
-
|
|
6688
|
+
}) : /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $jQDcL$reactjsxruntime.Fragment), {
|
|
6689
|
+
children: [
|
|
6690
|
+
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $5f1594faf2dff407$export$38050e761cbb2b1d), {
|
|
6691
|
+
children: [
|
|
6692
|
+
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $5f1594faf2dff407$export$5caf84ac7a22e7b5), {
|
|
6693
|
+
children: "Microphone"
|
|
6694
|
+
}),
|
|
6695
|
+
microphoneDevices.map((microphone)=>{
|
|
6696
|
+
const checked = microphone.deviceId === currentMic?.deviceId;
|
|
6697
|
+
return /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $5f1594faf2dff407$export$db1aade9877208c7), {
|
|
6698
|
+
onClick: ()=>onMicClick(microphone),
|
|
6699
|
+
children: [
|
|
6700
|
+
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $5f1594faf2dff407$export$f132d77f01dce0a3), {
|
|
6701
|
+
children: microphone.label
|
|
6702
|
+
}),
|
|
6703
|
+
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)("span", {
|
|
6704
|
+
children: checked && /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $41e530447f5fd995$export$2e2bcd8739ae039), {})
|
|
6705
|
+
})
|
|
6706
|
+
]
|
|
6707
|
+
}, microphone.deviceId);
|
|
6708
|
+
})
|
|
6709
|
+
]
|
|
6710
|
+
}),
|
|
6711
|
+
canChangeSpeakers && /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $5f1594faf2dff407$export$38050e761cbb2b1d), {
|
|
6712
|
+
children: [
|
|
6713
|
+
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $5f1594faf2dff407$export$5caf84ac7a22e7b5), {
|
|
6714
|
+
children: "Speakers"
|
|
6715
|
+
}),
|
|
6716
|
+
speakerDevices.map((speaker)=>{
|
|
6717
|
+
const checked = speaker.deviceId === currentSpeaker?.deviceId;
|
|
6718
|
+
return /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $5f1594faf2dff407$export$db1aade9877208c7), {
|
|
6719
|
+
onClick: ()=>onSpeakerClick(speaker),
|
|
6720
|
+
children: [
|
|
6721
|
+
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $5f1594faf2dff407$export$f132d77f01dce0a3), {
|
|
6722
|
+
children: speaker.label
|
|
6723
|
+
}),
|
|
6724
|
+
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)("span", {
|
|
6725
|
+
children: checked && /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $41e530447f5fd995$export$2e2bcd8739ae039), {})
|
|
6726
|
+
})
|
|
6727
|
+
]
|
|
6728
|
+
}, speaker.deviceId);
|
|
6729
|
+
})
|
|
6730
|
+
]
|
|
6731
|
+
})
|
|
6732
|
+
]
|
|
6733
|
+
})
|
|
6598
6734
|
})
|
|
6599
6735
|
]
|
|
6600
6736
|
});
|
|
@@ -6610,6 +6746,7 @@ var $96bb6d4b0a403c60$export$2e2bcd8739ae039 = $96bb6d4b0a403c60$var$AudioSubMen
|
|
|
6610
6746
|
|
|
6611
6747
|
|
|
6612
6748
|
|
|
6749
|
+
|
|
6613
6750
|
const $097072919b56b62a$var$resolutions = Object.keys((0, $1dedebd5ff3002eb$export$d21ffcc5eb136bfa)).map((key)=>{
|
|
6614
6751
|
const constraints = (0, $1dedebd5ff3002eb$export$d21ffcc5eb136bfa);
|
|
6615
6752
|
switch(constraints[key].height.ideal){
|
|
@@ -6625,7 +6762,7 @@ const $097072919b56b62a$var$resolutions = Object.keys((0, $1dedebd5ff3002eb$expo
|
|
|
6625
6762
|
};
|
|
6626
6763
|
case 720:
|
|
6627
6764
|
return {
|
|
6628
|
-
name: "
|
|
6765
|
+
name: "High definition (720p)",
|
|
6629
6766
|
key: key
|
|
6630
6767
|
};
|
|
6631
6768
|
default:
|
|
@@ -6636,36 +6773,34 @@ const $097072919b56b62a$var$resolutions = Object.keys((0, $1dedebd5ff3002eb$expo
|
|
|
6636
6773
|
}
|
|
6637
6774
|
}).filter((def)=>def.name !== "");
|
|
6638
6775
|
const $097072919b56b62a$var$VideoSubMenu = ({ back: back })=>{
|
|
6639
|
-
const [cameraDevices, setCameraDevices] = (0, $jQDcL$react.useState)(
|
|
6776
|
+
const [cameraDevices, setCameraDevices] = (0, $jQDcL$react.useState)([]);
|
|
6640
6777
|
const [currentCamera, setCurrentCamera] = (0, $jQDcL$react.useState)((0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).getCurrentWebcam());
|
|
6778
|
+
const isCameraAccessBlocked = cameraDevices.length && cameraDevices.every((device)=>device.deviceId === "");
|
|
6641
6779
|
const listDevices = async ()=>{
|
|
6642
|
-
const
|
|
6643
|
-
|
|
6644
|
-
if (authorisedCameras.length > 0) setCameraDevices(authorisedCameras);
|
|
6780
|
+
const videoDevices = await (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).listVideoDevices();
|
|
6781
|
+
setCameraDevices(videoDevices);
|
|
6645
6782
|
};
|
|
6646
6783
|
const onCameraClick = async (camera)=>{
|
|
6647
6784
|
if (currentCamera.device?.deviceId === camera.deviceId) return;
|
|
6648
|
-
if (currentCamera.device) {
|
|
6649
|
-
|
|
6650
|
-
|
|
6651
|
-
|
|
6652
|
-
|
|
6653
|
-
|
|
6654
|
-
|
|
6655
|
-
|
|
6656
|
-
|
|
6657
|
-
|
|
6658
|
-
|
|
6659
|
-
|
|
6660
|
-
|
|
6661
|
-
|
|
6662
|
-
});
|
|
6663
|
-
}
|
|
6785
|
+
if (currentCamera.device) await (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).switchWebcam({
|
|
6786
|
+
device: camera
|
|
6787
|
+
});
|
|
6788
|
+
else await (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).enableVideo({
|
|
6789
|
+
device: camera,
|
|
6790
|
+
resolution: currentCamera.resolution
|
|
6791
|
+
});
|
|
6792
|
+
(0, $84c6cbcbb594d072$export$3a57e165650c636f)(`Connected to ${camera.label}`, {
|
|
6793
|
+
duration: 3000,
|
|
6794
|
+
icon: /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $ab00aedf8a706bfe$export$2e2bcd8739ae039), {}),
|
|
6795
|
+
messageStyle: {
|
|
6796
|
+
fontWeight: 600
|
|
6797
|
+
}
|
|
6798
|
+
});
|
|
6664
6799
|
};
|
|
6665
6800
|
const onSendResolutionClick = async (resolution)=>{
|
|
6666
6801
|
if (currentCamera.resolution === resolution.key) return;
|
|
6667
6802
|
await (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).setWebcamResolution(resolution.key);
|
|
6668
|
-
(0, $84c6cbcbb594d072$export$3a57e165650c636f)(
|
|
6803
|
+
(0, $84c6cbcbb594d072$export$3a57e165650c636f)(resolution.name, {
|
|
6669
6804
|
duration: 3000
|
|
6670
6805
|
});
|
|
6671
6806
|
};
|
|
@@ -6700,61 +6835,64 @@ const $097072919b56b62a$var$VideoSubMenu = ({ back: back })=>{
|
|
|
6700
6835
|
})
|
|
6701
6836
|
]
|
|
6702
6837
|
}),
|
|
6703
|
-
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.
|
|
6704
|
-
children:
|
|
6705
|
-
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $5f1594faf2dff407$export$
|
|
6706
|
-
children: [
|
|
6707
|
-
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $5f1594faf2dff407$export$5caf84ac7a22e7b5), {
|
|
6708
|
-
children: "Camera"
|
|
6709
|
-
}),
|
|
6710
|
-
cameraDevices.map((camera)=>{
|
|
6711
|
-
const checked = camera.deviceId === currentCamera.device?.deviceId;
|
|
6712
|
-
return /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $5f1594faf2dff407$export$db1aade9877208c7), {
|
|
6713
|
-
onClick: ()=>onCameraClick(camera),
|
|
6714
|
-
children: [
|
|
6715
|
-
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $5f1594faf2dff407$export$f132d77f01dce0a3), {
|
|
6716
|
-
children: camera.label
|
|
6717
|
-
}),
|
|
6718
|
-
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)("span", {
|
|
6719
|
-
children: checked && /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $41e530447f5fd995$export$2e2bcd8739ae039), {})
|
|
6720
|
-
})
|
|
6721
|
-
]
|
|
6722
|
-
}, camera.deviceId);
|
|
6723
|
-
}),
|
|
6724
|
-
cameraDevices.length < 1 && /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $5f1594faf2dff407$export$87d6be27a51dc3c4), {
|
|
6725
|
-
children: [
|
|
6726
|
-
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $5f1594faf2dff407$export$30ccd51431e4a7b0), {
|
|
6727
|
-
children: "Camera is blocked."
|
|
6728
|
-
}),
|
|
6729
|
-
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $5f1594faf2dff407$export$73afb47ae3e10bf1), {
|
|
6730
|
-
children: "Please accept camera sharing before accessing these options."
|
|
6731
|
-
})
|
|
6732
|
-
]
|
|
6733
|
-
})
|
|
6734
|
-
]
|
|
6735
|
-
}),
|
|
6736
|
-
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $5f1594faf2dff407$export$38050e761cbb2b1d), {
|
|
6838
|
+
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $5f1594faf2dff407$export$b286f91cddfedb5a), {
|
|
6839
|
+
children: isCameraAccessBlocked ? /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $5f1594faf2dff407$export$38050e761cbb2b1d), {
|
|
6840
|
+
children: /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $5f1594faf2dff407$export$87d6be27a51dc3c4), {
|
|
6737
6841
|
children: [
|
|
6738
|
-
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $5f1594faf2dff407$export$
|
|
6739
|
-
children: "
|
|
6842
|
+
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $5f1594faf2dff407$export$30ccd51431e4a7b0), {
|
|
6843
|
+
children: "Camera is blocked."
|
|
6740
6844
|
}),
|
|
6741
|
-
$
|
|
6742
|
-
|
|
6743
|
-
return /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $5f1594faf2dff407$export$db1aade9877208c7), {
|
|
6744
|
-
onClick: ()=>onSendResolutionClick(resolution),
|
|
6745
|
-
children: [
|
|
6746
|
-
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $5f1594faf2dff407$export$f132d77f01dce0a3), {
|
|
6747
|
-
children: resolution.name
|
|
6748
|
-
}),
|
|
6749
|
-
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)("span", {
|
|
6750
|
-
children: checked && /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $41e530447f5fd995$export$2e2bcd8739ae039), {})
|
|
6751
|
-
})
|
|
6752
|
-
]
|
|
6753
|
-
}, resolution.key);
|
|
6845
|
+
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $5f1594faf2dff407$export$73afb47ae3e10bf1), {
|
|
6846
|
+
children: "Please accept camera sharing before accessing these options."
|
|
6754
6847
|
})
|
|
6755
6848
|
]
|
|
6756
6849
|
})
|
|
6757
|
-
|
|
6850
|
+
}) : /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $jQDcL$reactjsxruntime.Fragment), {
|
|
6851
|
+
children: [
|
|
6852
|
+
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $5f1594faf2dff407$export$38050e761cbb2b1d), {
|
|
6853
|
+
children: [
|
|
6854
|
+
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $5f1594faf2dff407$export$5caf84ac7a22e7b5), {
|
|
6855
|
+
children: "Camera"
|
|
6856
|
+
}),
|
|
6857
|
+
cameraDevices.map((camera)=>{
|
|
6858
|
+
const checked = camera.deviceId === currentCamera.device?.deviceId;
|
|
6859
|
+
return /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $5f1594faf2dff407$export$db1aade9877208c7), {
|
|
6860
|
+
onClick: ()=>onCameraClick(camera),
|
|
6861
|
+
children: [
|
|
6862
|
+
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $5f1594faf2dff407$export$f132d77f01dce0a3), {
|
|
6863
|
+
children: camera.label
|
|
6864
|
+
}),
|
|
6865
|
+
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)("span", {
|
|
6866
|
+
children: checked && /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $41e530447f5fd995$export$2e2bcd8739ae039), {})
|
|
6867
|
+
})
|
|
6868
|
+
]
|
|
6869
|
+
}, camera.deviceId);
|
|
6870
|
+
})
|
|
6871
|
+
]
|
|
6872
|
+
}),
|
|
6873
|
+
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $5f1594faf2dff407$export$38050e761cbb2b1d), {
|
|
6874
|
+
children: [
|
|
6875
|
+
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $5f1594faf2dff407$export$5caf84ac7a22e7b5), {
|
|
6876
|
+
children: "Send Resolution (maximum)"
|
|
6877
|
+
}),
|
|
6878
|
+
$097072919b56b62a$var$resolutions.map((resolution)=>{
|
|
6879
|
+
const checked = resolution.key === currentCamera.resolution;
|
|
6880
|
+
return /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $5f1594faf2dff407$export$db1aade9877208c7), {
|
|
6881
|
+
onClick: ()=>onSendResolutionClick(resolution),
|
|
6882
|
+
children: [
|
|
6883
|
+
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $5f1594faf2dff407$export$f132d77f01dce0a3), {
|
|
6884
|
+
children: resolution.name
|
|
6885
|
+
}),
|
|
6886
|
+
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)("span", {
|
|
6887
|
+
children: checked && /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $41e530447f5fd995$export$2e2bcd8739ae039), {})
|
|
6888
|
+
})
|
|
6889
|
+
]
|
|
6890
|
+
}, resolution.key);
|
|
6891
|
+
})
|
|
6892
|
+
]
|
|
6893
|
+
})
|
|
6894
|
+
]
|
|
6895
|
+
})
|
|
6758
6896
|
})
|
|
6759
6897
|
]
|
|
6760
6898
|
});
|
|
@@ -6969,7 +7107,8 @@ const $219bb3131afe1272$export$11781939bbc73f8b = (0, ($parcel$interopDefault($j
|
|
|
6969
7107
|
}
|
|
6970
7108
|
|
|
6971
7109
|
svg {
|
|
6972
|
-
|
|
7110
|
+
width: 20px;
|
|
7111
|
+
height: 21px;
|
|
6973
7112
|
}
|
|
6974
7113
|
`;
|
|
6975
7114
|
const $219bb3131afe1272$export$7ae684a6a708b51d = (0, ($parcel$interopDefault($jQDcL$styledcomponents))).button`
|
|
@@ -6984,8 +7123,8 @@ const $219bb3131afe1272$export$7ae684a6a708b51d = (0, ($parcel$interopDefault($j
|
|
|
6984
7123
|
padding: 0;
|
|
6985
7124
|
|
|
6986
7125
|
svg {
|
|
6987
|
-
height:
|
|
6988
|
-
width:
|
|
7126
|
+
height: 15px;
|
|
7127
|
+
width: 15px;
|
|
6989
7128
|
|
|
6990
7129
|
path {
|
|
6991
7130
|
fill: #000;
|
|
@@ -7256,7 +7395,8 @@ const $2d8fe9775ff247d9$export$7563f0d47f114601 = (0, ($parcel$interopDefault($j
|
|
|
7256
7395
|
}
|
|
7257
7396
|
|
|
7258
7397
|
svg {
|
|
7259
|
-
|
|
7398
|
+
width: 20px;
|
|
7399
|
+
height: 20px;
|
|
7260
7400
|
}
|
|
7261
7401
|
`;
|
|
7262
7402
|
const $2d8fe9775ff247d9$export$fcade06574a60ff0 = (0, ($parcel$interopDefault($jQDcL$styledcomponents))).button`
|
|
@@ -7271,8 +7411,8 @@ const $2d8fe9775ff247d9$export$fcade06574a60ff0 = (0, ($parcel$interopDefault($j
|
|
|
7271
7411
|
padding: 0;
|
|
7272
7412
|
|
|
7273
7413
|
svg {
|
|
7274
|
-
|
|
7275
|
-
|
|
7414
|
+
width: 15px;
|
|
7415
|
+
height: 15px;
|
|
7276
7416
|
|
|
7277
7417
|
path {
|
|
7278
7418
|
fill: #000;
|
|
@@ -7414,7 +7554,7 @@ const $e38290b50aaba0e3$var$LinksharePopup = ()=>{
|
|
|
7414
7554
|
if (type === $e38290b50aaba0e3$export$a1eac7fdbc2db4af) $e38290b50aaba0e3$var$sendLinkNotification(data);
|
|
7415
7555
|
else if (type === "paypal_invoice") {
|
|
7416
7556
|
const sender = streams.find((stream)=>stream.id === event.detail.peerId);
|
|
7417
|
-
$e38290b50aaba0e3$var$sendPaypalInvoiceNotification(sender?.
|
|
7557
|
+
$e38290b50aaba0e3$var$sendPaypalInvoiceNotification(sender?.profile?.name, data.url);
|
|
7418
7558
|
}
|
|
7419
7559
|
}, [
|
|
7420
7560
|
streams
|
|
@@ -7447,7 +7587,7 @@ const $e38290b50aaba0e3$var$LinksharePopup = ()=>{
|
|
|
7447
7587
|
data: data
|
|
7448
7588
|
});
|
|
7449
7589
|
}
|
|
7450
|
-
if (streams.length < 2) (0, ($parcel$interopDefault($jQDcL$reacthottoast)))(`Link sent to ${streams[0]?.
|
|
7590
|
+
if (streams.length < 2) (0, ($parcel$interopDefault($jQDcL$reacthottoast)))(`Link sent to ${streams[0]?.profile?.name || "User"}`);
|
|
7451
7591
|
else (0, ($parcel$interopDefault($jQDcL$reacthottoast)))("Link sent to users");
|
|
7452
7592
|
setIsLinksharePopupVisible(false);
|
|
7453
7593
|
} catch (err) {
|
|
@@ -8004,6 +8144,80 @@ var $e41262de25602ed2$export$2e2bcd8739ae039 = $e41262de25602ed2$var$SvgDefiniti
|
|
|
8004
8144
|
|
|
8005
8145
|
|
|
8006
8146
|
|
|
8147
|
+
|
|
8148
|
+
|
|
8149
|
+
const $71b731057ba65bc2$export$8bac64dfa46a096a = (0, ($parcel$interopDefault($jQDcL$styledcomponents))).div`
|
|
8150
|
+
display: flex;
|
|
8151
|
+
justify-content: center;
|
|
8152
|
+
align-items: center;
|
|
8153
|
+
position: absolute;
|
|
8154
|
+
width: 100%;
|
|
8155
|
+
height: 100%;
|
|
8156
|
+
background-color: rgba(0, 0, 0, 0.75);
|
|
8157
|
+
z-index: 999;
|
|
8158
|
+
`;
|
|
8159
|
+
const $71b731057ba65bc2$export$f2f6e48f0181f95d = (0, ($parcel$interopDefault($jQDcL$styledcomponents))).div`
|
|
8160
|
+
display: flex;
|
|
8161
|
+
flex-direction: column;
|
|
8162
|
+
align-items: flex-start;
|
|
8163
|
+
background-color: #fff;
|
|
8164
|
+
padding: 20px;
|
|
8165
|
+
max-width: 300px;
|
|
8166
|
+
border-radius: 10px;
|
|
8167
|
+
box-sizing: border-box;
|
|
8168
|
+
`;
|
|
8169
|
+
const $71b731057ba65bc2$export$b834616c6081368f = (0, ($parcel$interopDefault($jQDcL$styledcomponents))).h2`
|
|
8170
|
+
font-size: 16px;
|
|
8171
|
+
font-weight: 700;
|
|
8172
|
+
color: #242324;
|
|
8173
|
+
margin: 0 0 10px 0;
|
|
8174
|
+
`;
|
|
8175
|
+
const $71b731057ba65bc2$export$12ed2ca69ff6905b = (0, ($parcel$interopDefault($jQDcL$styledcomponents))).p`
|
|
8176
|
+
font-size: 12px;
|
|
8177
|
+
font-weight: 500;
|
|
8178
|
+
color: #2d2d2d;
|
|
8179
|
+
margin: 0 0 15px 0;
|
|
8180
|
+
`;
|
|
8181
|
+
const $71b731057ba65bc2$export$d39b0d24481757e7 = (0, ($parcel$interopDefault($jQDcL$styledcomponents))).button`
|
|
8182
|
+
align-self: flex-end;
|
|
8183
|
+
color: #242324;
|
|
8184
|
+
background-color: transparent;
|
|
8185
|
+
border: 2px solid #242324;
|
|
8186
|
+
border-radius: 50px;
|
|
8187
|
+
padding: 8px 18px;
|
|
8188
|
+
box-sizing: border-box;
|
|
8189
|
+
font-size: 14px;
|
|
8190
|
+
font-weight: 700;
|
|
8191
|
+
line-height: 16px;
|
|
8192
|
+
|
|
8193
|
+
&:hover {
|
|
8194
|
+
color: #fff;
|
|
8195
|
+
background-color: #242324;
|
|
8196
|
+
}
|
|
8197
|
+
`;
|
|
8198
|
+
|
|
8199
|
+
|
|
8200
|
+
const $77862aeb490f36a3$var$BlockedDevicesPopup = ({ close: close })=>{
|
|
8201
|
+
return /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $71b731057ba65bc2$export$8bac64dfa46a096a), {
|
|
8202
|
+
children: /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $71b731057ba65bc2$export$f2f6e48f0181f95d), {
|
|
8203
|
+
children: [
|
|
8204
|
+
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $71b731057ba65bc2$export$b834616c6081368f), {
|
|
8205
|
+
children: "Camera and microphone are blocked"
|
|
8206
|
+
}),
|
|
8207
|
+
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $71b731057ba65bc2$export$12ed2ca69ff6905b), {
|
|
8208
|
+
children: "SnapCall requires access to your camera and microphone. Click the camera blocked icon in your browser's address bar."
|
|
8209
|
+
}),
|
|
8210
|
+
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $71b731057ba65bc2$export$d39b0d24481757e7), {
|
|
8211
|
+
onClick: close,
|
|
8212
|
+
children: "Dismiss"
|
|
8213
|
+
})
|
|
8214
|
+
]
|
|
8215
|
+
})
|
|
8216
|
+
});
|
|
8217
|
+
};
|
|
8218
|
+
var $77862aeb490f36a3$export$2e2bcd8739ae039 = $77862aeb490f36a3$var$BlockedDevicesPopup;
|
|
8219
|
+
|
|
8220
|
+
|
|
8007
8221
|
// https://github.com/video-dev/can-autoplay
|
|
8008
8222
|
const $c3d5253d9d597eb5$var$audioSource = new Blob([
|
|
8009
8223
|
new Uint8Array([
|
|
@@ -8315,6 +8529,7 @@ const $e3bb2c5d0e5b45b5$export$914ddf2021ea8ee6 = (0, ($parcel$interopDefault($j
|
|
|
8315
8529
|
|
|
8316
8530
|
|
|
8317
8531
|
|
|
8532
|
+
|
|
8318
8533
|
const $ee8cb448c2c74888$var$currentTheme = (0, $9295e87e6b93e693$export$3bfd0d5209a8006a)();
|
|
8319
8534
|
const $ee8cb448c2c74888$var$currentLanguage = (0, $54c346ed2df7d69f$export$604ba5624273df44)();
|
|
8320
8535
|
let $ee8cb448c2c74888$var$timestampCriticalError = -1;
|
|
@@ -8330,13 +8545,14 @@ const $ee8cb448c2c74888$var$StreamUI = ({ options: options })=>{
|
|
|
8330
8545
|
const [isLinksharePopupVisible, setIsLinksharePopupVisible] = (0, $jQDcL$react.useState)(false);
|
|
8331
8546
|
const [theme, setTheme] = (0, $jQDcL$react.useState)($ee8cb448c2c74888$var$currentTheme);
|
|
8332
8547
|
const [language, setLanguage] = (0, $jQDcL$react.useState)($ee8cb448c2c74888$var$currentLanguage);
|
|
8333
|
-
const [
|
|
8548
|
+
const [profile1, setProfile] = (0, $jQDcL$react.useState)({});
|
|
8334
8549
|
const [muted, setMuted] = (0, $jQDcL$react.useState)(true);
|
|
8335
8550
|
const [streaming, setStreaming] = (0, $jQDcL$react.useState)(false);
|
|
8336
8551
|
const [screensharing, setScreensharing] = (0, $jQDcL$react.useState)(false);
|
|
8337
8552
|
const [isAgent, setIsAgent] = (0, $jQDcL$react.useState)(false);
|
|
8338
8553
|
const [userInteractionTriggered, setUserInteractionTriggered] = (0, $jQDcL$react.useState)(false);
|
|
8339
8554
|
const [containerWidth, containerHeight] = (0, $56e1e7a85d8bf4bb$export$2b86bedf890eab8)(streamUIContainerRef.current);
|
|
8555
|
+
const [isBlockedDevicesPopupOpen, setBlockedDevicesPopupOpen] = (0, $jQDcL$react.useState)(false);
|
|
8340
8556
|
const orientation = containerWidth > containerHeight ? "landscape" : "portrait";
|
|
8341
8557
|
const styledTheme = theme === "dark" ? (0, $9295e87e6b93e693$export$3e936a8db52a10a0) : (0, $9295e87e6b93e693$export$f30cb9bc4f736419);
|
|
8342
8558
|
const onEnterRoom = async (event)=>{
|
|
@@ -8346,6 +8562,7 @@ const $ee8cb448c2c74888$var$StreamUI = ({ options: options })=>{
|
|
|
8346
8562
|
await (0, $c3d5253d9d597eb5$export$494039379563c94d)();
|
|
8347
8563
|
setUserInteractionTriggered(true);
|
|
8348
8564
|
} catch (userInteractionError) {
|
|
8565
|
+
setBlockedDevicesPopupOpen(true);
|
|
8349
8566
|
console.error("User interaction trigger failed", userInteractionError);
|
|
8350
8567
|
}
|
|
8351
8568
|
};
|
|
@@ -8363,11 +8580,17 @@ const $ee8cb448c2c74888$var$StreamUI = ({ options: options })=>{
|
|
|
8363
8580
|
};
|
|
8364
8581
|
const onDefaultAudioDeviceChange = (event)=>{
|
|
8365
8582
|
const micro = event.detail.label;
|
|
8366
|
-
(0,
|
|
8583
|
+
(0, $84c6cbcbb594d072$export$3a57e165650c636f)(`Connected to ${micro}`, {
|
|
8584
|
+
duration: 3000,
|
|
8585
|
+
icon: /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $0ac48791ff0bcc8e$export$2e2bcd8739ae039), {}),
|
|
8586
|
+
messageStyle: {
|
|
8587
|
+
fontWeight: 600
|
|
8588
|
+
}
|
|
8589
|
+
});
|
|
8367
8590
|
};
|
|
8368
|
-
const
|
|
8369
|
-
const {
|
|
8370
|
-
|
|
8591
|
+
const onSelfProfileUpdate = (event)=>{
|
|
8592
|
+
const { profile: profile } = event.detail;
|
|
8593
|
+
setProfile(profile);
|
|
8371
8594
|
};
|
|
8372
8595
|
const onCallEnd = ()=>{
|
|
8373
8596
|
(0, $c3d5253d9d597eb5$export$716eeec86fd18da7)();
|
|
@@ -8435,7 +8658,7 @@ const $ee8cb448c2c74888$var$StreamUI = ({ options: options })=>{
|
|
|
8435
8658
|
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).addEventListener("microphoneMute", onMicrophoneUpdate);
|
|
8436
8659
|
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).addEventListener("microphoneUnmute", onMicrophoneUpdate);
|
|
8437
8660
|
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).addEventListener("defaultAudioDeviceChange", onDefaultAudioDeviceChange);
|
|
8438
|
-
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).addEventListener("
|
|
8661
|
+
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).addEventListener("selfProfileUpdate", onSelfProfileUpdate);
|
|
8439
8662
|
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).addEventListener("terminateRoom", onCallTerminated);
|
|
8440
8663
|
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).addEventListener("leaveRoom", onCallEnd);
|
|
8441
8664
|
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).addEventListener("invalidRoom", onInvalidRoom);
|
|
@@ -8451,7 +8674,7 @@ const $ee8cb448c2c74888$var$StreamUI = ({ options: options })=>{
|
|
|
8451
8674
|
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).removeEventListener("microphoneMute", onMicrophoneUpdate);
|
|
8452
8675
|
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).removeEventListener("microphoneUnmute", onMicrophoneUpdate);
|
|
8453
8676
|
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).removeEventListener("defaultAudioDeviceChange", onDefaultAudioDeviceChange);
|
|
8454
|
-
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).removeEventListener("
|
|
8677
|
+
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).removeEventListener("selfProfileUpdate", onSelfProfileUpdate);
|
|
8455
8678
|
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).removeEventListener("terminateRoom", onCallTerminated);
|
|
8456
8679
|
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).removeEventListener("leaveRoom", onCallEnd);
|
|
8457
8680
|
(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).removeEventListener("invalidRoom", onInvalidRoom);
|
|
@@ -8480,7 +8703,7 @@ const $ee8cb448c2c74888$var$StreamUI = ({ options: options })=>{
|
|
|
8480
8703
|
language: language,
|
|
8481
8704
|
setLanguage: setLanguage,
|
|
8482
8705
|
options: options,
|
|
8483
|
-
|
|
8706
|
+
profile: profile1,
|
|
8484
8707
|
muted: muted,
|
|
8485
8708
|
streaming: streaming,
|
|
8486
8709
|
screensharing: screensharing,
|
|
@@ -8498,6 +8721,12 @@ const $ee8cb448c2c74888$var$StreamUI = ({ options: options })=>{
|
|
|
8498
8721
|
children: [
|
|
8499
8722
|
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $e66cc5db58913155$export$2e2bcd8739ae039), {}),
|
|
8500
8723
|
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $5dcd9e6925c7037c$export$2e2bcd8739ae039), {}),
|
|
8724
|
+
isBlockedDevicesPopupOpen && /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $77862aeb490f36a3$export$2e2bcd8739ae039), {
|
|
8725
|
+
close: ()=>{
|
|
8726
|
+
setUserInteractionTriggered(true);
|
|
8727
|
+
setBlockedDevicesPopupOpen(false);
|
|
8728
|
+
}
|
|
8729
|
+
}),
|
|
8501
8730
|
streamState === "streaming" && /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $jQDcL$reactjsxruntime.Fragment), {
|
|
8502
8731
|
children: /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $3f6e908c45fcc5b3$export$74636703cfe1eecf), {
|
|
8503
8732
|
children: [
|
|
@@ -8537,7 +8766,8 @@ const $e68207026aca356b$var$defaultOptions = {
|
|
|
8537
8766
|
screenshare: {
|
|
8538
8767
|
available: true
|
|
8539
8768
|
}
|
|
8540
|
-
}
|
|
8769
|
+
},
|
|
8770
|
+
streamApiURL: String("https://apistream.snapcall.io")
|
|
8541
8771
|
};
|
|
8542
8772
|
const $e68207026aca356b$export$3f94917203ab7078 = {
|
|
8543
8773
|
init: ({ element: element , ...options })=>{
|
|
@@ -8562,7 +8792,9 @@ const $e68207026aca356b$export$3f94917203ab7078 = {
|
|
|
8562
8792
|
generateToken: (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).generateToken.bind((0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2)),
|
|
8563
8793
|
addEventListener: (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).addEventListener.bind((0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2)),
|
|
8564
8794
|
dispatchEvent: (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).dispatchEvent.bind((0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2)),
|
|
8565
|
-
getState: (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).getState.bind((0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2))
|
|
8795
|
+
getState: (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).getState.bind((0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2)),
|
|
8796
|
+
setProfile: (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).setProfile.bind((0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2)),
|
|
8797
|
+
/* Should not be documented */ setConfig: (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).setConfig.bind((0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2))
|
|
8566
8798
|
};
|
|
8567
8799
|
window.streamUI = $e68207026aca356b$export$3f94917203ab7078;
|
|
8568
8800
|
// Backward compatibility
|