@100mslive/roomkit-react 0.3.7-alpha.5 → 0.3.8-alpha.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/{HLSView-JXKL2OA3.js → HLSView-CTZXD762.js} +35 -17
- package/dist/{HLSView-JXKL2OA3.js.map → HLSView-CTZXD762.js.map} +3 -3
- package/dist/Prebuilt/components/HMSVideo/utils.d.ts +1 -0
- package/dist/{chunk-JAZO4PHJ.js → chunk-NDLMRKFR.js} +87 -87
- package/dist/{chunk-JAZO4PHJ.js.map → chunk-NDLMRKFR.js.map} +3 -3
- package/dist/index.cjs.js +112 -94
- package/dist/index.cjs.js.map +3 -3
- package/dist/index.js +1 -1
- package/dist/meta.cjs.json +15 -15
- package/dist/meta.esbuild.json +24 -24
- package/package.json +6 -6
- package/src/Prebuilt/components/HMSVideo/VideoProgress.tsx +3 -2
- package/src/Prebuilt/components/HMSVideo/VideoTime.tsx +16 -7
- package/src/Prebuilt/components/HMSVideo/utils.ts +10 -0
- package/src/Prebuilt/components/RoomDetails/RoomDetailsPane.tsx +2 -2
- package/src/Prebuilt/layouts/SidePane.tsx +1 -1
package/dist/index.js
CHANGED
package/dist/meta.cjs.json
CHANGED
@@ -4691,7 +4691,7 @@
|
|
4691
4691
|
"format": "cjs"
|
4692
4692
|
},
|
4693
4693
|
"../hms-video-store/dist/index.js": {
|
4694
|
-
"bytes":
|
4694
|
+
"bytes": 331528,
|
4695
4695
|
"imports": [
|
4696
4696
|
{
|
4697
4697
|
"path": "../../node_modules/reselect/es/index.js",
|
@@ -7622,7 +7622,7 @@
|
|
7622
7622
|
"format": "esm"
|
7623
7623
|
},
|
7624
7624
|
"src/Prebuilt/components/RoomDetails/RoomDetailsPane.tsx": {
|
7625
|
-
"bytes":
|
7625
|
+
"bytes": 2121,
|
7626
7626
|
"imports": [
|
7627
7627
|
{
|
7628
7628
|
"path": "react",
|
@@ -9403,7 +9403,7 @@
|
|
9403
9403
|
"format": "esm"
|
9404
9404
|
},
|
9405
9405
|
"src/Prebuilt/layouts/SidePane.tsx": {
|
9406
|
-
"bytes":
|
9406
|
+
"bytes": 6739,
|
9407
9407
|
"imports": [
|
9408
9408
|
{
|
9409
9409
|
"path": "react",
|
@@ -11118,7 +11118,7 @@
|
|
11118
11118
|
"format": "esm"
|
11119
11119
|
},
|
11120
11120
|
"src/Prebuilt/components/HMSVideo/utils.ts": {
|
11121
|
-
"bytes":
|
11121
|
+
"bytes": 1203,
|
11122
11122
|
"imports": [
|
11123
11123
|
{
|
11124
11124
|
"path": "<define:process.env>",
|
@@ -11129,7 +11129,7 @@
|
|
11129
11129
|
"format": "esm"
|
11130
11130
|
},
|
11131
11131
|
"src/Prebuilt/components/HMSVideo/VideoProgress.tsx": {
|
11132
|
-
"bytes":
|
11132
|
+
"bytes": 2942,
|
11133
11133
|
"imports": [
|
11134
11134
|
{
|
11135
11135
|
"path": "react",
|
@@ -11160,7 +11160,7 @@
|
|
11160
11160
|
"format": "esm"
|
11161
11161
|
},
|
11162
11162
|
"src/Prebuilt/components/HMSVideo/VideoTime.tsx": {
|
11163
|
-
"bytes":
|
11163
|
+
"bytes": 1531,
|
11164
11164
|
"imports": [
|
11165
11165
|
{
|
11166
11166
|
"path": "react",
|
@@ -13775,7 +13775,7 @@
|
|
13775
13775
|
"imports": [],
|
13776
13776
|
"exports": [],
|
13777
13777
|
"inputs": {},
|
13778
|
-
"bytes":
|
13778
|
+
"bytes": 3305923
|
13779
13779
|
},
|
13780
13780
|
"dist/index.cjs.js": {
|
13781
13781
|
"imports": [
|
@@ -16719,7 +16719,7 @@
|
|
16719
16719
|
"entryPoint": "src/index.ts",
|
16720
16720
|
"inputs": {
|
16721
16721
|
"<define:process.env>": {
|
16722
|
-
"bytesInOutput":
|
16722
|
+
"bytesInOutput": 18306
|
16723
16723
|
},
|
16724
16724
|
"src/Theme/base.config.ts": {
|
16725
16725
|
"bytesInOutput": 6104
|
@@ -17199,7 +17199,7 @@
|
|
17199
17199
|
"bytesInOutput": 16122
|
17200
17200
|
},
|
17201
17201
|
"../../node_modules/sdp-transform/lib/parser.js": {
|
17202
|
-
"bytesInOutput":
|
17202
|
+
"bytesInOutput": 3492
|
17203
17203
|
},
|
17204
17204
|
"../../node_modules/sdp-transform/lib/writer.js": {
|
17205
17205
|
"bytesInOutput": 3070
|
@@ -17400,7 +17400,7 @@
|
|
17400
17400
|
"bytesInOutput": 1003
|
17401
17401
|
},
|
17402
17402
|
"src/Prebuilt/components/RoomDetails/RoomDetailsPane.tsx": {
|
17403
|
-
"bytesInOutput":
|
17403
|
+
"bytesInOutput": 2637
|
17404
17404
|
},
|
17405
17405
|
"src/Prebuilt/components/Chat/MwebChatOption.tsx": {
|
17406
17406
|
"bytesInOutput": 688
|
@@ -17499,7 +17499,7 @@
|
|
17499
17499
|
"bytesInOutput": 8756
|
17500
17500
|
},
|
17501
17501
|
"src/Prebuilt/layouts/SidePane.tsx": {
|
17502
|
-
"bytesInOutput":
|
17502
|
+
"bytesInOutput": 7946
|
17503
17503
|
},
|
17504
17504
|
"src/Prebuilt/components/Chip.tsx": {
|
17505
17505
|
"bytesInOutput": 1118
|
@@ -17604,13 +17604,13 @@
|
|
17604
17604
|
"bytesInOutput": 5741
|
17605
17605
|
},
|
17606
17606
|
"src/Prebuilt/components/HMSVideo/utils.ts": {
|
17607
|
-
"bytesInOutput":
|
17607
|
+
"bytesInOutput": 1025
|
17608
17608
|
},
|
17609
17609
|
"src/Prebuilt/components/HMSVideo/VideoProgress.tsx": {
|
17610
|
-
"bytesInOutput":
|
17610
|
+
"bytesInOutput": 3714
|
17611
17611
|
},
|
17612
17612
|
"src/Prebuilt/components/HMSVideo/VideoTime.tsx": {
|
17613
|
-
"bytesInOutput":
|
17613
|
+
"bytesInOutput": 2019
|
17614
17614
|
},
|
17615
17615
|
"src/Prebuilt/components/HMSVideo/VolumeControl.tsx": {
|
17616
17616
|
"bytesInOutput": 2951
|
@@ -17772,7 +17772,7 @@
|
|
17772
17772
|
"bytesInOutput": 2980
|
17773
17773
|
}
|
17774
17774
|
},
|
17775
|
-
"bytes":
|
17775
|
+
"bytes": 1572837
|
17776
17776
|
}
|
17777
17777
|
}
|
17778
17778
|
}
|
package/dist/meta.esbuild.json
CHANGED
@@ -4691,7 +4691,7 @@
|
|
4691
4691
|
"format": "cjs"
|
4692
4692
|
},
|
4693
4693
|
"../hms-video-store/dist/index.js": {
|
4694
|
-
"bytes":
|
4694
|
+
"bytes": 331528,
|
4695
4695
|
"imports": [
|
4696
4696
|
{
|
4697
4697
|
"path": "../../node_modules/reselect/es/index.js",
|
@@ -7622,7 +7622,7 @@
|
|
7622
7622
|
"format": "esm"
|
7623
7623
|
},
|
7624
7624
|
"src/Prebuilt/components/RoomDetails/RoomDetailsPane.tsx": {
|
7625
|
-
"bytes":
|
7625
|
+
"bytes": 2121,
|
7626
7626
|
"imports": [
|
7627
7627
|
{
|
7628
7628
|
"path": "react",
|
@@ -9403,7 +9403,7 @@
|
|
9403
9403
|
"format": "esm"
|
9404
9404
|
},
|
9405
9405
|
"src/Prebuilt/layouts/SidePane.tsx": {
|
9406
|
-
"bytes":
|
9406
|
+
"bytes": 6739,
|
9407
9407
|
"imports": [
|
9408
9408
|
{
|
9409
9409
|
"path": "react",
|
@@ -11118,7 +11118,7 @@
|
|
11118
11118
|
"format": "esm"
|
11119
11119
|
},
|
11120
11120
|
"src/Prebuilt/components/HMSVideo/utils.ts": {
|
11121
|
-
"bytes":
|
11121
|
+
"bytes": 1203,
|
11122
11122
|
"imports": [
|
11123
11123
|
{
|
11124
11124
|
"path": "<define:process.env>",
|
@@ -11129,7 +11129,7 @@
|
|
11129
11129
|
"format": "esm"
|
11130
11130
|
},
|
11131
11131
|
"src/Prebuilt/components/HMSVideo/VideoProgress.tsx": {
|
11132
|
-
"bytes":
|
11132
|
+
"bytes": 2942,
|
11133
11133
|
"imports": [
|
11134
11134
|
{
|
11135
11135
|
"path": "react",
|
@@ -11160,7 +11160,7 @@
|
|
11160
11160
|
"format": "esm"
|
11161
11161
|
},
|
11162
11162
|
"src/Prebuilt/components/HMSVideo/VideoTime.tsx": {
|
11163
|
-
"bytes":
|
11163
|
+
"bytes": 1531,
|
11164
11164
|
"imports": [
|
11165
11165
|
{
|
11166
11166
|
"path": "react",
|
@@ -13780,7 +13780,7 @@
|
|
13780
13780
|
"dist/index.js": {
|
13781
13781
|
"imports": [
|
13782
13782
|
{
|
13783
|
-
"path": "dist/chunk-
|
13783
|
+
"path": "dist/chunk-NDLMRKFR.js",
|
13784
13784
|
"kind": "import-statement"
|
13785
13785
|
}
|
13786
13786
|
],
|
@@ -13853,16 +13853,16 @@
|
|
13853
13853
|
"inputs": {},
|
13854
13854
|
"bytes": 1822
|
13855
13855
|
},
|
13856
|
-
"dist/HLSView-
|
13856
|
+
"dist/HLSView-CTZXD762.js.map": {
|
13857
13857
|
"imports": [],
|
13858
13858
|
"exports": [],
|
13859
13859
|
"inputs": {},
|
13860
|
-
"bytes":
|
13860
|
+
"bytes": 100708
|
13861
13861
|
},
|
13862
|
-
"dist/HLSView-
|
13862
|
+
"dist/HLSView-CTZXD762.js": {
|
13863
13863
|
"imports": [
|
13864
13864
|
{
|
13865
|
-
"path": "dist/chunk-
|
13865
|
+
"path": "dist/chunk-NDLMRKFR.js",
|
13866
13866
|
"kind": "import-statement"
|
13867
13867
|
},
|
13868
13868
|
{
|
@@ -14069,13 +14069,13 @@
|
|
14069
14069
|
"bytesInOutput": 328
|
14070
14070
|
},
|
14071
14071
|
"src/Prebuilt/components/HMSVideo/VideoProgress.tsx": {
|
14072
|
-
"bytesInOutput":
|
14072
|
+
"bytesInOutput": 2986
|
14073
14073
|
},
|
14074
14074
|
"src/Prebuilt/components/HMSVideo/utils.ts": {
|
14075
|
-
"bytesInOutput":
|
14075
|
+
"bytesInOutput": 917
|
14076
14076
|
},
|
14077
14077
|
"src/Prebuilt/components/HMSVideo/VideoTime.tsx": {
|
14078
|
-
"bytesInOutput":
|
14078
|
+
"bytesInOutput": 1564
|
14079
14079
|
},
|
14080
14080
|
"src/Prebuilt/components/HMSVideo/VolumeControl.tsx": {
|
14081
14081
|
"bytesInOutput": 2284
|
@@ -14096,15 +14096,15 @@
|
|
14096
14096
|
"bytesInOutput": 2101
|
14097
14097
|
}
|
14098
14098
|
},
|
14099
|
-
"bytes":
|
14099
|
+
"bytes": 61939
|
14100
14100
|
},
|
14101
|
-
"dist/chunk-
|
14101
|
+
"dist/chunk-NDLMRKFR.js.map": {
|
14102
14102
|
"imports": [],
|
14103
14103
|
"exports": [],
|
14104
14104
|
"inputs": {},
|
14105
|
-
"bytes":
|
14105
|
+
"bytes": 3201090
|
14106
14106
|
},
|
14107
|
-
"dist/chunk-
|
14107
|
+
"dist/chunk-NDLMRKFR.js": {
|
14108
14108
|
"imports": [
|
14109
14109
|
{
|
14110
14110
|
"path": "react",
|
@@ -16487,7 +16487,7 @@
|
|
16487
16487
|
"external": true
|
16488
16488
|
},
|
16489
16489
|
{
|
16490
|
-
"path": "dist/HLSView-
|
16490
|
+
"path": "dist/HLSView-CTZXD762.js",
|
16491
16491
|
"kind": "dynamic-import"
|
16492
16492
|
},
|
16493
16493
|
{
|
@@ -16968,7 +16968,7 @@
|
|
16968
16968
|
],
|
16969
16969
|
"inputs": {
|
16970
16970
|
"<define:process.env>": {
|
16971
|
-
"bytesInOutput":
|
16971
|
+
"bytesInOutput": 18306
|
16972
16972
|
},
|
16973
16973
|
"../../node_modules/lodash/lodash.js": {
|
16974
16974
|
"bytesInOutput": 224310
|
@@ -16986,7 +16986,7 @@
|
|
16986
16986
|
"bytesInOutput": 16120
|
16987
16987
|
},
|
16988
16988
|
"../../node_modules/sdp-transform/lib/parser.js": {
|
16989
|
-
"bytesInOutput":
|
16989
|
+
"bytesInOutput": 3492
|
16990
16990
|
},
|
16991
16991
|
"../../node_modules/sdp-transform/lib/writer.js": {
|
16992
16992
|
"bytesInOutput": 3068
|
@@ -17547,7 +17547,7 @@
|
|
17547
17547
|
"bytesInOutput": 9625
|
17548
17548
|
},
|
17549
17549
|
"src/Prebuilt/layouts/SidePane.tsx": {
|
17550
|
-
"bytesInOutput":
|
17550
|
+
"bytesInOutput": 6436
|
17551
17551
|
},
|
17552
17552
|
"src/Prebuilt/components/Polls/Polls.tsx": {
|
17553
17553
|
"bytesInOutput": 735
|
@@ -17622,7 +17622,7 @@
|
|
17622
17622
|
"bytesInOutput": 1727
|
17623
17623
|
},
|
17624
17624
|
"src/Prebuilt/components/RoomDetails/RoomDetailsPane.tsx": {
|
17625
|
-
"bytesInOutput":
|
17625
|
+
"bytesInOutput": 1914
|
17626
17626
|
},
|
17627
17627
|
"src/Prebuilt/components/Header/HeaderComponents.jsx": {
|
17628
17628
|
"bytesInOutput": 1626
|
@@ -17928,7 +17928,7 @@
|
|
17928
17928
|
"bytesInOutput": 651
|
17929
17929
|
}
|
17930
17930
|
},
|
17931
|
-
"bytes":
|
17931
|
+
"bytes": 1310527
|
17932
17932
|
}
|
17933
17933
|
}
|
17934
17934
|
}
|
package/package.json
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
"prebuilt",
|
11
11
|
"roomkit"
|
12
12
|
],
|
13
|
-
"version": "0.3.
|
13
|
+
"version": "0.3.8-alpha.0",
|
14
14
|
"author": "100ms",
|
15
15
|
"license": "MIT",
|
16
16
|
"repository": {
|
@@ -82,11 +82,11 @@
|
|
82
82
|
"react": ">=17.0.2 <19.0.0"
|
83
83
|
},
|
84
84
|
"dependencies": {
|
85
|
-
"@100mslive/hls-player": "0.3.
|
85
|
+
"@100mslive/hls-player": "0.3.8-alpha.0",
|
86
86
|
"@100mslive/hms-noise-cancellation": "0.0.1",
|
87
|
-
"@100mslive/hms-virtual-background": "1.13.
|
88
|
-
"@100mslive/react-icons": "0.10.
|
89
|
-
"@100mslive/react-sdk": "0.10.
|
87
|
+
"@100mslive/hms-virtual-background": "1.13.8-alpha.0",
|
88
|
+
"@100mslive/react-icons": "0.10.8-alpha.0",
|
89
|
+
"@100mslive/react-sdk": "0.10.8-alpha.0",
|
90
90
|
"@100mslive/types-prebuilt": "0.12.8",
|
91
91
|
"@emoji-mart/data": "^1.0.6",
|
92
92
|
"@emoji-mart/react": "^1.0.1",
|
@@ -122,5 +122,5 @@
|
|
122
122
|
"uuid": "^8.3.2",
|
123
123
|
"worker-timers": "^7.0.40"
|
124
124
|
},
|
125
|
-
"gitHead": "
|
125
|
+
"gitHead": "01f2b5f23cc814beb7f077b46b6736f1e00ceaad"
|
126
126
|
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React, { useCallback, useEffect, useState } from 'react';
|
2
2
|
import { Box, Flex, Slider } from '../../..';
|
3
3
|
import { useHMSPlayerContext } from './PlayerContext';
|
4
|
-
import { getPercentage } from './utils';
|
4
|
+
import { getDuration, getPercentage } from './utils';
|
5
5
|
|
6
6
|
export const VideoProgress = ({
|
7
7
|
seekProgress,
|
@@ -19,7 +19,7 @@ export const VideoProgress = ({
|
|
19
19
|
if (!videoEl) {
|
20
20
|
return;
|
21
21
|
}
|
22
|
-
const duration =
|
22
|
+
const duration = getDuration(videoEl);
|
23
23
|
const videoProgress = Math.floor(getPercentage(videoEl.currentTime, duration));
|
24
24
|
let bufferProgress = 0;
|
25
25
|
if (videoEl.buffered.length > 0) {
|
@@ -42,6 +42,7 @@ export const VideoProgress = ({
|
|
42
42
|
if (!videoEl) {
|
43
43
|
return;
|
44
44
|
}
|
45
|
+
setProgress();
|
45
46
|
videoEl.addEventListener('timeupdate', timeupdateHandler);
|
46
47
|
return function cleanup() {
|
47
48
|
videoEl?.removeEventListener('timeupdate', timeupdateHandler);
|
@@ -1,30 +1,39 @@
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
1
|
+
import React, { useCallback, useEffect, useState } from 'react';
|
2
2
|
import { HMSHLSPlayerEvents } from '@100mslive/hls-player';
|
3
3
|
import { Text } from '../../../Text';
|
4
4
|
import { useHMSPlayerContext } from './PlayerContext';
|
5
|
-
import { getDurationFromSeconds } from './utils';
|
5
|
+
import { getDuration, getDurationFromSeconds } from './utils';
|
6
6
|
|
7
7
|
export const VideoTime = () => {
|
8
8
|
const { hlsPlayer } = useHMSPlayerContext();
|
9
|
-
const [videoTime, setVideoTime] = useState('');
|
10
9
|
|
11
|
-
|
12
|
-
|
10
|
+
const [videoTime, setVideoTime] = useState(getDurationFromSeconds(0));
|
11
|
+
|
12
|
+
const updateTime = useCallback(
|
13
|
+
(currentTime: number) => {
|
13
14
|
const videoEl = hlsPlayer?.getVideoElement();
|
14
15
|
if (videoEl) {
|
15
|
-
const duration =
|
16
|
+
const duration = getDuration(videoEl);
|
16
17
|
setVideoTime(getDurationFromSeconds(duration - currentTime));
|
17
18
|
} else {
|
18
19
|
setVideoTime(getDurationFromSeconds(currentTime));
|
19
20
|
}
|
21
|
+
},
|
22
|
+
[hlsPlayer],
|
23
|
+
);
|
24
|
+
useEffect(() => {
|
25
|
+
const timeupdateHandler = (currentTime: number) => {
|
26
|
+
updateTime(currentTime);
|
20
27
|
};
|
21
28
|
if (hlsPlayer) {
|
22
29
|
hlsPlayer.on(HMSHLSPlayerEvents.CURRENT_TIME, timeupdateHandler);
|
30
|
+
const videoEl = hlsPlayer?.getVideoElement();
|
31
|
+
updateTime(videoEl.currentTime);
|
23
32
|
}
|
24
33
|
return function cleanup() {
|
25
34
|
hlsPlayer?.off(HMSHLSPlayerEvents.CURRENT_TIME, timeupdateHandler);
|
26
35
|
};
|
27
|
-
}, [hlsPlayer]);
|
36
|
+
}, [hlsPlayer, updateTime]);
|
28
37
|
|
29
38
|
return hlsPlayer ? (
|
30
39
|
<Text
|
@@ -25,3 +25,13 @@ export function getDurationFromSeconds(timeInSeconds: number) {
|
|
25
25
|
}
|
26
26
|
return videoTimeStr;
|
27
27
|
}
|
28
|
+
|
29
|
+
export function getDuration(videoEl: HTMLVideoElement): number {
|
30
|
+
if (isFinite(videoEl.duration)) {
|
31
|
+
return videoEl.duration;
|
32
|
+
}
|
33
|
+
if (videoEl.seekable.length > 0) {
|
34
|
+
return videoEl.seekable.end(0);
|
35
|
+
}
|
36
|
+
return 0;
|
37
|
+
}
|
@@ -15,7 +15,7 @@ export const RoomDetailsPane = () => {
|
|
15
15
|
const { description } = useRoomLayoutHeader();
|
16
16
|
const isMwebHLSStream = useMobileHLSStream();
|
17
17
|
return (
|
18
|
-
<Box css={{ flex: '1 1 0' }}>
|
18
|
+
<Box css={{ flex: '1 1 0', position: 'relative' }}>
|
19
19
|
{isMwebHLSStream ? (
|
20
20
|
<Flex direction="row" align="center" gap="2">
|
21
21
|
<Logo />
|
@@ -41,7 +41,7 @@ const ShowRoomDetailHeader = () => {
|
|
41
41
|
const toggleDetailsPane = useSidepaneToggle(SIDE_PANE_OPTIONS.ROOM_DETAILS);
|
42
42
|
const isMwebHLSStream = useMobileHLSStream();
|
43
43
|
return (
|
44
|
-
<Flex direction="column">
|
44
|
+
<Flex direction="column" css={{ position: 'sticky', top: 0, bg: '$surface_dim' }}>
|
45
45
|
<Flex justify="between" align="center" css={{ w: '100%' }}>
|
46
46
|
<Text variant="h6">{title}</Text>
|
47
47
|
{!isMwebHLSStream && (
|
@@ -162,7 +162,7 @@ const SidePane = ({
|
|
162
162
|
mobileStream: isMobileHLSStream,
|
163
163
|
hideControls,
|
164
164
|
overlayChat: !!elements?.chat?.is_overlay,
|
165
|
-
roomDescription:
|
165
|
+
roomDescription: sidepane === SIDE_PANE_OPTIONS.ROOM_DETAILS,
|
166
166
|
virtualBackground: sidepane === SIDE_PANE_OPTIONS.VB,
|
167
167
|
};
|
168
168
|
|