@100mslive/roomkit-react 0.3.14-alpha.10 → 0.3.14-alpha.12
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{HLSView-PL2BEA32.js → HLSView-6X6A7QVC.js} +2 -2
- package/dist/{HLSView-TAAU7UCF.css → HLSView-J7FHXBEW.css} +3 -3
- package/dist/{HLSView-TAAU7UCF.css.map → HLSView-J7FHXBEW.css.map} +1 -1
- package/dist/{chunk-EKH2S2VL.js → chunk-2VGMEGOM.js} +643 -695
- package/dist/{chunk-EKH2S2VL.js.map → chunk-2VGMEGOM.js.map} +4 -4
- package/dist/index.cjs.css +2 -2
- package/dist/index.cjs.css.map +1 -1
- package/dist/index.cjs.js +2404 -2450
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.css +2 -2
- package/dist/index.css.map +1 -1
- package/dist/index.js +1 -1
- package/dist/meta.cjs.json +21 -65
- package/dist/meta.esbuild.json +33 -77
- package/package.json +8 -7
- package/src/Prebuilt/components/Chat/ChatBody.tsx +23 -8
- package/src/Prebuilt/components/Header/AdditionalRoomState.jsx +4 -66
- package/dist/Prebuilt/components/HMSVideo/PlayButton.d.ts +0 -6
- package/dist/Prebuilt/components/Polls/common/VoterList.d.ts +0 -4
- package/src/Prebuilt/common/roles.js +0 -4
- package/src/Prebuilt/components/AppData/useAppConfig.js +0 -7
- package/src/Prebuilt/components/HMSVideo/PlayButton.tsx +0 -27
- package/src/Prebuilt/components/Header/AmbientMusic.jsx +0 -88
- package/src/Prebuilt/components/Image.jsx +0 -7
- package/src/Prebuilt/components/MetaActions.jsx +0 -37
- package/src/Prebuilt/components/Playlist/Playlist.jsx +0 -124
- package/src/Prebuilt/components/Playlist/PlaylistControls.jsx +0 -172
- package/src/Prebuilt/components/Playlist/PlaylistItem.jsx +0 -51
- package/src/Prebuilt/components/Playlist/VideoPlayer.jsx +0 -95
- package/src/Prebuilt/components/Polls/CreatePollQuiz/Timer.jsx +0 -71
- package/src/Prebuilt/components/Polls/common/VoterList.tsx +0 -22
- package/src/Prebuilt/components/ScreenshareHintModal.jsx +0 -37
- /package/dist/{HLSView-PL2BEA32.js.map → HLSView-6X6A7QVC.js.map} +0 -0
package/dist/meta.esbuild.json
CHANGED
@@ -4951,7 +4951,7 @@
|
|
4951
4951
|
"format": "cjs"
|
4952
4952
|
},
|
4953
4953
|
"../hms-video-store/dist/index.js": {
|
4954
|
-
"bytes":
|
4954
|
+
"bytes": 356285,
|
4955
4955
|
"imports": [
|
4956
4956
|
{
|
4957
4957
|
"path": "../../node_modules/reselect/es/index.js",
|
@@ -5091,32 +5091,6 @@
|
|
5091
5091
|
],
|
5092
5092
|
"format": "esm"
|
5093
5093
|
},
|
5094
|
-
"src/Prebuilt/components/hooks/usePlaylistMusic.js": {
|
5095
|
-
"bytes": 913,
|
5096
|
-
"imports": [
|
5097
|
-
{
|
5098
|
-
"path": "react",
|
5099
|
-
"kind": "import-statement",
|
5100
|
-
"external": true
|
5101
|
-
},
|
5102
|
-
{
|
5103
|
-
"path": "@100mslive/react-sdk",
|
5104
|
-
"kind": "import-statement",
|
5105
|
-
"external": true
|
5106
|
-
},
|
5107
|
-
{
|
5108
|
-
"path": "<define:process.env>",
|
5109
|
-
"kind": "import-statement",
|
5110
|
-
"external": true
|
5111
|
-
},
|
5112
|
-
{
|
5113
|
-
"path": "<runtime>",
|
5114
|
-
"kind": "import-statement",
|
5115
|
-
"external": true
|
5116
|
-
}
|
5117
|
-
],
|
5118
|
-
"format": "esm"
|
5119
|
-
},
|
5120
5094
|
"src/Prebuilt/components/hooks/useScreenshareAudio.js": {
|
5121
5095
|
"bytes": 813,
|
5122
5096
|
"imports": [
|
@@ -5139,7 +5113,7 @@
|
|
5139
5113
|
"format": "esm"
|
5140
5114
|
},
|
5141
5115
|
"src/Prebuilt/components/Header/AdditionalRoomState.jsx": {
|
5142
|
-
"bytes":
|
5116
|
+
"bytes": 4443,
|
5143
5117
|
"imports": [
|
5144
5118
|
{
|
5145
5119
|
"path": "react",
|
@@ -5166,11 +5140,6 @@
|
|
5166
5140
|
"kind": "import-statement",
|
5167
5141
|
"original": "../AppData/useUISettings"
|
5168
5142
|
},
|
5169
|
-
{
|
5170
|
-
"path": "src/Prebuilt/components/hooks/usePlaylistMusic.js",
|
5171
|
-
"kind": "import-statement",
|
5172
|
-
"original": "../hooks/usePlaylistMusic"
|
5173
|
-
},
|
5174
5143
|
{
|
5175
5144
|
"path": "src/Prebuilt/components/hooks/useScreenshareAudio.js",
|
5176
5145
|
"kind": "import-statement",
|
@@ -8268,7 +8237,7 @@
|
|
8268
8237
|
"format": "esm"
|
8269
8238
|
},
|
8270
8239
|
"src/Prebuilt/components/Chat/ChatBody.tsx": {
|
8271
|
-
"bytes":
|
8240
|
+
"bytes": 15590,
|
8272
8241
|
"imports": [
|
8273
8242
|
{
|
8274
8243
|
"path": "react",
|
@@ -10974,7 +10943,7 @@
|
|
10974
10943
|
],
|
10975
10944
|
"format": "esm"
|
10976
10945
|
},
|
10977
|
-
"
|
10946
|
+
"../../../../../../var/folders/_k/lv0n3xdx0n9c5c6nzjvb629r0000gn/T/tmp-5599-rVgyIDHVeqLY/1906a2e4ded3/tldraw.css": {
|
10978
10947
|
"bytes": 80111,
|
10979
10948
|
"imports": [
|
10980
10949
|
{
|
@@ -11024,7 +10993,7 @@
|
|
11024
10993
|
}
|
11025
10994
|
]
|
11026
10995
|
},
|
11027
|
-
"
|
10996
|
+
"../../../../../../var/folders/_k/lv0n3xdx0n9c5c6nzjvb629r0000gn/T/tmp-5599-rVgyIDHVeqLY/1906a2e4dba1/index.css": {
|
11028
10997
|
"bytes": 597,
|
11029
10998
|
"imports": [
|
11030
10999
|
{
|
@@ -11033,7 +11002,7 @@
|
|
11033
11002
|
"external": true
|
11034
11003
|
},
|
11035
11004
|
{
|
11036
|
-
"path": "
|
11005
|
+
"path": "../../../../../../var/folders/_k/lv0n3xdx0n9c5c6nzjvb629r0000gn/T/tmp-5599-rVgyIDHVeqLY/1906a2e4ded3/tldraw.css",
|
11037
11006
|
"kind": "import-rule",
|
11038
11007
|
"original": "@tldraw/tldraw/tldraw.css"
|
11039
11008
|
}
|
@@ -11108,7 +11077,7 @@
|
|
11108
11077
|
"original": "../../common/constants"
|
11109
11078
|
},
|
11110
11079
|
{
|
11111
|
-
"path": "
|
11080
|
+
"path": "../../../../../../var/folders/_k/lv0n3xdx0n9c5c6nzjvb629r0000gn/T/tmp-5599-rVgyIDHVeqLY/1906a2e4dba1/index.css",
|
11112
11081
|
"kind": "import-statement",
|
11113
11082
|
"original": "@100mslive/hms-whiteboard/index.css"
|
11114
11083
|
},
|
@@ -14971,7 +14940,7 @@
|
|
14971
14940
|
"dist/index.js": {
|
14972
14941
|
"imports": [
|
14973
14942
|
{
|
14974
|
-
"path": "dist/chunk-
|
14943
|
+
"path": "dist/chunk-2VGMEGOM.js",
|
14975
14944
|
"kind": "import-statement"
|
14976
14945
|
}
|
14977
14946
|
],
|
@@ -15047,16 +15016,16 @@
|
|
15047
15016
|
"inputs": {},
|
15048
15017
|
"bytes": 1882
|
15049
15018
|
},
|
15050
|
-
"dist/HLSView-
|
15019
|
+
"dist/HLSView-6X6A7QVC.js.map": {
|
15051
15020
|
"imports": [],
|
15052
15021
|
"exports": [],
|
15053
15022
|
"inputs": {},
|
15054
15023
|
"bytes": 100275
|
15055
15024
|
},
|
15056
|
-
"dist/HLSView-
|
15025
|
+
"dist/HLSView-6X6A7QVC.js": {
|
15057
15026
|
"imports": [
|
15058
15027
|
{
|
15059
|
-
"path": "dist/chunk-
|
15028
|
+
"path": "dist/chunk-2VGMEGOM.js",
|
15060
15029
|
"kind": "import-statement"
|
15061
15030
|
},
|
15062
15031
|
{
|
@@ -15234,7 +15203,7 @@
|
|
15234
15203
|
"default"
|
15235
15204
|
],
|
15236
15205
|
"entryPoint": "src/Prebuilt/layouts/HLSView.jsx",
|
15237
|
-
"cssBundle": "dist/HLSView-
|
15206
|
+
"cssBundle": "dist/HLSView-J7FHXBEW.css",
|
15238
15207
|
"inputs": {
|
15239
15208
|
"src/Prebuilt/layouts/HLSView.jsx": {
|
15240
15209
|
"bytesInOutput": 27671
|
@@ -15293,13 +15262,13 @@
|
|
15293
15262
|
},
|
15294
15263
|
"bytes": 61702
|
15295
15264
|
},
|
15296
|
-
"dist/chunk-
|
15265
|
+
"dist/chunk-2VGMEGOM.js.map": {
|
15297
15266
|
"imports": [],
|
15298
15267
|
"exports": [],
|
15299
15268
|
"inputs": {},
|
15300
|
-
"bytes":
|
15269
|
+
"bytes": 3893581
|
15301
15270
|
},
|
15302
|
-
"dist/chunk-
|
15271
|
+
"dist/chunk-2VGMEGOM.js": {
|
15303
15272
|
"imports": [
|
15304
15273
|
{
|
15305
15274
|
"path": "react",
|
@@ -16376,16 +16345,6 @@
|
|
16376
16345
|
"kind": "import-statement",
|
16377
16346
|
"external": true
|
16378
16347
|
},
|
16379
|
-
{
|
16380
|
-
"path": "@100mslive/react-sdk",
|
16381
|
-
"kind": "import-statement",
|
16382
|
-
"external": true
|
16383
|
-
},
|
16384
|
-
{
|
16385
|
-
"path": "react",
|
16386
|
-
"kind": "import-statement",
|
16387
|
-
"external": true
|
16388
|
-
},
|
16389
16348
|
{
|
16390
16349
|
"path": "react-use",
|
16391
16350
|
"kind": "import-statement",
|
@@ -17782,7 +17741,7 @@
|
|
17782
17741
|
"external": true
|
17783
17742
|
},
|
17784
17743
|
{
|
17785
|
-
"path": "dist/HLSView-
|
17744
|
+
"path": "dist/HLSView-6X6A7QVC.js",
|
17786
17745
|
"kind": "dynamic-import"
|
17787
17746
|
},
|
17788
17747
|
{
|
@@ -18366,7 +18325,7 @@
|
|
18366
18325
|
],
|
18367
18326
|
"inputs": {
|
18368
18327
|
"<define:process.env>": {
|
18369
|
-
"bytesInOutput":
|
18328
|
+
"bytesInOutput": 16923
|
18370
18329
|
},
|
18371
18330
|
"../../node_modules/lodash/lodash.js": {
|
18372
18331
|
"bytesInOutput": 224414
|
@@ -18849,7 +18808,7 @@
|
|
18849
18808
|
"bytesInOutput": 9484
|
18850
18809
|
},
|
18851
18810
|
"../hms-video-store/dist/index.js": {
|
18852
|
-
"bytesInOutput":
|
18811
|
+
"bytesInOutput": 459136
|
18853
18812
|
},
|
18854
18813
|
"../../node_modules/reselect/es/index.js": {
|
18855
18814
|
"bytesInOutput": 2550
|
@@ -18897,10 +18856,7 @@
|
|
18897
18856
|
"bytesInOutput": 1395
|
18898
18857
|
},
|
18899
18858
|
"src/Prebuilt/components/Header/AdditionalRoomState.jsx": {
|
18900
|
-
"bytesInOutput":
|
18901
|
-
},
|
18902
|
-
"src/Prebuilt/components/hooks/usePlaylistMusic.js": {
|
18903
|
-
"bytesInOutput": 1078
|
18859
|
+
"bytesInOutput": 4461
|
18904
18860
|
},
|
18905
18861
|
"src/Prebuilt/components/hooks/useScreenshareAudio.js": {
|
18906
18862
|
"bytesInOutput": 911
|
@@ -19092,7 +19048,7 @@
|
|
19092
19048
|
"bytesInOutput": 5652
|
19093
19049
|
},
|
19094
19050
|
"src/Prebuilt/components/Chat/ChatBody.tsx": {
|
19095
|
-
"bytesInOutput":
|
19051
|
+
"bytesInOutput": 15220
|
19096
19052
|
},
|
19097
19053
|
"src/Prebuilt/components/Chat/ChatActions.tsx": {
|
19098
19054
|
"bytesInOutput": 9785
|
@@ -19247,7 +19203,7 @@
|
|
19247
19203
|
"src/Prebuilt/components/VideoLayouts/WhiteboardLayout.tsx": {
|
19248
19204
|
"bytesInOutput": 2797
|
19249
19205
|
},
|
19250
|
-
"
|
19206
|
+
"../../../../../../var/folders/_k/lv0n3xdx0n9c5c6nzjvb629r0000gn/T/tmp-5599-rVgyIDHVeqLY/1906a2e4dba1/index.css": {
|
19251
19207
|
"bytesInOutput": 0
|
19252
19208
|
},
|
19253
19209
|
"src/Prebuilt/common/PeersSorter.ts": {
|
@@ -19413,16 +19369,16 @@
|
|
19413
19369
|
"bytesInOutput": 12635
|
19414
19370
|
},
|
19415
19371
|
"src/Diagnostics/VideoTest.tsx": {
|
19416
|
-
"bytesInOutput":
|
19372
|
+
"bytesInOutput": 2372
|
19417
19373
|
}
|
19418
19374
|
},
|
19419
|
-
"bytes":
|
19375
|
+
"bytes": 1847927
|
19420
19376
|
},
|
19421
19377
|
"dist/index.css.map": {
|
19422
19378
|
"imports": [],
|
19423
19379
|
"exports": [],
|
19424
19380
|
"inputs": {},
|
19425
|
-
"bytes":
|
19381
|
+
"bytes": 122484
|
19426
19382
|
},
|
19427
19383
|
"dist/index.css": {
|
19428
19384
|
"imports": [
|
@@ -19478,22 +19434,22 @@
|
|
19478
19434
|
}
|
19479
19435
|
],
|
19480
19436
|
"inputs": {
|
19481
|
-
"
|
19437
|
+
"../../../../../../var/folders/_k/lv0n3xdx0n9c5c6nzjvb629r0000gn/T/tmp-5599-rVgyIDHVeqLY/1906a2e4ded3/tldraw.css": {
|
19482
19438
|
"bytesInOutput": 75223
|
19483
19439
|
},
|
19484
|
-
"
|
19440
|
+
"../../../../../../var/folders/_k/lv0n3xdx0n9c5c6nzjvb629r0000gn/T/tmp-5599-rVgyIDHVeqLY/1906a2e4dba1/index.css": {
|
19485
19441
|
"bytesInOutput": 401
|
19486
19442
|
}
|
19487
19443
|
},
|
19488
|
-
"bytes":
|
19444
|
+
"bytes": 75983
|
19489
19445
|
},
|
19490
|
-
"dist/HLSView-
|
19446
|
+
"dist/HLSView-J7FHXBEW.css.map": {
|
19491
19447
|
"imports": [],
|
19492
19448
|
"exports": [],
|
19493
19449
|
"inputs": {},
|
19494
|
-
"bytes":
|
19450
|
+
"bytes": 122484
|
19495
19451
|
},
|
19496
|
-
"dist/HLSView-
|
19452
|
+
"dist/HLSView-J7FHXBEW.css": {
|
19497
19453
|
"imports": [
|
19498
19454
|
{
|
19499
19455
|
"path": "https://fonts.googleapis.com/css2?family=Inter:wght@400;500&display=swap",
|
@@ -19547,14 +19503,14 @@
|
|
19547
19503
|
}
|
19548
19504
|
],
|
19549
19505
|
"inputs": {
|
19550
|
-
"
|
19506
|
+
"../../../../../../var/folders/_k/lv0n3xdx0n9c5c6nzjvb629r0000gn/T/tmp-5599-rVgyIDHVeqLY/1906a2e4ded3/tldraw.css": {
|
19551
19507
|
"bytesInOutput": 75223
|
19552
19508
|
},
|
19553
|
-
"
|
19509
|
+
"../../../../../../var/folders/_k/lv0n3xdx0n9c5c6nzjvb629r0000gn/T/tmp-5599-rVgyIDHVeqLY/1906a2e4dba1/index.css": {
|
19554
19510
|
"bytesInOutput": 401
|
19555
19511
|
}
|
19556
19512
|
},
|
19557
|
-
"bytes":
|
19513
|
+
"bytes": 75994
|
19558
19514
|
}
|
19559
19515
|
}
|
19560
19516
|
}
|
package/package.json
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
"prebuilt",
|
11
11
|
"roomkit"
|
12
12
|
],
|
13
|
-
"version": "0.3.14-alpha.
|
13
|
+
"version": "0.3.14-alpha.12",
|
14
14
|
"author": "100ms",
|
15
15
|
"license": "MIT",
|
16
16
|
"repository": {
|
@@ -67,6 +67,7 @@
|
|
67
67
|
"babel-loader": "^8.2.5",
|
68
68
|
"babel-plugin-react-require": "3.1.3",
|
69
69
|
"esbuild-loader": "^4.0.2",
|
70
|
+
"knip": "^5.11.0",
|
70
71
|
"react": "^18.1.0",
|
71
72
|
"storybook-dark-mode": "^3.0.0"
|
72
73
|
},
|
@@ -74,12 +75,12 @@
|
|
74
75
|
"react": ">=17.0.2 <19.0.0"
|
75
76
|
},
|
76
77
|
"dependencies": {
|
77
|
-
"@100mslive/hls-player": "0.3.14-alpha.
|
78
|
+
"@100mslive/hls-player": "0.3.14-alpha.12",
|
78
79
|
"@100mslive/hms-noise-cancellation": "0.0.1",
|
79
|
-
"@100mslive/hms-virtual-background": "1.13.14-alpha.
|
80
|
-
"@100mslive/hms-whiteboard": "0.0.4-alpha.
|
81
|
-
"@100mslive/react-icons": "0.10.14-alpha.
|
82
|
-
"@100mslive/react-sdk": "0.10.14-alpha.
|
80
|
+
"@100mslive/hms-virtual-background": "1.13.14-alpha.12",
|
81
|
+
"@100mslive/hms-whiteboard": "0.0.4-alpha.12",
|
82
|
+
"@100mslive/react-icons": "0.10.14-alpha.12",
|
83
|
+
"@100mslive/react-sdk": "0.10.14-alpha.12",
|
83
84
|
"@100mslive/types-prebuilt": "0.12.9",
|
84
85
|
"@emoji-mart/data": "^1.0.6",
|
85
86
|
"@emoji-mart/react": "^1.0.1",
|
@@ -115,5 +116,5 @@
|
|
115
116
|
"uuid": "^8.3.2",
|
116
117
|
"worker-timers": "^7.0.40"
|
117
118
|
},
|
118
|
-
"gitHead": "
|
119
|
+
"gitHead": "14063c3bf0fd56f1ddf10ec37c4accd0e47a9f6b"
|
119
120
|
}
|
@@ -75,28 +75,35 @@ const MessageTypeContainer = ({ left, right }: { left?: string; right?: string }
|
|
75
75
|
ml: '$2',
|
76
76
|
mr: '$4',
|
77
77
|
gap: '$space$2',
|
78
|
+
flexWrap: 'nowrap',
|
78
79
|
}}
|
79
80
|
>
|
80
81
|
{left && (
|
81
|
-
<
|
82
|
+
<Text
|
82
83
|
variant="xs"
|
83
84
|
as="span"
|
84
|
-
css={{
|
85
|
+
css={{
|
86
|
+
color: '$on_surface_medium',
|
87
|
+
textTransform: 'capitalize',
|
88
|
+
fontWeight: '$regular',
|
89
|
+
whiteSpace: 'nowrap',
|
90
|
+
}}
|
85
91
|
>
|
86
92
|
{left}
|
87
|
-
</
|
93
|
+
</Text>
|
88
94
|
)}
|
89
95
|
{right && (
|
90
|
-
<
|
96
|
+
<Text
|
91
97
|
as="span"
|
92
98
|
variant="overline"
|
93
99
|
css={{
|
94
100
|
color: '$on_surface_medium',
|
95
101
|
fontWeight: '$regular',
|
102
|
+
whiteSpace: 'nowrap',
|
96
103
|
}}
|
97
104
|
>
|
98
105
|
{right}
|
99
|
-
</
|
106
|
+
</Text>
|
100
107
|
)}
|
101
108
|
</Flex>
|
102
109
|
);
|
@@ -169,7 +176,7 @@ const SenderName = styled(Text, {
|
|
169
176
|
overflow: 'hidden',
|
170
177
|
textOverflow: 'ellipsis',
|
171
178
|
whiteSpace: 'nowrap',
|
172
|
-
|
179
|
+
width: '100%',
|
173
180
|
minWidth: 0,
|
174
181
|
color: '$on_surface_high',
|
175
182
|
fontWeight: '$semiBold',
|
@@ -251,7 +258,15 @@ const ChatMessage = React.memo(
|
|
251
258
|
}}
|
252
259
|
as="div"
|
253
260
|
>
|
254
|
-
<Flex
|
261
|
+
<Flex
|
262
|
+
align="baseline"
|
263
|
+
css={{
|
264
|
+
flexWrap: 'nowrap',
|
265
|
+
maxWidth: 'calc(100% - 10ch)',
|
266
|
+
textOverflow: 'ellipsis',
|
267
|
+
whiteSpace: 'nowrap',
|
268
|
+
}}
|
269
|
+
>
|
255
270
|
{message.senderName === 'You' || !message.senderName ? (
|
256
271
|
<SenderName
|
257
272
|
as="span"
|
@@ -261,7 +276,7 @@ const ChatMessage = React.memo(
|
|
261
276
|
{message.senderName || 'Anonymous'}
|
262
277
|
</SenderName>
|
263
278
|
) : (
|
264
|
-
<Tooltip title={message.senderName} side="top" align="start">
|
279
|
+
<Tooltip title={message.senderName} side="top" align="start" boxCss={{ zIndex: 50 }}>
|
265
280
|
<SenderName
|
266
281
|
as="span"
|
267
282
|
variant="sub2"
|
@@ -1,16 +1,8 @@
|
|
1
1
|
import React, { useState } from 'react';
|
2
|
-
import { selectLocalPeerID,
|
3
|
-
import {
|
4
|
-
AudioPlayerIcon,
|
5
|
-
ChevronDownIcon,
|
6
|
-
ChevronUpIcon,
|
7
|
-
MusicIcon,
|
8
|
-
ShareScreenIcon,
|
9
|
-
VideoPlayerIcon,
|
10
|
-
} from '@100mslive/react-icons';
|
2
|
+
import { selectLocalPeerID, useHMSStore, useScreenShare } from '@100mslive/react-sdk';
|
3
|
+
import { ChevronDownIcon, ChevronUpIcon, MusicIcon, ShareScreenIcon, VideoPlayerIcon } from '@100mslive/react-icons';
|
11
4
|
import { Box, Dropdown, Flex, Text, Tooltip } from '../../../';
|
12
5
|
import { useUISettings } from '../AppData/useUISettings';
|
13
|
-
import { usePlaylistMusic } from '../hooks/usePlaylistMusic';
|
14
6
|
import { useScreenshareAudio } from '../hooks/useScreenshareAudio';
|
15
7
|
import { UI_SETTINGS } from '../../common/constants';
|
16
8
|
|
@@ -35,29 +27,21 @@ export const getRecordingText = ({ isBrowserRecordingOn, isServerRecordingOn, is
|
|
35
27
|
* Display state of recording, streaming, playlist, whiteboard
|
36
28
|
*/
|
37
29
|
export const AdditionalRoomState = () => {
|
38
|
-
const playlist = usePlaylistMusic();
|
39
30
|
const isAudioOnly = useUISettings(UI_SETTINGS.isAudioOnly);
|
40
31
|
const screenshareAudio = useScreenshareAudio();
|
41
32
|
const [open, setOpen] = useState(false);
|
42
|
-
const isPlaylistInactive = [
|
43
|
-
!playlist.peer || !playlist.track,
|
44
|
-
!playlist.peer?.isLocal && !playlist.track?.enabled,
|
45
|
-
playlist.peer?.isLocal && !playlist.selection,
|
46
|
-
].some(Boolean);
|
47
33
|
const isAudioshareInactive = [
|
48
34
|
!screenshareAudio.peer || !screenshareAudio.track,
|
49
35
|
!screenshareAudio.peer?.isLocal && !screenshareAudio.track?.enabled,
|
50
36
|
].some(Boolean);
|
51
37
|
|
52
|
-
const peerSharingPlaylist = useHMSStore(selectPeerSharingVideoPlaylist);
|
53
38
|
const localPeerID = useHMSStore(selectLocalPeerID);
|
54
|
-
const isVideoPlayListPlaying = !!peerSharingPlaylist?.id;
|
55
39
|
const { screenSharingPeerName, screenSharingPeerId, screenShareVideoTrackId } = useScreenShare();
|
56
40
|
|
57
41
|
const isVideoScreenSharingOn = !!screenShareVideoTrackId;
|
58
42
|
const shouldShowScreenShareState = isAudioOnly && isVideoScreenSharingOn;
|
59
|
-
const shouldShowVideoState = isAudioOnly
|
60
|
-
if (
|
43
|
+
const shouldShowVideoState = isAudioOnly;
|
44
|
+
if (isAudioshareInactive && !shouldShowScreenShareState && !shouldShowVideoState) {
|
61
45
|
return null;
|
62
46
|
}
|
63
47
|
|
@@ -96,50 +80,12 @@ export const AdditionalRoomState = () => {
|
|
96
80
|
</Flex>
|
97
81
|
</Tooltip>
|
98
82
|
)}
|
99
|
-
{!isPlaylistInactive && (
|
100
|
-
<Tooltip title="Playlist Music">
|
101
|
-
<Flex align="center" css={{ color: '$on_primary_high', mx: '$2' }}>
|
102
|
-
<AudioPlayerIcon width={24} height={24} />
|
103
|
-
</Flex>
|
104
|
-
</Tooltip>
|
105
|
-
)}
|
106
83
|
<Box css={{ '@lg': { display: 'none' }, color: '$on_surface_low' }}>
|
107
84
|
{open ? <ChevronUpIcon /> : <ChevronDownIcon />}
|
108
85
|
</Box>
|
109
86
|
</Flex>
|
110
87
|
</Dropdown.Trigger>
|
111
88
|
<Dropdown.Content sideOffset={5} align="end" css={{ w: '$60' }}>
|
112
|
-
{!isPlaylistInactive && (
|
113
|
-
<Dropdown.Item css={{ color: '$on_primary_high' }}>
|
114
|
-
<AudioPlayerIcon width={24} height={24} />
|
115
|
-
<Text variant="sm" css={{ ml: '$2', flex: '1 1 0' }}>
|
116
|
-
Playlist is playing
|
117
|
-
</Text>
|
118
|
-
{playlist.peer.isLocal ? (
|
119
|
-
<Text
|
120
|
-
variant="sm"
|
121
|
-
css={{ color: '$alert_error_default', cursor: 'pointer', ml: '$2' }}
|
122
|
-
onClick={e => {
|
123
|
-
e.preventDefault();
|
124
|
-
playlist.selection.playing ? playlist.pause() : playlist.play(playlist.selection.id);
|
125
|
-
}}
|
126
|
-
>
|
127
|
-
{playlist.selection.playing ? 'Pause' : 'Play'}
|
128
|
-
</Text>
|
129
|
-
) : (
|
130
|
-
<Text
|
131
|
-
variant="sm"
|
132
|
-
css={{ color: '$alert_error_default', ml: '$2', cursor: 'pointer' }}
|
133
|
-
onClick={e => {
|
134
|
-
e.preventDefault();
|
135
|
-
playlist.setVolume(!playlist.track.volume ? 100 : 0);
|
136
|
-
}}
|
137
|
-
>
|
138
|
-
{playlist.track.volume === 0 ? 'Unmute' : 'Mute'}
|
139
|
-
</Text>
|
140
|
-
)}
|
141
|
-
</Dropdown.Item>
|
142
|
-
)}
|
143
89
|
{!isAudioshareInactive && (
|
144
90
|
<Dropdown.Item css={{ color: '$on_primary_high' }}>
|
145
91
|
<MusicIcon width={24} height={24} />
|
@@ -166,14 +112,6 @@ export const AdditionalRoomState = () => {
|
|
166
112
|
</Text>
|
167
113
|
</Dropdown.Item>
|
168
114
|
)}
|
169
|
-
{shouldShowVideoState && (
|
170
|
-
<Dropdown.Item css={{ color: '$on_primary_high' }}>
|
171
|
-
<VideoPlayerIcon width={24} height={24} />
|
172
|
-
<Text variant="sm" css={{ ml: '$2', flex: '1 1 0' }}>
|
173
|
-
{`Shared by: ${peerSharingPlaylist.id === localPeerID ? 'You' : peerSharingPlaylist.name}`}
|
174
|
-
</Text>
|
175
|
-
</Dropdown.Item>
|
176
|
-
)}
|
177
115
|
</Dropdown.Content>
|
178
116
|
</Dropdown.Root>
|
179
117
|
);
|
@@ -1,7 +0,0 @@
|
|
1
|
-
import { selectAppDataByPath, useHMSStore } from '@100mslive/react-sdk';
|
2
|
-
import { APP_DATA } from '../../common/constants';
|
3
|
-
|
4
|
-
export const useAppConfig = (...path) => {
|
5
|
-
const appConfig = useHMSStore(selectAppDataByPath(APP_DATA.appConfig, ...path));
|
6
|
-
return appConfig;
|
7
|
-
};
|
@@ -1,27 +0,0 @@
|
|
1
|
-
import React, { MouseEvent } from 'react';
|
2
|
-
import { PauseIcon, PlayIcon } from '@100mslive/react-icons';
|
3
|
-
import { IconButton, Tooltip } from '../../..';
|
4
|
-
import { useHMSPlayerContext } from './PlayerContext';
|
5
|
-
|
6
|
-
export const PlayButton = ({
|
7
|
-
isPaused,
|
8
|
-
width = 20,
|
9
|
-
height = 20,
|
10
|
-
}: {
|
11
|
-
isPaused: boolean;
|
12
|
-
width: number;
|
13
|
-
height: number;
|
14
|
-
}) => {
|
15
|
-
const { hlsPlayer } = useHMSPlayerContext();
|
16
|
-
const onClick = async (event: MouseEvent) => {
|
17
|
-
event?.stopPropagation();
|
18
|
-
isPaused ? await hlsPlayer?.play() : hlsPlayer?.pause();
|
19
|
-
};
|
20
|
-
return (
|
21
|
-
<Tooltip title={isPaused ? 'Play' : 'Pause'} side="top">
|
22
|
-
<IconButton onClick={onClick} data-testid="play_pause_btn">
|
23
|
-
{isPaused ? <PlayIcon width={width} height={height} /> : <PauseIcon width={width} height={height} />}
|
24
|
-
</IconButton>
|
25
|
-
</Tooltip>
|
26
|
-
);
|
27
|
-
};
|
@@ -1,88 +0,0 @@
|
|
1
|
-
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
2
|
-
import { MusicIcon } from '@100mslive/react-icons';
|
3
|
-
import { IconButton, Tooltip } from '../../../';
|
4
|
-
import { useSetUiSettings } from '../AppData/useUISettings';
|
5
|
-
import { useWhenAloneInRoom } from '../../common/hooks';
|
6
|
-
import { UI_SETTINGS } from '../../common/constants';
|
7
|
-
|
8
|
-
const ambientMusicURL = process.env.REACT_APP_AMBIENT_MUSIC;
|
9
|
-
/**
|
10
|
-
* @type HTMLAudioElement
|
11
|
-
*/
|
12
|
-
let ambientAudio = null;
|
13
|
-
if (ambientMusicURL) {
|
14
|
-
try {
|
15
|
-
ambientAudio = new Audio(ambientMusicURL);
|
16
|
-
} catch (err) {
|
17
|
-
console.error(err);
|
18
|
-
}
|
19
|
-
}
|
20
|
-
|
21
|
-
/**
|
22
|
-
*
|
23
|
-
* @param {number} threshold the threshold after which the music is played(from the starting to be alone in the room)
|
24
|
-
* @returns {Object}
|
25
|
-
* ready: boolean - the threshold has passed and the music can be played,
|
26
|
-
*
|
27
|
-
* playing: boolean - flag to denote whether music is playing,
|
28
|
-
*
|
29
|
-
* toggleAmbientMusic - function to play/pause the music
|
30
|
-
*/
|
31
|
-
const useAmbientMusic = (threshold = 5 * 1000) => {
|
32
|
-
const audioRef = useRef(ambientAudio);
|
33
|
-
const [userHasEnabled, setEnableAmbientMusic] = useSetUiSettings(UI_SETTINGS.enableAmbientMusic); // user settings
|
34
|
-
const [playing, setPlaying] = useState(false);
|
35
|
-
const { alone: aloneRightNow, aloneForLong } = useWhenAloneInRoom(threshold);
|
36
|
-
// play if user has enabled the setting and been alone for some time
|
37
|
-
const shouldMusicBePlayed = !playing && userHasEnabled && aloneForLong;
|
38
|
-
// pause immediately if user has disabled the setting or not alone anymore
|
39
|
-
const shouldMusicBePaused = playing && (!userHasEnabled || !aloneRightNow);
|
40
|
-
|
41
|
-
useEffect(() => {
|
42
|
-
if (shouldMusicBePlayed && audioRef.current) {
|
43
|
-
audioRef.current.volume = 0.2;
|
44
|
-
audioRef.current.loop = true;
|
45
|
-
audioRef.current.play().catch(err => console.error('Unable to play Ambient Music', err));
|
46
|
-
setPlaying(true);
|
47
|
-
}
|
48
|
-
}, [shouldMusicBePlayed]);
|
49
|
-
|
50
|
-
useEffect(() => {
|
51
|
-
if (shouldMusicBePaused) {
|
52
|
-
audioRef.current.pause();
|
53
|
-
setPlaying(false);
|
54
|
-
}
|
55
|
-
}, [shouldMusicBePaused]);
|
56
|
-
|
57
|
-
useEffect(() => {
|
58
|
-
const ref = audioRef.current;
|
59
|
-
// Stop on leave
|
60
|
-
return () => {
|
61
|
-
if (ref) {
|
62
|
-
ref.pause();
|
63
|
-
}
|
64
|
-
};
|
65
|
-
}, []);
|
66
|
-
|
67
|
-
const toggleAmbientMusic = useCallback(
|
68
|
-
() => setEnableAmbientMusic(!playing), // save user settings
|
69
|
-
[playing, setEnableAmbientMusic],
|
70
|
-
);
|
71
|
-
|
72
|
-
return { ready: aloneForLong, playing, toggleAmbientMusic };
|
73
|
-
};
|
74
|
-
|
75
|
-
export const AmbientMusic = () => {
|
76
|
-
const { ready, playing, toggleAmbientMusic } = useAmbientMusic();
|
77
|
-
if (!ambientAudio || !ready) {
|
78
|
-
return null;
|
79
|
-
}
|
80
|
-
|
81
|
-
return (
|
82
|
-
<Tooltip title={playing ? `Disable Ambient Music` : `Play Ambient Music`} key="ambient-music">
|
83
|
-
<IconButton css={{ mx: '$4' }} onClick={toggleAmbientMusic} active={!playing}>
|
84
|
-
<MusicIcon />
|
85
|
-
</IconButton>
|
86
|
-
</Tooltip>
|
87
|
-
);
|
88
|
-
};
|