@snapcall/stream-ui 1.8.0 → 1.9.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 +115 -220
- package/dist/stream-ui.js +115 -220
- package/dist/stream-ui.umd.js +195 -266
- package/package.json +1 -1
package/dist/stream-ui.esm.js
CHANGED
|
@@ -449,11 +449,6 @@ const $18fb8799f38eb407$export$84584c2a98eb6753 = {
|
|
|
449
449
|
decline: "Decline",
|
|
450
450
|
you: "You"
|
|
451
451
|
},
|
|
452
|
-
invite: {
|
|
453
|
-
title: "Share link to start a conversation",
|
|
454
|
-
copy: "Copy",
|
|
455
|
-
description: "You are currently the only participant. Invite people to start the conversation."
|
|
456
|
-
},
|
|
457
452
|
greeting: {
|
|
458
453
|
mainTitle: "Welcome to SnapCall",
|
|
459
454
|
sideTitle: "Are you ready to join?",
|
|
@@ -594,11 +589,6 @@ const $c5472fb74fa04782$export$acb2a88f7d552ebf = {
|
|
|
594
589
|
decline: "D\xe9cliner",
|
|
595
590
|
you: "Vous"
|
|
596
591
|
},
|
|
597
|
-
invite: {
|
|
598
|
-
title: "Partagez le lien pour commencer une conversation",
|
|
599
|
-
copy: "Copier",
|
|
600
|
-
description: "Vous \xeates actuellement le seul participant. Inviter des personnes pour commencer la conversation."
|
|
601
|
-
},
|
|
602
592
|
greeting: {
|
|
603
593
|
mainTitle: "Bienvenue sur SnapCall",
|
|
604
594
|
sideTitle: "Pr\xeat \xe0 rejoindre ?",
|
|
@@ -743,11 +733,6 @@ const $b7790fb9e48df5c4$export$3486a10f30cf1ee4 = {
|
|
|
743
733
|
decline: "Declinare",
|
|
744
734
|
you: "Voi"
|
|
745
735
|
},
|
|
746
|
-
invite: {
|
|
747
|
-
title: "Condividi link per avviare una conversazione",
|
|
748
|
-
copy: "Copiare",
|
|
749
|
-
description: "Attualmente sei l'unico partecipante. Invita le persone ad iniziare la conversazione."
|
|
750
|
-
},
|
|
751
736
|
greeting: {
|
|
752
737
|
mainTitle: "Benvenuto a SnapCall",
|
|
753
738
|
sideTitle: "Sei pronto per unirti?",
|
|
@@ -1190,7 +1175,7 @@ class $a2f0e3c29b11c88e$export$2e2bcd8739ae039 {
|
|
|
1190
1175
|
|
|
1191
1176
|
|
|
1192
1177
|
const $0148b6fd862a22e8$var$log = new (0, $0f65a9eaf4a1e910$export$2e2bcd8739ae039)("MediaPipe");
|
|
1193
|
-
const $0148b6fd862a22e8$var$mediapipeUrl = "https://stream-assets.snapcall.io
|
|
1178
|
+
const $0148b6fd862a22e8$var$mediapipeUrl = "https://stream-assets.snapcall.io";
|
|
1194
1179
|
let $0148b6fd862a22e8$var$selfieSegmentationInitialized = false;
|
|
1195
1180
|
const $0148b6fd862a22e8$var$selfieSegmentation = new $3Sbms$SelfieSegmentation({
|
|
1196
1181
|
locateFile: (file, prefix)=>{
|
|
@@ -6259,104 +6244,8 @@ var $b496fc6f0d99c06d$export$2e2bcd8739ae039 = $b496fc6f0d99c06d$var$Highlighted
|
|
|
6259
6244
|
|
|
6260
6245
|
|
|
6261
6246
|
|
|
6262
|
-
const $b56218b5a57cb77c$export$dd2ac23a70f320dd = (0, $3Sbms$styledcomponents).div`
|
|
6263
|
-
display: ${({ show: show })=>show ? "flex" : "none"};
|
|
6264
|
-
flex-direction: column;
|
|
6265
|
-
justify-content: center;
|
|
6266
|
-
align-items: center;
|
|
6267
|
-
position: relative;
|
|
6268
|
-
width: ${({ width: width })=>width};
|
|
6269
|
-
height: ${({ height: height })=>height};
|
|
6270
|
-
background-color: ${({ theme: theme })=>theme.streamTileBackgroundColor};
|
|
6271
|
-
border: 2px solid ${({ theme: theme })=>theme.streamTileBorderColor};
|
|
6272
|
-
border-radius: 20px;
|
|
6273
|
-
box-sizing: border-box;
|
|
6274
|
-
color: #fff;
|
|
6275
|
-
font-family: Lato;
|
|
6276
|
-
padding: 20px;
|
|
6277
|
-
`;
|
|
6278
|
-
const $b56218b5a57cb77c$export$2dabfbe763cc7a4 = (0, $3Sbms$styledcomponents).h2`
|
|
6279
|
-
font-weight: 600;
|
|
6280
|
-
font-size: 16px;
|
|
6281
|
-
text-align: center;
|
|
6282
|
-
max-width: 300px;
|
|
6283
|
-
`;
|
|
6284
|
-
const $b56218b5a57cb77c$export$6ed6e36e1b456f96 = (0, $3Sbms$styledcomponents).div`
|
|
6285
|
-
position: relative;
|
|
6286
|
-
display: flex;
|
|
6287
|
-
align-items: center;
|
|
6288
|
-
height: 50px;
|
|
6289
|
-
width: 100%;
|
|
6290
|
-
max-width: 300px;
|
|
6291
|
-
background-color: ${({ theme: theme })=>theme.popupBackgroundSecondaryColor};
|
|
6292
|
-
border: 1px solid ${({ theme: theme })=>theme.popupBorderColor};
|
|
6293
|
-
border-radius: 15px;
|
|
6294
|
-
padding: 0 10px;
|
|
6295
|
-
box-sizing: border-box;
|
|
6296
|
-
`;
|
|
6297
|
-
const $b56218b5a57cb77c$export$5f759de1870a3e41 = (0, $3Sbms$styledcomponents).div`
|
|
6298
|
-
display: flex;
|
|
6299
|
-
align-items: center;
|
|
6300
|
-
width: 100%;
|
|
6301
|
-
gap: 5px;
|
|
6302
|
-
|
|
6303
|
-
svg {
|
|
6304
|
-
width: 20px;
|
|
6305
|
-
height: 20px;
|
|
6306
|
-
}
|
|
6307
|
-
`;
|
|
6308
|
-
const $b56218b5a57cb77c$export$c6b180e8ec79154e = (0, $3Sbms$styledcomponents).p`
|
|
6309
|
-
color: #242324;
|
|
6310
|
-
font-size: 15px;
|
|
6311
|
-
font-weight: 600;
|
|
6312
|
-
width: 100%;
|
|
6313
|
-
text-overflow: ellipsis;
|
|
6314
|
-
white-space: nowrap;
|
|
6315
|
-
overflow: hidden;
|
|
6316
|
-
line-height: 15px;
|
|
6317
|
-
`;
|
|
6318
|
-
const $b56218b5a57cb77c$export$d7f3ab4b3437ad97 = (0, $3Sbms$styledcomponents).button`
|
|
6319
|
-
position: absolute;
|
|
6320
|
-
right: 5px;
|
|
6321
|
-
display: flex;
|
|
6322
|
-
justify-content: center;
|
|
6323
|
-
align-items: center;
|
|
6324
|
-
background-color: ${({ theme: theme })=>theme.primaryColor};
|
|
6325
|
-
border: none;
|
|
6326
|
-
border-radius: 8px;
|
|
6327
|
-
height: 32px;
|
|
6328
|
-
color: #fff;
|
|
6329
|
-
font-weight: 600;
|
|
6330
|
-
font-size: 16px;
|
|
6331
|
-
padding: 8px 12px;
|
|
6332
|
-
line-height: 18px;
|
|
6333
|
-
`;
|
|
6334
|
-
const $b56218b5a57cb77c$export$c22678f0e7b404e0 = (0, $3Sbms$styledcomponents).p`
|
|
6335
|
-
font-size: 12px;
|
|
6336
|
-
font-weight: 400;
|
|
6337
|
-
max-width: 300px;
|
|
6338
|
-
text-align: center;
|
|
6339
|
-
`;
|
|
6340
|
-
|
|
6341
|
-
|
|
6342
|
-
|
|
6343
|
-
|
|
6344
6247
|
|
|
6345
6248
|
|
|
6346
|
-
const $1ec1d06e0a21fdaa$var$Link = ({ color: color })=>{
|
|
6347
|
-
return /*#__PURE__*/ (0, $3Sbms$jsx)("svg", {
|
|
6348
|
-
width: "24",
|
|
6349
|
-
height: "24",
|
|
6350
|
-
viewBox: "0 0 24 24",
|
|
6351
|
-
fill: "none",
|
|
6352
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
6353
|
-
children: /*#__PURE__*/ (0, $3Sbms$jsx)("path", {
|
|
6354
|
-
d: "m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1.004 1.004 0 0 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1.004 1.004 0 1 0-1.42-1.42Zm8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1.004 1.004 0 0 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.471 2.471 0 0 1 0 3.5l-3.88 3.88a1.002 1.002 0 0 0 .325 1.639.999.999 0 0 0 1.095-.219l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.92-4.92a1.004 1.004 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z",
|
|
6355
|
-
fill: color || "#fff"
|
|
6356
|
-
})
|
|
6357
|
-
});
|
|
6358
|
-
};
|
|
6359
|
-
var $1ec1d06e0a21fdaa$export$2e2bcd8739ae039 = $1ec1d06e0a21fdaa$var$Link;
|
|
6360
6249
|
|
|
6361
6250
|
|
|
6362
6251
|
|
|
@@ -6409,67 +6298,6 @@ const $93a0377c243d965e$export$c7df1b15b59b1df2 = /*#__PURE__*/ (0, $3Sbms$jsxs)
|
|
|
6409
6298
|
});
|
|
6410
6299
|
|
|
6411
6300
|
|
|
6412
|
-
|
|
6413
|
-
|
|
6414
|
-
const $f0b0b18fe6c6ae77$var$InvitationTile = ({ show: show , orientation: orientation , width: width , height: height })=>{
|
|
6415
|
-
const { t: t } = (0, $3Sbms$useTranslation)();
|
|
6416
|
-
const { options: options } = (0, $3Sbms$useContext)((0, $5f30d8bf4f04621e$export$2e2bcd8739ae039));
|
|
6417
|
-
const onCopyCallLinkClick = async ()=>{
|
|
6418
|
-
try {
|
|
6419
|
-
await (0, $57162bcada7d6f66$export$2e2bcd8739ae039)(options.sharedURL || window.location.href);
|
|
6420
|
-
(0, $a5146f9062d7bf28$export$3a57e165650c636f)(t("copyLink.copied"), {
|
|
6421
|
-
duration: 2000
|
|
6422
|
-
});
|
|
6423
|
-
} catch (copyError) {
|
|
6424
|
-
console.warn(copyError);
|
|
6425
|
-
(0, $a5146f9062d7bf28$export$3a57e165650c636f)(t("copyLink.error"), {
|
|
6426
|
-
icon: (0, $93a0377c243d965e$export$edf27be85e5f6da0)
|
|
6427
|
-
});
|
|
6428
|
-
}
|
|
6429
|
-
};
|
|
6430
|
-
return /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $b56218b5a57cb77c$export$dd2ac23a70f320dd), {
|
|
6431
|
-
show: show,
|
|
6432
|
-
width: width,
|
|
6433
|
-
height: height,
|
|
6434
|
-
orientation: orientation,
|
|
6435
|
-
children: [
|
|
6436
|
-
/*#__PURE__*/ (0, $3Sbms$jsx)((0, $b56218b5a57cb77c$export$2dabfbe763cc7a4), {
|
|
6437
|
-
children: t("invite.title")
|
|
6438
|
-
}),
|
|
6439
|
-
/*#__PURE__*/ (0, $3Sbms$jsxs)((0, $b56218b5a57cb77c$export$6ed6e36e1b456f96), {
|
|
6440
|
-
children: [
|
|
6441
|
-
/*#__PURE__*/ (0, $3Sbms$jsxs)((0, $b56218b5a57cb77c$export$5f759de1870a3e41), {
|
|
6442
|
-
children: [
|
|
6443
|
-
/*#__PURE__*/ (0, $3Sbms$jsx)((0, $1ec1d06e0a21fdaa$export$2e2bcd8739ae039), {
|
|
6444
|
-
color: "black"
|
|
6445
|
-
}),
|
|
6446
|
-
/*#__PURE__*/ (0, $3Sbms$jsx)((0, $b56218b5a57cb77c$export$c6b180e8ec79154e), {
|
|
6447
|
-
children: options.sharedURL || window.location.href
|
|
6448
|
-
})
|
|
6449
|
-
]
|
|
6450
|
-
}),
|
|
6451
|
-
/*#__PURE__*/ (0, $3Sbms$jsx)((0, $b56218b5a57cb77c$export$d7f3ab4b3437ad97), {
|
|
6452
|
-
onClick: onCopyCallLinkClick,
|
|
6453
|
-
children: t("invite.copy")
|
|
6454
|
-
})
|
|
6455
|
-
]
|
|
6456
|
-
}),
|
|
6457
|
-
/*#__PURE__*/ (0, $3Sbms$jsx)((0, $b56218b5a57cb77c$export$c22678f0e7b404e0), {
|
|
6458
|
-
children: t("invite.description")
|
|
6459
|
-
})
|
|
6460
|
-
]
|
|
6461
|
-
});
|
|
6462
|
-
};
|
|
6463
|
-
var $f0b0b18fe6c6ae77$export$2e2bcd8739ae039 = $f0b0b18fe6c6ae77$var$InvitationTile;
|
|
6464
|
-
|
|
6465
|
-
|
|
6466
|
-
|
|
6467
|
-
|
|
6468
|
-
|
|
6469
|
-
|
|
6470
|
-
|
|
6471
|
-
|
|
6472
|
-
|
|
6473
6301
|
const $b8963bf62cf5b984$var$Container = (0, $3Sbms$styledcomponents).div`
|
|
6474
6302
|
background-color: rgba(45, 45, 45, 0.75);
|
|
6475
6303
|
display: flex;
|
|
@@ -6536,7 +6364,6 @@ const $cdab47bb8796991e$var$Video = ()=>{
|
|
|
6536
6364
|
});
|
|
6537
6365
|
const { streams: streams , highlightedTile: highlightedTile , dispatch: dispatch } = (0, $cce9fd41d8a55a18$export$b5633a7cfbe42d9f)();
|
|
6538
6366
|
const [containerWidth, containerHeight] = (0, $af23c74942bdcae7$export$2b86bedf890eab8)(remoteTilesContainerRef.current);
|
|
6539
|
-
const showInvitation = streams.length < 1 && !highlightedTile && containerWidth > 0;
|
|
6540
6367
|
(0, $3Sbms$useEffect)(()=>{
|
|
6541
6368
|
if (options.GDPRDisclaimer) (0, $b8963bf62cf5b984$export$2e2bcd8739ae039)({
|
|
6542
6369
|
message: "Para mejorar la calidad de nuestro servicio, esta llamada ser\xe1 grabada",
|
|
@@ -6550,7 +6377,6 @@ const $cdab47bb8796991e$var$Video = ()=>{
|
|
|
6550
6377
|
if (remoteTilesContainerRef?.current) {
|
|
6551
6378
|
const ratio = 1;
|
|
6552
6379
|
let numberOfTiles = remoteTilesContainerRef.current.childElementCount;
|
|
6553
|
-
if (!showInvitation) numberOfTiles -= 1;
|
|
6554
6380
|
const videoWidth = (0, $b8e10de7c6dba8c4$export$4d43009c33055644)({
|
|
6555
6381
|
availableWidth: containerWidth - 16 * (numberOfTiles - 1),
|
|
6556
6382
|
availableHeight: containerHeight - 16 * (numberOfTiles - 1),
|
|
@@ -6568,16 +6394,16 @@ const $cdab47bb8796991e$var$Video = ()=>{
|
|
|
6568
6394
|
containerWidth,
|
|
6569
6395
|
containerHeight,
|
|
6570
6396
|
streams.length,
|
|
6571
|
-
highlightedTile
|
|
6572
|
-
showInvitation,
|
|
6397
|
+
highlightedTile
|
|
6573
6398
|
]);
|
|
6574
6399
|
(0, $3Sbms$useEffect)(()=>{
|
|
6575
6400
|
if (userInteractionTriggered) {
|
|
6576
6401
|
if (options.controls?.microphone?.enabled) (0, $c9e496369b59be7a$export$2f377c2162fd02b2).enableMicrophone();
|
|
6577
|
-
if (options.controls?.camera?.enabled) (0, $c9e496369b59be7a$export$2f377c2162fd02b2).enableVideo();
|
|
6402
|
+
if (options.controls?.camera?.enabled && !options.audioTiles) (0, $c9e496369b59be7a$export$2f377c2162fd02b2).enableVideo();
|
|
6578
6403
|
}
|
|
6579
6404
|
}, [
|
|
6580
6405
|
options.controls,
|
|
6406
|
+
options.audioTiles,
|
|
6581
6407
|
userInteractionTriggered
|
|
6582
6408
|
]);
|
|
6583
6409
|
(0, $3Sbms$useEffect)(()=>{
|
|
@@ -6722,12 +6548,6 @@ const $cdab47bb8796991e$var$Video = ()=>{
|
|
|
6722
6548
|
width: tileSize.width,
|
|
6723
6549
|
height: tileSize.height
|
|
6724
6550
|
}, stream.id);
|
|
6725
|
-
}),
|
|
6726
|
-
/*#__PURE__*/ (0, $3Sbms$jsx)((0, $f0b0b18fe6c6ae77$export$2e2bcd8739ae039), {
|
|
6727
|
-
show: showInvitation,
|
|
6728
|
-
width: `${tileSize.width}px`,
|
|
6729
|
-
height: `${tileSize.height}px`,
|
|
6730
|
-
orientation: orientation
|
|
6731
6551
|
})
|
|
6732
6552
|
]
|
|
6733
6553
|
})
|
|
@@ -6859,6 +6679,22 @@ var $a2d206a438475087$export$2e2bcd8739ae039 = $a2d206a438475087$var$YoutubeIcon
|
|
|
6859
6679
|
|
|
6860
6680
|
|
|
6861
6681
|
|
|
6682
|
+
const $1ec1d06e0a21fdaa$var$Link = ({ color: color })=>{
|
|
6683
|
+
return /*#__PURE__*/ (0, $3Sbms$jsx)("svg", {
|
|
6684
|
+
width: "24",
|
|
6685
|
+
height: "24",
|
|
6686
|
+
viewBox: "0 0 24 24",
|
|
6687
|
+
fill: "none",
|
|
6688
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6689
|
+
children: /*#__PURE__*/ (0, $3Sbms$jsx)("path", {
|
|
6690
|
+
d: "m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1.004 1.004 0 0 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1.004 1.004 0 1 0-1.42-1.42Zm8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1.004 1.004 0 0 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.471 2.471 0 0 1 0 3.5l-3.88 3.88a1.002 1.002 0 0 0 .325 1.639.999.999 0 0 0 1.095-.219l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.92-4.92a1.004 1.004 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z",
|
|
6691
|
+
fill: color || "#fff"
|
|
6692
|
+
})
|
|
6693
|
+
});
|
|
6694
|
+
};
|
|
6695
|
+
var $1ec1d06e0a21fdaa$export$2e2bcd8739ae039 = $1ec1d06e0a21fdaa$var$Link;
|
|
6696
|
+
|
|
6697
|
+
|
|
6862
6698
|
|
|
6863
6699
|
|
|
6864
6700
|
|
|
@@ -8700,6 +8536,20 @@ const $554f3984e3212196$export$5e3f251c730829 = (0, $3Sbms$styledcomponents).div
|
|
|
8700
8536
|
|
|
8701
8537
|
|
|
8702
8538
|
|
|
8539
|
+
|
|
8540
|
+
function $5004d610b358fe2c$export$bc98e171e8c82a3d(title) {
|
|
8541
|
+
(0, $3Sbms$useEffect)(()=>{
|
|
8542
|
+
const prevTitle = document.title;
|
|
8543
|
+
if (title) document.title = title;
|
|
8544
|
+
return ()=>{
|
|
8545
|
+
document.title = prevTitle;
|
|
8546
|
+
};
|
|
8547
|
+
}, [
|
|
8548
|
+
title
|
|
8549
|
+
]);
|
|
8550
|
+
}
|
|
8551
|
+
|
|
8552
|
+
|
|
8703
8553
|
const $98933bbc579a3e66$export$a1eac7fdbc2db4af = "linkshare_sent";
|
|
8704
8554
|
const $98933bbc579a3e66$var$sendLinkNotification = (data, t)=>{
|
|
8705
8555
|
let notificationStatusText = new URL(data.url).hostname;
|
|
@@ -8723,7 +8573,7 @@ const $98933bbc579a3e66$var$sendLinkNotification = (data, t)=>{
|
|
|
8723
8573
|
}
|
|
8724
8574
|
},
|
|
8725
8575
|
ellipsis: true,
|
|
8726
|
-
duration:
|
|
8576
|
+
duration: 15000
|
|
8727
8577
|
});
|
|
8728
8578
|
(0, $f81bfa56534026c2$export$e9785ae652b3a722)({
|
|
8729
8579
|
title: data.title,
|
|
@@ -8765,22 +8615,45 @@ const $98933bbc579a3e66$var$LinksharePopup = ()=>{
|
|
|
8765
8615
|
const themeContext = (0, $3Sbms$useContext)((0, $3Sbms$ThemeContext));
|
|
8766
8616
|
const linksharePopupRef = (0, $3Sbms$useRef)(null);
|
|
8767
8617
|
const linkshareInputRef = (0, $3Sbms$useRef)(null);
|
|
8618
|
+
const [pendingShareLink, setPendingShareLink] = (0, $3Sbms$useState)([]);
|
|
8619
|
+
const [title, setTitle] = (0, $3Sbms$useState)();
|
|
8768
8620
|
const [linkshareInputValue, setLinkshareInputValue] = (0, $3Sbms$useState)("");
|
|
8769
8621
|
const [errorMessage, setErrorMessage] = (0, $3Sbms$useState)(null);
|
|
8770
8622
|
const [status, setStatus] = (0, $3Sbms$useState)("waiting");
|
|
8771
8623
|
const { isLinksharePopupVisible: isLinksharePopupVisible , setIsLinksharePopupVisible: setIsLinksharePopupVisible , orientation: orientation , options: options } = (0, $3Sbms$useContext)((0, $5f30d8bf4f04621e$export$2e2bcd8739ae039));
|
|
8772
8624
|
const { streams: streams } = (0, $cce9fd41d8a55a18$export$b5633a7cfbe42d9f)();
|
|
8625
|
+
(0, $5004d610b358fe2c$export$bc98e171e8c82a3d)(title);
|
|
8773
8626
|
const desktop = orientation === "landscape";
|
|
8627
|
+
const onVisibilitychange = (0, $3Sbms$useCallback)(()=>{
|
|
8628
|
+
if (!document.hidden) {
|
|
8629
|
+
pendingShareLink.forEach((data)=>{
|
|
8630
|
+
$98933bbc579a3e66$var$sendLinkNotification(data, t);
|
|
8631
|
+
});
|
|
8632
|
+
setPendingShareLink([]);
|
|
8633
|
+
setTitle(undefined);
|
|
8634
|
+
}
|
|
8635
|
+
}, [
|
|
8636
|
+
pendingShareLink,
|
|
8637
|
+
t
|
|
8638
|
+
]);
|
|
8774
8639
|
const onCustomMessage = (0, $3Sbms$useCallback)((event)=>{
|
|
8775
8640
|
const { type: type , data: data } = event.detail.event;
|
|
8776
|
-
|
|
8777
|
-
|
|
8778
|
-
|
|
8779
|
-
|
|
8780
|
-
|
|
8641
|
+
const sender = streams.find((stream)=>stream.id === event.detail?.peerId);
|
|
8642
|
+
if (type === $98933bbc579a3e66$export$a1eac7fdbc2db4af) {
|
|
8643
|
+
if (!document.hidden) $98933bbc579a3e66$var$sendLinkNotification(data, t);
|
|
8644
|
+
else {
|
|
8645
|
+
const name = sender?.profile.name?.toLowerCase() !== "user" ? sender?.profile.name : undefined;
|
|
8646
|
+
setPendingShareLink([
|
|
8647
|
+
...pendingShareLink,
|
|
8648
|
+
data
|
|
8649
|
+
]);
|
|
8650
|
+
setTitle(`${name || "Someone"} shared a link`);
|
|
8651
|
+
}
|
|
8652
|
+
} else if (type === "paypal_invoice") $98933bbc579a3e66$var$sendPaypalInvoiceNotification(sender?.profile?.name, data.url, t);
|
|
8781
8653
|
}, [
|
|
8782
8654
|
streams,
|
|
8783
|
-
t
|
|
8655
|
+
t,
|
|
8656
|
+
pendingShareLink
|
|
8784
8657
|
]);
|
|
8785
8658
|
const onShareClick = async (event)=>{
|
|
8786
8659
|
event.preventDefault();
|
|
@@ -8835,12 +8708,15 @@ const $98933bbc579a3e66$var$LinksharePopup = ()=>{
|
|
|
8835
8708
|
};
|
|
8836
8709
|
const onCloseClick = ()=>setIsLinksharePopupVisible(false);
|
|
8837
8710
|
(0, $3Sbms$useEffect)(()=>{
|
|
8711
|
+
window.addEventListener("visibilitychange", onVisibilitychange);
|
|
8838
8712
|
(0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("customMessage", onCustomMessage);
|
|
8839
8713
|
return ()=>{
|
|
8714
|
+
window.removeEventListener("visibilitychange", onVisibilitychange);
|
|
8840
8715
|
(0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("customMessage", onCustomMessage);
|
|
8841
8716
|
};
|
|
8842
8717
|
}, [
|
|
8843
|
-
onCustomMessage
|
|
8718
|
+
onCustomMessage,
|
|
8719
|
+
onVisibilitychange
|
|
8844
8720
|
]);
|
|
8845
8721
|
const onPopupTransitionEnd = ()=>{
|
|
8846
8722
|
if (isLinksharePopupVisible) linkshareInputRef.current?.focus();
|
|
@@ -9095,38 +8971,38 @@ const $d493afe60dcea711$var$backgroundOptions = [
|
|
|
9095
8971
|
{
|
|
9096
8972
|
title: "Blue",
|
|
9097
8973
|
id: "background-blue",
|
|
9098
|
-
iconUrl: `${"https://stream-assets.snapcall.io
|
|
9099
|
-
value: `${"https://stream-assets.snapcall.io
|
|
8974
|
+
iconUrl: `${"https://stream-assets.snapcall.io"}/backgrounds/blue_background_icon.png`,
|
|
8975
|
+
value: `${"https://stream-assets.snapcall.io"}/backgrounds/blue_background.png`
|
|
9100
8976
|
},
|
|
9101
8977
|
{
|
|
9102
8978
|
title: "Cold",
|
|
9103
8979
|
id: "background-cold",
|
|
9104
|
-
iconUrl: `${"https://stream-assets.snapcall.io
|
|
9105
|
-
value: `${"https://stream-assets.snapcall.io
|
|
8980
|
+
iconUrl: `${"https://stream-assets.snapcall.io"}/backgrounds/cold_background_icon.png`,
|
|
8981
|
+
value: `${"https://stream-assets.snapcall.io"}/backgrounds/cold_background.png`
|
|
9106
8982
|
},
|
|
9107
8983
|
{
|
|
9108
8984
|
title: "Bricks",
|
|
9109
8985
|
id: "background-bricks",
|
|
9110
|
-
iconUrl: `${"https://stream-assets.snapcall.io
|
|
9111
|
-
value: `${"https://stream-assets.snapcall.io
|
|
8986
|
+
iconUrl: `${"https://stream-assets.snapcall.io"}/backgrounds/bricks_background_icon.png`,
|
|
8987
|
+
value: `${"https://stream-assets.snapcall.io"}/backgrounds/bricks_background.png`
|
|
9112
8988
|
},
|
|
9113
8989
|
{
|
|
9114
8990
|
title: "White",
|
|
9115
8991
|
id: "background-white",
|
|
9116
|
-
iconUrl: `${"https://stream-assets.snapcall.io
|
|
9117
|
-
value: `${"https://stream-assets.snapcall.io
|
|
8992
|
+
iconUrl: `${"https://stream-assets.snapcall.io"}/backgrounds/white_background_icon.png`,
|
|
8993
|
+
value: `${"https://stream-assets.snapcall.io"}/backgrounds/white_background.png`
|
|
9118
8994
|
},
|
|
9119
8995
|
{
|
|
9120
8996
|
title: "Yellow",
|
|
9121
8997
|
id: "background-yellow",
|
|
9122
|
-
iconUrl: `${"https://stream-assets.snapcall.io
|
|
9123
|
-
value: `${"https://stream-assets.snapcall.io
|
|
8998
|
+
iconUrl: `${"https://stream-assets.snapcall.io"}/backgrounds/yellow_background_icon.png`,
|
|
8999
|
+
value: `${"https://stream-assets.snapcall.io"}/backgrounds/yellow_background.png`
|
|
9124
9000
|
},
|
|
9125
9001
|
{
|
|
9126
9002
|
title: "Warm",
|
|
9127
9003
|
id: "background-warm",
|
|
9128
|
-
iconUrl: `${"https://stream-assets.snapcall.io
|
|
9129
|
-
value: `${"https://stream-assets.snapcall.io
|
|
9004
|
+
iconUrl: `${"https://stream-assets.snapcall.io"}/backgrounds/warm_background_icon.png`,
|
|
9005
|
+
value: `${"https://stream-assets.snapcall.io"}/backgrounds/warm_background.png`
|
|
9130
9006
|
},
|
|
9131
9007
|
{
|
|
9132
9008
|
title: "None",
|
|
@@ -9356,10 +9232,12 @@ var $df41bfe6da05853a$export$2e2bcd8739ae039 = $df41bfe6da05853a$var$EndView;
|
|
|
9356
9232
|
|
|
9357
9233
|
|
|
9358
9234
|
|
|
9235
|
+
|
|
9359
9236
|
const $805d92fa41e6e1b0$var$connected = new Audio("https://cdn.snapcall.io/stream/connected.mp3");
|
|
9360
9237
|
const $805d92fa41e6e1b0$var$disconnected = new Audio("https://cdn.snapcall.io/stream/disconnected.mp3");
|
|
9361
9238
|
const $805d92fa41e6e1b0$var$userConnected = new Audio("https://cdn.snapcall.io/stream/user-connected.mp3");
|
|
9362
9239
|
const $805d92fa41e6e1b0$var$userDisconnected = new Audio("https://cdn.snapcall.io/stream/user-disconnected.mp3");
|
|
9240
|
+
const $805d92fa41e6e1b0$var$linkReceived = new Audio("https://cdn.snapcall.io/stream/link-received.mp3");
|
|
9363
9241
|
const $805d92fa41e6e1b0$var$Sounds = ()=>{
|
|
9364
9242
|
const { userInteractionTriggered: userInteractionTriggered } = (0, $3Sbms$useContext)((0, $5f30d8bf4f04621e$export$2e2bcd8739ae039));
|
|
9365
9243
|
const onEnterRoom = async ()=>{
|
|
@@ -9392,14 +9270,24 @@ const $805d92fa41e6e1b0$var$Sounds = ()=>{
|
|
|
9392
9270
|
console.warn("Couldn't play disconnected sound");
|
|
9393
9271
|
}
|
|
9394
9272
|
};
|
|
9273
|
+
const onCustomMessage = async (event)=>{
|
|
9274
|
+
const { type: type } = event.detail.event;
|
|
9275
|
+
if (type === (0, $98933bbc579a3e66$export$a1eac7fdbc2db4af)) try {
|
|
9276
|
+
await $805d92fa41e6e1b0$var$linkReceived.play();
|
|
9277
|
+
} catch (disconnectedPlayError) {
|
|
9278
|
+
console.warn("Couldn't play link-received sound");
|
|
9279
|
+
}
|
|
9280
|
+
};
|
|
9395
9281
|
(0, $3Sbms$useEffect)(()=>{
|
|
9396
9282
|
(0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("newPeer", onNewPeer);
|
|
9397
9283
|
(0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("peerClosed", onPeerClosed);
|
|
9398
9284
|
(0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("leaveRoom", onLeaveRoom);
|
|
9285
|
+
(0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("customMessage", onCustomMessage);
|
|
9399
9286
|
return ()=>{
|
|
9400
9287
|
(0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("newPeer", onNewPeer);
|
|
9401
9288
|
(0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("peerClosed", onPeerClosed);
|
|
9402
9289
|
(0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("leaveRoom", onLeaveRoom);
|
|
9290
|
+
(0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("customMessage", onCustomMessage);
|
|
9403
9291
|
};
|
|
9404
9292
|
}, []);
|
|
9405
9293
|
(0, $3Sbms$useEffect)(()=>{
|
|
@@ -10024,7 +9912,7 @@ const $15a01b611391c1e7$export$716eeec86fd18da7 = ()=>{
|
|
|
10024
9912
|
});
|
|
10025
9913
|
$15a01b611391c1e7$var$mediaResult = undefined;
|
|
10026
9914
|
};
|
|
10027
|
-
const $15a01b611391c1e7$export$494039379563c94d = async ()=>{
|
|
9915
|
+
const $15a01b611391c1e7$export$494039379563c94d = async (options)=>{
|
|
10028
9916
|
try {
|
|
10029
9917
|
const audioObject = new Audio($15a01b611391c1e7$var$audioURL);
|
|
10030
9918
|
await audioObject.play();
|
|
@@ -10032,8 +9920,9 @@ const $15a01b611391c1e7$export$494039379563c94d = async ()=>{
|
|
|
10032
9920
|
console.warn("User interaction is required, asking audio GUM");
|
|
10033
9921
|
$15a01b611391c1e7$var$mediaResult = await navigator.mediaDevices.getUserMedia({
|
|
10034
9922
|
audio: true,
|
|
10035
|
-
video:
|
|
9923
|
+
video: !options.audioTiles
|
|
10036
9924
|
});
|
|
9925
|
+
$15a01b611391c1e7$var$mediaResult.getVideoTracks().forEach((track)=>track.stop());
|
|
10037
9926
|
}
|
|
10038
9927
|
};
|
|
10039
9928
|
|
|
@@ -10138,17 +10027,6 @@ const $26ed036cbc17809a$var$StreamUI = ({ options: options })=>{
|
|
|
10138
10027
|
const [isBlockedDevicesPopupOpen, setBlockedDevicesPopupOpen] = (0, $3Sbms$useState)(false);
|
|
10139
10028
|
const orientation = (containerWidth || window.screen.width) > (containerHeight || window.screen.height) ? "landscape" : "portrait";
|
|
10140
10029
|
const styledTheme = theme === "dark" ? (0, $52580db2e49cdd90$export$3e936a8db52a10a0) : (0, $52580db2e49cdd90$export$f30cb9bc4f736419);
|
|
10141
|
-
const onEnterRoom = async (event)=>{
|
|
10142
|
-
const peerId = event.detail.peerId;
|
|
10143
|
-
setSelfPeerId(peerId);
|
|
10144
|
-
try {
|
|
10145
|
-
await (0, $15a01b611391c1e7$export$494039379563c94d)();
|
|
10146
|
-
setUserInteractionTriggered(true);
|
|
10147
|
-
} catch (userInteractionError) {
|
|
10148
|
-
setBlockedDevicesPopupOpen(true);
|
|
10149
|
-
console.error("User interaction trigger failed", userInteractionError);
|
|
10150
|
-
}
|
|
10151
|
-
};
|
|
10152
10030
|
const onWebcamUpdate = (event)=>{
|
|
10153
10031
|
if (event.type === "localVideoAvailable") setStreaming(true);
|
|
10154
10032
|
else setStreaming(false);
|
|
@@ -10241,7 +10119,6 @@ const $26ed036cbc17809a$var$StreamUI = ({ options: options })=>{
|
|
|
10241
10119
|
language
|
|
10242
10120
|
]);
|
|
10243
10121
|
(0, $3Sbms$useEffect)(()=>{
|
|
10244
|
-
(0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("enterRoom", onEnterRoom);
|
|
10245
10122
|
(0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("localVideoAvailable", onWebcamUpdate);
|
|
10246
10123
|
(0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("localVideoUnavailable", onWebcamUpdate);
|
|
10247
10124
|
(0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("screenshareEnabled", onScreenshareUpdate);
|
|
@@ -10257,7 +10134,6 @@ const $26ed036cbc17809a$var$StreamUI = ({ options: options })=>{
|
|
|
10257
10134
|
(0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("agentIdentity", onAgentIdentity);
|
|
10258
10135
|
(0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("criticalError", onCriticalError);
|
|
10259
10136
|
return ()=>{
|
|
10260
|
-
(0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("enterRoom", onEnterRoom);
|
|
10261
10137
|
(0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("localVideoAvailable", onWebcamUpdate);
|
|
10262
10138
|
(0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("localVideoUnavailable", onWebcamUpdate);
|
|
10263
10139
|
(0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("screenshareEnabled", onScreenshareUpdate);
|
|
@@ -10274,6 +10150,25 @@ const $26ed036cbc17809a$var$StreamUI = ({ options: options })=>{
|
|
|
10274
10150
|
(0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("criticalError", onCriticalError);
|
|
10275
10151
|
};
|
|
10276
10152
|
}, []);
|
|
10153
|
+
(0, $3Sbms$useEffect)(()=>{
|
|
10154
|
+
const onEnterRoom = async (event)=>{
|
|
10155
|
+
const peerId = event.detail.peerId;
|
|
10156
|
+
setSelfPeerId(peerId);
|
|
10157
|
+
try {
|
|
10158
|
+
await (0, $15a01b611391c1e7$export$494039379563c94d)(options);
|
|
10159
|
+
setUserInteractionTriggered(true);
|
|
10160
|
+
} catch (userInteractionError) {
|
|
10161
|
+
setBlockedDevicesPopupOpen(true);
|
|
10162
|
+
console.error("User interaction trigger failed", userInteractionError);
|
|
10163
|
+
}
|
|
10164
|
+
};
|
|
10165
|
+
(0, $c9e496369b59be7a$export$2f377c2162fd02b2).addEventListener("enterRoom", onEnterRoom);
|
|
10166
|
+
return ()=>{
|
|
10167
|
+
(0, $c9e496369b59be7a$export$2f377c2162fd02b2).removeEventListener("enterRoom", onEnterRoom);
|
|
10168
|
+
};
|
|
10169
|
+
}, [
|
|
10170
|
+
options
|
|
10171
|
+
]);
|
|
10277
10172
|
return /*#__PURE__*/ (0, $3Sbms$jsx)((0, $5f30d8bf4f04621e$export$2e2bcd8739ae039).Provider, {
|
|
10278
10173
|
value: {
|
|
10279
10174
|
selfPeerId: selfPeerId,
|
|
@@ -10661,7 +10556,7 @@ const $f8d57e3d223f5089$var$GreetingView = ({ onGreetingDone: onGreetingDone })
|
|
|
10661
10556
|
}, []);
|
|
10662
10557
|
if (joining === true) return /*#__PURE__*/ (0, $3Sbms$jsx)((0, $35c6a4b506b7dc62$export$d4a1a815e49dfefd), {
|
|
10663
10558
|
children: /*#__PURE__*/ (0, $3Sbms$jsx)("img", {
|
|
10664
|
-
src: `${"https://stream-assets.snapcall.io
|
|
10559
|
+
src: `${"https://stream-assets.snapcall.io"}/animations/snapcall-logo-animation.gif`,
|
|
10665
10560
|
alt: "Snapcall logo animation",
|
|
10666
10561
|
height: 40
|
|
10667
10562
|
})
|