@100mslive/react-native-hms 1.9.11 → 1.10.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/android/src/main/java/com/reactnativehmssdk/HMSHLSPlayer.kt +0 -15
- package/android/src/main/java/com/reactnativehmssdk/HMSManager.kt +38 -0
- package/android/src/main/java/com/reactnativehmssdk/HMSRNSDK.kt +38 -0
- package/android/src/main/java/com/reactnativehmssdk/Interactivity/HMSInteractivityDecoder.kt +87 -2
- package/android/src/main/java/com/reactnativehmssdk/Interactivity/HMSInteractivityHelper.kt +1 -1
- package/android/src/main/java/com/reactnativehmssdk/Interactivity/HMSRNInteractivityCenter.kt +39 -61
- package/ios/HMSInteractivityDecoder.swift +50 -0
- package/ios/HMSManager.m +9 -0
- package/ios/HMSManager.swift +19 -1
- package/ios/HMSRNInteractivityCenter.swift +31 -0
- package/ios/HMSRNSDK.swift +34 -0
- package/lib/commonjs/classes/HMSHLSTimedMetadata.js +2 -0
- package/lib/commonjs/classes/HMSHLSTimedMetadata.js.map +1 -0
- package/lib/commonjs/classes/HMSInteractivityCenter.js +21 -0
- package/lib/commonjs/classes/HMSInteractivityCenter.js.map +1 -1
- package/lib/commonjs/classes/HMSInteractivityEncoder.js +46 -2
- package/lib/commonjs/classes/HMSInteractivityEncoder.js.map +1 -1
- package/lib/commonjs/classes/HMSSDK.js +13 -0
- package/lib/commonjs/classes/HMSSDK.js.map +1 -1
- package/lib/commonjs/classes/polls/DecodedPollLeaderboardResponse.js +6 -0
- package/lib/commonjs/classes/polls/DecodedPollLeaderboardResponse.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPoll.js.map +1 -1
- package/lib/commonjs/classes/polls/HMSPollCreateParams.js.map +1 -1
- package/lib/commonjs/classes/polls/HMSPollLeaderboardEntry.js +6 -0
- package/lib/commonjs/classes/polls/HMSPollLeaderboardEntry.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollLeaderboardSummary.js +2 -0
- package/lib/commonjs/classes/polls/HMSPollLeaderboardSummary.js.map +1 -0
- package/lib/commonjs/classes/polls/PollLeaderboardResponse.js +6 -0
- package/lib/commonjs/classes/polls/PollLeaderboardResponse.js.map +1 -0
- package/lib/commonjs/components/HMSHLSPlayer/HMSHLSPlayer.js +2 -10
- package/lib/commonjs/components/HMSHLSPlayer/HMSHLSPlayer.js.map +1 -1
- package/lib/commonjs/index.js +40 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/classes/HMSHLSTimedMetadata.js +2 -0
- package/lib/module/classes/HMSHLSTimedMetadata.js.map +1 -0
- package/lib/module/classes/HMSInteractivityCenter.js +21 -0
- package/lib/module/classes/HMSInteractivityCenter.js.map +1 -1
- package/lib/module/classes/HMSInteractivityEncoder.js +46 -2
- package/lib/module/classes/HMSInteractivityEncoder.js.map +1 -1
- package/lib/module/classes/HMSSDK.js +13 -0
- package/lib/module/classes/HMSSDK.js.map +1 -1
- package/lib/module/classes/polls/DecodedPollLeaderboardResponse.js +2 -0
- package/lib/module/classes/polls/DecodedPollLeaderboardResponse.js.map +1 -0
- package/lib/module/classes/polls/HMSPoll.js.map +1 -1
- package/lib/module/classes/polls/HMSPollCreateParams.js.map +1 -1
- package/lib/module/classes/polls/HMSPollLeaderboardEntry.js +2 -0
- package/lib/module/classes/polls/HMSPollLeaderboardEntry.js.map +1 -0
- package/lib/module/classes/polls/HMSPollLeaderboardSummary.js +2 -0
- package/lib/module/classes/polls/HMSPollLeaderboardSummary.js.map +1 -0
- package/lib/module/classes/polls/PollLeaderboardResponse.js +2 -0
- package/lib/module/classes/polls/PollLeaderboardResponse.js.map +1 -0
- package/lib/module/components/HMSHLSPlayer/HMSHLSPlayer.js +3 -11
- package/lib/module/components/HMSHLSPlayer/HMSHLSPlayer.js.map +1 -1
- package/lib/module/index.js +5 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/classes/HMSHLSTimedMetadata.d.ts +4 -0
- package/lib/typescript/classes/HMSInteractivityCenter.d.ts +10 -0
- package/lib/typescript/classes/HMSInteractivityEncoder.d.ts +3 -0
- package/lib/typescript/classes/HMSSDK.d.ts +7 -0
- package/lib/typescript/classes/polls/DecodedPollLeaderboardResponse.d.ts +37 -0
- package/lib/typescript/classes/polls/HMSPoll.d.ts +5 -13
- package/lib/typescript/classes/polls/HMSPollCreateParams.d.ts +1 -4
- package/lib/typescript/classes/polls/HMSPollLeaderboardEntry.d.ts +9 -0
- package/lib/typescript/classes/polls/HMSPollLeaderboardSummary.d.ts +7 -0
- package/lib/typescript/classes/polls/PollLeaderboardResponse.d.ts +7 -0
- package/lib/typescript/index.d.ts +5 -0
- package/package.json +1 -1
- package/sdk-versions.json +2 -2
- package/src/classes/HMSHLSTimedMetadata.ts +4 -0
- package/src/classes/HMSInteractivityCenter.ts +30 -0
- package/src/classes/HMSInteractivityEncoder.ts +57 -2
- package/src/classes/HMSSDK.tsx +14 -0
- package/src/classes/polls/DecodedPollLeaderboardResponse.ts +43 -0
- package/src/classes/polls/HMSPoll.ts +5 -14
- package/src/classes/polls/HMSPollCreateParams.ts +2 -3
- package/src/classes/polls/HMSPollLeaderboardEntry.ts +10 -0
- package/src/classes/polls/HMSPollLeaderboardSummary.ts +7 -0
- package/src/classes/polls/PollLeaderboardResponse.ts +8 -0
- package/src/components/HMSHLSPlayer/HMSHLSPlayer.tsx +3 -14
- package/src/index.ts +5 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { HMSPollLeaderboardEntry } from './HMSPollLeaderboardEntry';
|
|
2
|
+
import type { HMSPollLeaderboardSummary } from './HMSPollLeaderboardSummary';
|
|
3
|
+
import type { PollLeaderboardResponse } from './PollLeaderboardResponse';
|
|
4
|
+
|
|
5
|
+
type NumberString = string;
|
|
6
|
+
|
|
7
|
+
export interface DecodedPollLeaderboardResponse
|
|
8
|
+
extends Pick<PollLeaderboardResponse, 'hasNext'> {
|
|
9
|
+
entries?: DecodedHMSPollLeaderboardEntry[];
|
|
10
|
+
summary?: DecodedHMSPollLeaderboardSummary;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface DecodedHMSPollLeaderboardEntry
|
|
14
|
+
extends Pick<HMSPollLeaderboardEntry, 'peer'> {
|
|
15
|
+
/**
|
|
16
|
+
* convert this value to number
|
|
17
|
+
*/
|
|
18
|
+
duration?: NumberString | number;
|
|
19
|
+
/**
|
|
20
|
+
* convert this value to number
|
|
21
|
+
*/
|
|
22
|
+
totalResponses?: NumberString | number;
|
|
23
|
+
/**
|
|
24
|
+
* convert this value to number
|
|
25
|
+
*/
|
|
26
|
+
correctResponses?: NumberString | number;
|
|
27
|
+
/**
|
|
28
|
+
* convert this value to number
|
|
29
|
+
*/
|
|
30
|
+
position?: NumberString | number;
|
|
31
|
+
/**
|
|
32
|
+
* convert this value to number
|
|
33
|
+
*/
|
|
34
|
+
score?: NumberString | number;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface DecodedHMSPollLeaderboardSummary
|
|
38
|
+
extends Omit<HMSPollLeaderboardSummary, 'averageTime'> {
|
|
39
|
+
/**
|
|
40
|
+
* convert this value to number
|
|
41
|
+
*/
|
|
42
|
+
averageTime?: NumberString | number;
|
|
43
|
+
}
|
|
@@ -6,15 +6,6 @@ import type { HMSPollUserTrackingMode } from './HMSPollUserTrackingMode';
|
|
|
6
6
|
import type { HMSPollType } from './HMSPollType';
|
|
7
7
|
import type { HMSPeer } from '../HMSPeer';
|
|
8
8
|
|
|
9
|
-
type HMSPeerSubset = {
|
|
10
|
-
peerID: HMSPeer['peerID'];
|
|
11
|
-
name: HMSPeer['name'];
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
type HMSRoleSubset = {
|
|
15
|
-
name: HMSRole['name'];
|
|
16
|
-
};
|
|
17
|
-
|
|
18
9
|
export interface HMSPoll {
|
|
19
10
|
/**
|
|
20
11
|
The unique identifier of the poll.
|
|
@@ -44,27 +35,27 @@ export interface HMSPoll {
|
|
|
44
35
|
/**
|
|
45
36
|
The roles that can vote in the poll.
|
|
46
37
|
*/
|
|
47
|
-
rolesThatCanVote?:
|
|
38
|
+
rolesThatCanVote?: HMSRole[];
|
|
48
39
|
|
|
49
40
|
/**
|
|
50
41
|
The roles that can view the poll responses.
|
|
51
42
|
*/
|
|
52
|
-
rolesThatCanViewResponses?:
|
|
43
|
+
rolesThatCanViewResponses?: HMSRole[];
|
|
53
44
|
|
|
54
45
|
/**
|
|
55
46
|
The peer who started the poll.
|
|
56
47
|
*/
|
|
57
|
-
startedBy?:
|
|
48
|
+
startedBy?: HMSPeer;
|
|
58
49
|
|
|
59
50
|
/**
|
|
60
51
|
The peer who stopped the poll.
|
|
61
52
|
*/
|
|
62
|
-
stoppedBy?:
|
|
53
|
+
stoppedBy?: HMSPeer;
|
|
63
54
|
|
|
64
55
|
/**
|
|
65
56
|
The peer who created the poll.
|
|
66
57
|
*/
|
|
67
|
-
createdBy?:
|
|
58
|
+
createdBy?: HMSPeer;
|
|
68
59
|
|
|
69
60
|
/**
|
|
70
61
|
The date and time when the poll was started.
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { HMSRole } from '../HMSRole';
|
|
2
1
|
import type { HMSPoll } from './HMSPoll';
|
|
3
2
|
import type { HMSPollQuestionCreateParams } from './HMSPollQuestionCreateParams';
|
|
4
3
|
|
|
@@ -12,9 +11,9 @@ export interface HMSPollCreateParams
|
|
|
12
11
|
// | 'visibility'
|
|
13
12
|
// | 'locked'
|
|
14
13
|
| 'mode'
|
|
14
|
+
| 'rolesThatCanVote'
|
|
15
|
+
| 'rolesThatCanViewResponses'
|
|
15
16
|
> {
|
|
16
17
|
pollId?: HMSPoll['pollId'];
|
|
17
18
|
questions?: HMSPollQuestionCreateParams[];
|
|
18
|
-
rolesThatCanVote?: HMSRole[];
|
|
19
|
-
rolesThatCanViewResponses?: HMSRole[];
|
|
20
19
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HMSPollResponsePeerInfo } from './HMSPollResponsePeerInfo';
|
|
2
|
+
|
|
3
|
+
export interface HMSPollLeaderboardEntry {
|
|
4
|
+
duration?: number;
|
|
5
|
+
totalResponses?: number;
|
|
6
|
+
correctResponses?: number;
|
|
7
|
+
position?: number;
|
|
8
|
+
score?: number;
|
|
9
|
+
peer?: HMSPollResponsePeerInfo;
|
|
10
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { HMSPollLeaderboardEntry } from './HMSPollLeaderboardEntry';
|
|
2
|
+
import type { HMSPollLeaderboardSummary } from './HMSPollLeaderboardSummary';
|
|
3
|
+
|
|
4
|
+
export interface PollLeaderboardResponse {
|
|
5
|
+
entries?: HMSPollLeaderboardEntry[];
|
|
6
|
+
hasNext?: boolean;
|
|
7
|
+
summary?: HMSPollLeaderboardSummary;
|
|
8
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useImperativeHandle, useRef
|
|
1
|
+
import React, { useImperativeHandle, useRef } from 'react';
|
|
2
2
|
import { View, StyleSheet, UIManager, findNodeHandle } from 'react-native';
|
|
3
3
|
import type { StyleProp, ViewStyle } from 'react-native';
|
|
4
4
|
|
|
@@ -56,8 +56,6 @@ const _HMSHLSPlayer: React.ForwardRefRenderFunction<
|
|
|
56
56
|
) => {
|
|
57
57
|
const hmsHlsPlayerRef = useRef<RCTHMSHLSPlayerRef | null>(null);
|
|
58
58
|
|
|
59
|
-
const [aspectRatio, setAspectRatio] = useState(16 / 9);
|
|
60
|
-
|
|
61
59
|
useImperativeHandle(
|
|
62
60
|
ref,
|
|
63
61
|
() => ({
|
|
@@ -204,12 +202,6 @@ const _HMSHLSPlayer: React.ForwardRefRenderFunction<
|
|
|
204
202
|
HMSHLSPlayerPlaybackEventTypes.ON_PLAYBACK_RESOLUTION_CHANGE_EVENT
|
|
205
203
|
) {
|
|
206
204
|
setHMSHLSPlayerResolution({ ...data });
|
|
207
|
-
|
|
208
|
-
const aspectRatio = data.width / data.height;
|
|
209
|
-
|
|
210
|
-
if (typeof aspectRatio === 'number' && !isNaN(aspectRatio)) {
|
|
211
|
-
setAspectRatio(aspectRatio);
|
|
212
|
-
}
|
|
213
205
|
} else {
|
|
214
206
|
setHMSHLSPlayerPlaybackState(data.state);
|
|
215
207
|
}
|
|
@@ -232,10 +224,7 @@ const _HMSHLSPlayer: React.ForwardRefRenderFunction<
|
|
|
232
224
|
<RCTHMSHLSPlayer
|
|
233
225
|
ref={hmsHlsPlayerRef}
|
|
234
226
|
url={url}
|
|
235
|
-
style={
|
|
236
|
-
styles.player,
|
|
237
|
-
{ aspectRatio: aspectRatio, flex: aspectRatio < 1 ? 1 : undefined },
|
|
238
|
-
]}
|
|
227
|
+
style={styles.player}
|
|
239
228
|
enableStats={enableStats}
|
|
240
229
|
enableControls={enableControls}
|
|
241
230
|
onHmsHlsPlaybackEvent={handleHLSPlaybackEvent}
|
|
@@ -264,7 +253,7 @@ const styles = StyleSheet.create({
|
|
|
264
253
|
},
|
|
265
254
|
player: {
|
|
266
255
|
width: '100%',
|
|
267
|
-
|
|
256
|
+
height: '100%',
|
|
268
257
|
flex: 1,
|
|
269
258
|
},
|
|
270
259
|
});
|
package/src/index.ts
CHANGED
|
@@ -104,6 +104,11 @@ export { HMSPollUpdateType } from './classes/polls/HMSPollUpdateType';
|
|
|
104
104
|
export { HMSPollState } from './classes/polls/HMSPollState';
|
|
105
105
|
export { HMSPollQuestion } from './classes/polls/HMSPollQuestion';
|
|
106
106
|
export { HMSPollQuestionOption } from './classes/polls/HMSPollQuestionOption';
|
|
107
|
+
export { HMSPollQuestionAnswer } from './classes/polls/HMSPollQuestionAnswer';
|
|
108
|
+
export { HMSPollQuestionResponse } from './classes/polls/HMSPollQuestionResponse';
|
|
109
|
+
export { PollLeaderboardResponse } from './classes/polls/PollLeaderboardResponse';
|
|
110
|
+
export { HMSPollLeaderboardEntry } from './classes/polls/HMSPollLeaderboardEntry';
|
|
111
|
+
export { HMSPollLeaderboardSummary } from './classes/polls/HMSPollLeaderboardSummary';
|
|
107
112
|
|
|
108
113
|
import { HMSSDK as HmsManager } from './classes/HMSSDK';
|
|
109
114
|
|