@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.
Files changed (80) hide show
  1. package/android/src/main/java/com/reactnativehmssdk/HMSHLSPlayer.kt +0 -15
  2. package/android/src/main/java/com/reactnativehmssdk/HMSManager.kt +38 -0
  3. package/android/src/main/java/com/reactnativehmssdk/HMSRNSDK.kt +38 -0
  4. package/android/src/main/java/com/reactnativehmssdk/Interactivity/HMSInteractivityDecoder.kt +87 -2
  5. package/android/src/main/java/com/reactnativehmssdk/Interactivity/HMSInteractivityHelper.kt +1 -1
  6. package/android/src/main/java/com/reactnativehmssdk/Interactivity/HMSRNInteractivityCenter.kt +39 -61
  7. package/ios/HMSInteractivityDecoder.swift +50 -0
  8. package/ios/HMSManager.m +9 -0
  9. package/ios/HMSManager.swift +19 -1
  10. package/ios/HMSRNInteractivityCenter.swift +31 -0
  11. package/ios/HMSRNSDK.swift +34 -0
  12. package/lib/commonjs/classes/HMSHLSTimedMetadata.js +2 -0
  13. package/lib/commonjs/classes/HMSHLSTimedMetadata.js.map +1 -0
  14. package/lib/commonjs/classes/HMSInteractivityCenter.js +21 -0
  15. package/lib/commonjs/classes/HMSInteractivityCenter.js.map +1 -1
  16. package/lib/commonjs/classes/HMSInteractivityEncoder.js +46 -2
  17. package/lib/commonjs/classes/HMSInteractivityEncoder.js.map +1 -1
  18. package/lib/commonjs/classes/HMSSDK.js +13 -0
  19. package/lib/commonjs/classes/HMSSDK.js.map +1 -1
  20. package/lib/commonjs/classes/polls/DecodedPollLeaderboardResponse.js +6 -0
  21. package/lib/commonjs/classes/polls/DecodedPollLeaderboardResponse.js.map +1 -0
  22. package/lib/commonjs/classes/polls/HMSPoll.js.map +1 -1
  23. package/lib/commonjs/classes/polls/HMSPollCreateParams.js.map +1 -1
  24. package/lib/commonjs/classes/polls/HMSPollLeaderboardEntry.js +6 -0
  25. package/lib/commonjs/classes/polls/HMSPollLeaderboardEntry.js.map +1 -0
  26. package/lib/commonjs/classes/polls/HMSPollLeaderboardSummary.js +2 -0
  27. package/lib/commonjs/classes/polls/HMSPollLeaderboardSummary.js.map +1 -0
  28. package/lib/commonjs/classes/polls/PollLeaderboardResponse.js +6 -0
  29. package/lib/commonjs/classes/polls/PollLeaderboardResponse.js.map +1 -0
  30. package/lib/commonjs/components/HMSHLSPlayer/HMSHLSPlayer.js +2 -10
  31. package/lib/commonjs/components/HMSHLSPlayer/HMSHLSPlayer.js.map +1 -1
  32. package/lib/commonjs/index.js +40 -0
  33. package/lib/commonjs/index.js.map +1 -1
  34. package/lib/module/classes/HMSHLSTimedMetadata.js +2 -0
  35. package/lib/module/classes/HMSHLSTimedMetadata.js.map +1 -0
  36. package/lib/module/classes/HMSInteractivityCenter.js +21 -0
  37. package/lib/module/classes/HMSInteractivityCenter.js.map +1 -1
  38. package/lib/module/classes/HMSInteractivityEncoder.js +46 -2
  39. package/lib/module/classes/HMSInteractivityEncoder.js.map +1 -1
  40. package/lib/module/classes/HMSSDK.js +13 -0
  41. package/lib/module/classes/HMSSDK.js.map +1 -1
  42. package/lib/module/classes/polls/DecodedPollLeaderboardResponse.js +2 -0
  43. package/lib/module/classes/polls/DecodedPollLeaderboardResponse.js.map +1 -0
  44. package/lib/module/classes/polls/HMSPoll.js.map +1 -1
  45. package/lib/module/classes/polls/HMSPollCreateParams.js.map +1 -1
  46. package/lib/module/classes/polls/HMSPollLeaderboardEntry.js +2 -0
  47. package/lib/module/classes/polls/HMSPollLeaderboardEntry.js.map +1 -0
  48. package/lib/module/classes/polls/HMSPollLeaderboardSummary.js +2 -0
  49. package/lib/module/classes/polls/HMSPollLeaderboardSummary.js.map +1 -0
  50. package/lib/module/classes/polls/PollLeaderboardResponse.js +2 -0
  51. package/lib/module/classes/polls/PollLeaderboardResponse.js.map +1 -0
  52. package/lib/module/components/HMSHLSPlayer/HMSHLSPlayer.js +3 -11
  53. package/lib/module/components/HMSHLSPlayer/HMSHLSPlayer.js.map +1 -1
  54. package/lib/module/index.js +5 -0
  55. package/lib/module/index.js.map +1 -1
  56. package/lib/typescript/classes/HMSHLSTimedMetadata.d.ts +4 -0
  57. package/lib/typescript/classes/HMSInteractivityCenter.d.ts +10 -0
  58. package/lib/typescript/classes/HMSInteractivityEncoder.d.ts +3 -0
  59. package/lib/typescript/classes/HMSSDK.d.ts +7 -0
  60. package/lib/typescript/classes/polls/DecodedPollLeaderboardResponse.d.ts +37 -0
  61. package/lib/typescript/classes/polls/HMSPoll.d.ts +5 -13
  62. package/lib/typescript/classes/polls/HMSPollCreateParams.d.ts +1 -4
  63. package/lib/typescript/classes/polls/HMSPollLeaderboardEntry.d.ts +9 -0
  64. package/lib/typescript/classes/polls/HMSPollLeaderboardSummary.d.ts +7 -0
  65. package/lib/typescript/classes/polls/PollLeaderboardResponse.d.ts +7 -0
  66. package/lib/typescript/index.d.ts +5 -0
  67. package/package.json +1 -1
  68. package/sdk-versions.json +2 -2
  69. package/src/classes/HMSHLSTimedMetadata.ts +4 -0
  70. package/src/classes/HMSInteractivityCenter.ts +30 -0
  71. package/src/classes/HMSInteractivityEncoder.ts +57 -2
  72. package/src/classes/HMSSDK.tsx +14 -0
  73. package/src/classes/polls/DecodedPollLeaderboardResponse.ts +43 -0
  74. package/src/classes/polls/HMSPoll.ts +5 -14
  75. package/src/classes/polls/HMSPollCreateParams.ts +2 -3
  76. package/src/classes/polls/HMSPollLeaderboardEntry.ts +10 -0
  77. package/src/classes/polls/HMSPollLeaderboardSummary.ts +7 -0
  78. package/src/classes/polls/PollLeaderboardResponse.ts +8 -0
  79. package/src/components/HMSHLSPlayer/HMSHLSPlayer.tsx +3 -14
  80. package/src/index.ts +5 -0
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=DecodedPollLeaderboardResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["DecodedPollLeaderboardResponse.ts"],"sourcesContent":["import type { HMSPollLeaderboardEntry } from './HMSPollLeaderboardEntry';\nimport type { HMSPollLeaderboardSummary } from './HMSPollLeaderboardSummary';\nimport type { PollLeaderboardResponse } from './PollLeaderboardResponse';\n\ntype NumberString = string;\n\nexport interface DecodedPollLeaderboardResponse\n extends Pick<PollLeaderboardResponse, 'hasNext'> {\n entries?: DecodedHMSPollLeaderboardEntry[];\n summary?: DecodedHMSPollLeaderboardSummary;\n}\n\nexport interface DecodedHMSPollLeaderboardEntry\n extends Pick<HMSPollLeaderboardEntry, 'peer'> {\n /**\n * convert this value to number\n */\n duration?: NumberString | number;\n /**\n * convert this value to number\n */\n totalResponses?: NumberString | number;\n /**\n * convert this value to number\n */\n correctResponses?: NumberString | number;\n /**\n * convert this value to number\n */\n position?: NumberString | number;\n /**\n * convert this value to number\n */\n score?: NumberString | number;\n}\n\nexport interface DecodedHMSPollLeaderboardSummary\n extends Omit<HMSPollLeaderboardSummary, 'averageTime'> {\n /**\n * convert this value to number\n */\n averageTime?: NumberString | number;\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["HMSPoll.ts"],"sourcesContent":["import type { HMSPollState } from './HMSPollState';\nimport type { HMSPollQuestion } from './HMSPollQuestion';\nimport type { HMSPollResult } from './HMSPollResult';\nimport type { HMSRole } from '../HMSRole';\nimport type { HMSPollUserTrackingMode } from './HMSPollUserTrackingMode';\nimport type { HMSPollType } from './HMSPollType';\nimport type { HMSPeer } from '../HMSPeer';\n\ntype HMSPeerSubset = {\n peerID: HMSPeer['peerID'];\n name: HMSPeer['name'];\n};\n\ntype HMSRoleSubset = {\n name: HMSRole['name'];\n};\n\nexport interface HMSPoll {\n /**\n The unique identifier of the poll.\n */\n pollId: string;\n\n /**\n The title of the poll.\n */\n title: string;\n\n /**\n The duration of the poll in seconds.\n */\n duration?: number;\n\n /**\n A flag indicating whether the poll is anonymous or not.\n */\n anonymous?: boolean;\n\n /**\n The tracking mode for user participation in the poll.\n */\n mode?: HMSPollUserTrackingMode;\n\n /**\n The roles that can vote in the poll.\n */\n rolesThatCanVote?: HMSRoleSubset[];\n\n /**\n The roles that can view the poll responses.\n */\n rolesThatCanViewResponses?: HMSRoleSubset[];\n\n /**\n The peer who started the poll.\n */\n startedBy?: HMSPeerSubset;\n\n /**\n The peer who stopped the poll.\n */\n stoppedBy?: HMSPeerSubset;\n\n /**\n The peer who created the poll.\n */\n createdBy?: HMSPeerSubset;\n\n /**\n The date and time when the poll was started.\n */\n startedAt?: Date;\n\n /**\n The date and time when the poll was stopped.\n */\n stoppedAt?: Date;\n\n /**\n The type of the poll.\n */\n type: HMSPollType;\n\n /**\n The current state of the poll.\n */\n state?: HMSPollState;\n\n /**\n The list of questions in the poll.\n */\n questions?: HMSPollQuestion[];\n\n /**\n The result of the poll.\n */\n result?: HMSPollResult;\n\n // /**\n // The visiblity of the poll. (Not available on iOS)\n // */\n // visibility?: boolean;\n\n // /**\n // * Is poll locked currently? (Not available on iOS)\n // */\n // locked?: boolean;\n}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["HMSPoll.ts"],"sourcesContent":["import type { HMSPollState } from './HMSPollState';\nimport type { HMSPollQuestion } from './HMSPollQuestion';\nimport type { HMSPollResult } from './HMSPollResult';\nimport type { HMSRole } from '../HMSRole';\nimport type { HMSPollUserTrackingMode } from './HMSPollUserTrackingMode';\nimport type { HMSPollType } from './HMSPollType';\nimport type { HMSPeer } from '../HMSPeer';\n\nexport interface HMSPoll {\n /**\n The unique identifier of the poll.\n */\n pollId: string;\n\n /**\n The title of the poll.\n */\n title: string;\n\n /**\n The duration of the poll in seconds.\n */\n duration?: number;\n\n /**\n A flag indicating whether the poll is anonymous or not.\n */\n anonymous?: boolean;\n\n /**\n The tracking mode for user participation in the poll.\n */\n mode?: HMSPollUserTrackingMode;\n\n /**\n The roles that can vote in the poll.\n */\n rolesThatCanVote?: HMSRole[];\n\n /**\n The roles that can view the poll responses.\n */\n rolesThatCanViewResponses?: HMSRole[];\n\n /**\n The peer who started the poll.\n */\n startedBy?: HMSPeer;\n\n /**\n The peer who stopped the poll.\n */\n stoppedBy?: HMSPeer;\n\n /**\n The peer who created the poll.\n */\n createdBy?: HMSPeer;\n\n /**\n The date and time when the poll was started.\n */\n startedAt?: Date;\n\n /**\n The date and time when the poll was stopped.\n */\n stoppedAt?: Date;\n\n /**\n The type of the poll.\n */\n type: HMSPollType;\n\n /**\n The current state of the poll.\n */\n state?: HMSPollState;\n\n /**\n The list of questions in the poll.\n */\n questions?: HMSPollQuestion[];\n\n /**\n The result of the poll.\n */\n result?: HMSPollResult;\n\n // /**\n // The visiblity of the poll. (Not available on iOS)\n // */\n // visibility?: boolean;\n\n // /**\n // * Is poll locked currently? (Not available on iOS)\n // */\n // locked?: boolean;\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["HMSPollCreateParams.ts"],"sourcesContent":["import type { HMSRole } from '../HMSRole';\nimport type { HMSPoll } from './HMSPoll';\nimport type { HMSPollQuestionCreateParams } from './HMSPollQuestionCreateParams';\n\nexport interface HMSPollCreateParams\n extends Pick<\n HMSPoll,\n | 'title'\n | 'type'\n | 'duration'\n | 'anonymous'\n // | 'visibility'\n // | 'locked'\n | 'mode'\n > {\n pollId?: HMSPoll['pollId'];\n questions?: HMSPollQuestionCreateParams[];\n rolesThatCanVote?: HMSRole[];\n rolesThatCanViewResponses?: HMSRole[];\n}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["HMSPollCreateParams.ts"],"sourcesContent":["import type { HMSPoll } from './HMSPoll';\nimport type { HMSPollQuestionCreateParams } from './HMSPollQuestionCreateParams';\n\nexport interface HMSPollCreateParams\n extends Pick<\n HMSPoll,\n | 'title'\n | 'type'\n | 'duration'\n | 'anonymous'\n // | 'visibility'\n // | 'locked'\n | 'mode'\n | 'rolesThatCanVote'\n | 'rolesThatCanViewResponses'\n > {\n pollId?: HMSPoll['pollId'];\n questions?: HMSPollQuestionCreateParams[];\n}\n"],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=HMSPollLeaderboardEntry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["HMSPollLeaderboardEntry.ts"],"sourcesContent":["import type { HMSPollResponsePeerInfo } from './HMSPollResponsePeerInfo';\n\nexport interface HMSPollLeaderboardEntry {\n duration?: number;\n totalResponses?: number;\n correctResponses?: number;\n position?: number;\n score?: number;\n peer?: HMSPollResponsePeerInfo;\n}\n"],"mappings":""}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=HMSPollLeaderboardSummary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["HMSPollLeaderboardSummary.ts"],"sourcesContent":["export interface HMSPollLeaderboardSummary {\n averageScore?: number;\n averageTime?: number;\n respondedCorrectlyPeersCount?: number;\n respondedPeersCount?: number;\n totalPeersCount?: number;\n}\n"],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=PollLeaderboardResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["PollLeaderboardResponse.ts"],"sourcesContent":["import type { HMSPollLeaderboardEntry } from './HMSPollLeaderboardEntry';\nimport type { HMSPollLeaderboardSummary } from './HMSPollLeaderboardSummary';\n\nexport interface PollLeaderboardResponse {\n entries?: HMSPollLeaderboardEntry[];\n hasNext?: boolean;\n summary?: HMSPollLeaderboardSummary;\n}\n"],"mappings":""}
@@ -1,4 +1,4 @@
1
- import React, { useImperativeHandle, useRef, useState } from 'react';
1
+ import React, { useImperativeHandle, useRef } from 'react';
2
2
  import { View, StyleSheet, UIManager, findNodeHandle } from 'react-native';
3
3
  import { setHMSHLSPlayerCue, setHMSHLSPlayerPlaybackError, setHMSHLSPlayerPlaybackState, setHMSHLSPlayerResolution, setHMSHLSPlayerStats, setHMSHLSPlayerStatsError } from './hooks';
4
4
  import { RCTHMSHLSPlayer, RCTHMSHLSPlayerViewManagerConfig } from './RCTHMSHLSPlayer';
@@ -12,7 +12,6 @@ const _HMSHLSPlayer = ({
12
12
  enableControls = false
13
13
  }, ref) => {
14
14
  const hmsHlsPlayerRef = useRef(null);
15
- const [aspectRatio, setAspectRatio] = useState(16 / 9);
16
15
  useImperativeHandle(ref, () => ({
17
16
  play: url => {
18
17
  if (hmsHlsPlayerRef.current && RCTHMSHLSPlayerViewManagerConfig.Commands.play) {
@@ -82,10 +81,6 @@ const _HMSHLSPlayer = ({
82
81
  setHMSHLSPlayerResolution({
83
82
  ...data
84
83
  });
85
- const aspectRatio = data.width / data.height;
86
- if (typeof aspectRatio === 'number' && !isNaN(aspectRatio)) {
87
- setAspectRatio(aspectRatio);
88
- }
89
84
  } else {
90
85
  setHMSHLSPlayerPlaybackState(data.state);
91
86
  }
@@ -112,10 +107,7 @@ const _HMSHLSPlayer = ({
112
107
  }, /*#__PURE__*/React.createElement(RCTHMSHLSPlayer, {
113
108
  ref: hmsHlsPlayerRef,
114
109
  url: url,
115
- style: [styles.player, {
116
- aspectRatio: aspectRatio,
117
- flex: aspectRatio < 1 ? 1 : undefined
118
- }],
110
+ style: styles.player,
119
111
  enableStats: enableStats,
120
112
  enableControls: enableControls,
121
113
  onHmsHlsPlaybackEvent: handleHLSPlaybackEvent,
@@ -136,7 +128,7 @@ const styles = StyleSheet.create({
136
128
  },
137
129
  player: {
138
130
  width: '100%',
139
- aspectRatio: 16 / 9,
131
+ height: '100%',
140
132
  flex: 1
141
133
  }
142
134
  });
@@ -1 +1 @@
1
- {"version":3,"names":["React","useImperativeHandle","useRef","useState","View","StyleSheet","UIManager","findNodeHandle","setHMSHLSPlayerCue","setHMSHLSPlayerPlaybackError","setHMSHLSPlayerPlaybackState","setHMSHLSPlayerResolution","setHMSHLSPlayerStats","setHMSHLSPlayerStatsError","RCTHMSHLSPlayer","RCTHMSHLSPlayerViewManagerConfig","HMSHLSPlayerPlaybackEventTypes","HMSHLSPlayerStatsEventTypes","HMSEncoder","_HMSHLSPlayer","url","style","containerStyle","enableStats","enableControls","ref","hmsHlsPlayerRef","aspectRatio","setAspectRatio","play","current","Commands","dispatchViewManagerCommand","stop","undefined","pause","resume","seekForward","seconds","Error","seekBackward","seekToLivePosition","setVolume","level","handleHLSPlaybackEvent","nativeEvent","event","data","ON_PLAYBACK_CUE_EVENT","transformedData","transformHMSHLSCueEventData","ON_PLAYBACK_FAILURE_EVENT","error","ON_PLAYBACK_RESOLUTION_CHANGE_EVENT","width","height","isNaN","state","handleHLSStatsEvent","ON_STATS_EVENT_ERROR","createElement","styles","container","playerWrapper","player","flex","onHmsHlsPlaybackEvent","onHmsHlsStatsEvent","HMSHLSPlayer","forwardRef","create","alignItems","justifyContent","backgroundColor"],"sources":["HMSHLSPlayer.tsx"],"sourcesContent":["import React, { useImperativeHandle, useRef, useState } from 'react';\nimport { View, StyleSheet, UIManager, findNodeHandle } from 'react-native';\nimport type { StyleProp, ViewStyle } from 'react-native';\n\nimport {\n setHMSHLSPlayerCue,\n setHMSHLSPlayerPlaybackError,\n setHMSHLSPlayerPlaybackState,\n setHMSHLSPlayerResolution,\n setHMSHLSPlayerStats,\n setHMSHLSPlayerStatsError,\n} from './hooks';\nimport {\n RCTHMSHLSPlayer,\n RCTHMSHLSPlayerViewManagerConfig,\n} from './RCTHMSHLSPlayer';\nimport type {\n HmsHlsPlaybackEventHandler,\n HmsHlsStatsEventHandler,\n RCTHMSHLSPlayerRef,\n} from './RCTHMSHLSPlayer';\nimport {\n HMSHLSPlayerPlaybackEventTypes,\n HMSHLSPlayerStatsEventTypes,\n} from '../../types';\nimport type { HMSHLSPlayerPlaybackCueEventData } from '../../types';\nimport { HMSEncoder } from '../../classes/HMSEncoder';\nimport type { HMSHLSPlayerPlaybackCue } from '../../stores/types';\n\nexport interface HMSHLSPlayerProps {\n url?: string;\n style?: StyleProp<ViewStyle>;\n containerStyle?: StyleProp<ViewStyle>;\n aspectRatio?: number;\n enableStats?: boolean;\n enableControls?: boolean;\n}\n\nexport interface HMSHLSPlayerRefProperties {\n play: (url?: string) => void;\n stop: () => void;\n pause: () => void;\n resume: () => void;\n seekForward: (seconds: number) => void;\n seekBackward: (seconds: number) => void;\n seekToLivePosition: () => void;\n setVolume: (level: number) => void;\n}\n\nconst _HMSHLSPlayer: React.ForwardRefRenderFunction<\n HMSHLSPlayerRefProperties,\n HMSHLSPlayerProps\n> = (\n { url = '', style, containerStyle, enableStats, enableControls = false },\n ref\n) => {\n const hmsHlsPlayerRef = useRef<RCTHMSHLSPlayerRef | null>(null);\n\n const [aspectRatio, setAspectRatio] = useState(16 / 9);\n\n useImperativeHandle(\n ref,\n () => ({\n play: (url?: string) => {\n if (\n hmsHlsPlayerRef.current &&\n RCTHMSHLSPlayerViewManagerConfig.Commands.play\n ) {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(hmsHlsPlayerRef.current),\n RCTHMSHLSPlayerViewManagerConfig.Commands.play,\n url ? [url] : ['']\n );\n }\n },\n stop: () => {\n if (\n hmsHlsPlayerRef.current &&\n RCTHMSHLSPlayerViewManagerConfig.Commands.stop\n ) {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(hmsHlsPlayerRef.current),\n RCTHMSHLSPlayerViewManagerConfig.Commands.stop,\n undefined\n );\n }\n },\n pause: () => {\n if (\n hmsHlsPlayerRef.current &&\n RCTHMSHLSPlayerViewManagerConfig.Commands.pause\n ) {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(hmsHlsPlayerRef.current),\n RCTHMSHLSPlayerViewManagerConfig.Commands.pause,\n undefined\n );\n }\n },\n resume: () => {\n if (\n hmsHlsPlayerRef.current &&\n RCTHMSHLSPlayerViewManagerConfig.Commands.resume\n ) {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(hmsHlsPlayerRef.current),\n RCTHMSHLSPlayerViewManagerConfig.Commands.resume,\n undefined\n );\n }\n },\n seekForward: (seconds: number) => {\n if (typeof seconds !== 'number') {\n throw new Error(\n seconds\n ? 'seconds must be a `number` type'\n : 'seconds was not provided'\n );\n }\n\n if (\n hmsHlsPlayerRef.current &&\n RCTHMSHLSPlayerViewManagerConfig.Commands.seekForward\n ) {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(hmsHlsPlayerRef.current),\n RCTHMSHLSPlayerViewManagerConfig.Commands.seekForward,\n [seconds]\n );\n }\n },\n seekBackward: (seconds: number) => {\n if (typeof seconds !== 'number') {\n throw new Error(\n seconds\n ? 'seconds must be a `number` type'\n : 'seconds was not provided'\n );\n }\n\n if (\n hmsHlsPlayerRef.current &&\n RCTHMSHLSPlayerViewManagerConfig.Commands.seekBackward\n ) {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(hmsHlsPlayerRef.current),\n RCTHMSHLSPlayerViewManagerConfig.Commands.seekBackward,\n [seconds]\n );\n }\n },\n seekToLivePosition: () => {\n if (\n hmsHlsPlayerRef.current &&\n RCTHMSHLSPlayerViewManagerConfig.Commands.seekToLivePosition\n ) {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(hmsHlsPlayerRef.current),\n RCTHMSHLSPlayerViewManagerConfig.Commands.seekToLivePosition,\n undefined\n );\n }\n },\n setVolume: (level: number) => {\n if (typeof level !== 'number') {\n throw new Error(\n level ? 'level must be a `number` type' : 'level was not provided'\n );\n }\n\n if (\n hmsHlsPlayerRef.current &&\n RCTHMSHLSPlayerViewManagerConfig.Commands.setVolume\n ) {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(hmsHlsPlayerRef.current),\n RCTHMSHLSPlayerViewManagerConfig.Commands.setVolume,\n [level]\n );\n }\n },\n }),\n []\n );\n\n // Handle HLS Playback events\n const handleHLSPlaybackEvent: HmsHlsPlaybackEventHandler = ({\n nativeEvent,\n }) => {\n const { event, data } = nativeEvent;\n\n if (event === HMSHLSPlayerPlaybackEventTypes.ON_PLAYBACK_CUE_EVENT) {\n const transformedData = HMSEncoder.transformHMSHLSCueEventData<\n HMSHLSPlayerPlaybackCueEventData,\n HMSHLSPlayerPlaybackCue\n >(data);\n setHMSHLSPlayerCue(transformedData);\n } else if (\n event === HMSHLSPlayerPlaybackEventTypes.ON_PLAYBACK_FAILURE_EVENT\n ) {\n setHMSHLSPlayerPlaybackError(data.error);\n } else if (\n event ===\n HMSHLSPlayerPlaybackEventTypes.ON_PLAYBACK_RESOLUTION_CHANGE_EVENT\n ) {\n setHMSHLSPlayerResolution({ ...data });\n\n const aspectRatio = data.width / data.height;\n\n if (typeof aspectRatio === 'number' && !isNaN(aspectRatio)) {\n setAspectRatio(aspectRatio);\n }\n } else {\n setHMSHLSPlayerPlaybackState(data.state);\n }\n };\n\n // Handle HLS Stats events\n const handleHLSStatsEvent: HmsHlsStatsEventHandler = ({ nativeEvent }) => {\n const { event, data } = nativeEvent;\n\n if (event === HMSHLSPlayerStatsEventTypes.ON_STATS_EVENT_ERROR) {\n setHMSHLSPlayerStatsError(data);\n } else {\n setHMSHLSPlayerStats(data);\n }\n };\n\n return (\n <View style={[styles.container, containerStyle]}>\n <View style={[styles.playerWrapper, style]}>\n <RCTHMSHLSPlayer\n ref={hmsHlsPlayerRef}\n url={url}\n style={[\n styles.player,\n { aspectRatio: aspectRatio, flex: aspectRatio < 1 ? 1 : undefined },\n ]}\n enableStats={enableStats}\n enableControls={enableControls}\n onHmsHlsPlaybackEvent={handleHLSPlaybackEvent}\n onHmsHlsStatsEvent={handleHLSStatsEvent}\n />\n </View>\n </View>\n );\n};\n\nexport const HMSHLSPlayer = React.forwardRef<\n HMSHLSPlayerRefProperties,\n HMSHLSPlayerProps\n>(_HMSHLSPlayer);\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n },\n playerWrapper: {\n backgroundColor: '#000000',\n alignItems: 'center',\n justifyContent: 'center',\n },\n player: {\n width: '100%',\n aspectRatio: 16 / 9,\n flex: 1,\n },\n});\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,mBAAmB,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACpE,SAASC,IAAI,EAAEC,UAAU,EAAEC,SAAS,EAAEC,cAAc,QAAQ,cAAc;AA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U,CAG1ClD,aAAa,CAAC;AAEhB,MAAM0C,MAAM,GAAGxD,UAAU,CAACiE,MAAM,CAAC;EAC/BR,SAAS,EAAE;IACTG,IAAI,EAAE,CAAC;IACPM,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB,CAAC;EACDT,aAAa,EAAE;IACbU,eAAe,EAAE,SAAS;IAC1BF,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB,CAAC;EACDR,MAAM,EAAE;IACNV,KAAK,EAAE,MAAM;IACb3B,WAAW,EAAE,EAAE,GAAG,CAAC;IACnBsC,IAAI,EAAE;EACR;AACF,CAAC,CAAC"}
1
+ {"version":3,"names":["React","useImperativeHandle","useRef","View","StyleSheet","UIManager","findNodeHandle","setHMSHLSPlayerCue","setHMSHLSPlayerPlaybackError","setHMSHLSPlayerPlaybackState","setHMSHLSPlayerResolution","setHMSHLSPlayerStats","setHMSHLSPlayerStatsError","RCTHMSHLSPlayer","RCTHMSHLSPlayerViewManagerConfig","HMSHLSPlayerPlaybackEventTypes","HMSHLSPlayerStatsEventTypes","HMSEncoder","_HMSHLSPlayer","url","style","containerStyle","enableStats","enableControls","ref","hmsHlsPlayerRef","play","current","Commands","dispatchViewManagerCommand","stop","undefined","pause","resume","seekForward","seconds","Error","seekBackward","seekToLivePosition","setVolume","level","handleHLSPlaybackEvent","nativeEvent","event","data","ON_PLAYBACK_CUE_EVENT","transformedData","transformHMSHLSCueEventData","ON_PLAYBACK_FAILURE_EVENT","error","ON_PLAYBACK_RESOLUTION_CHANGE_EVENT","state","handleHLSStatsEvent","ON_STATS_EVENT_ERROR","createElement","styles","container","playerWrapper","player","onHmsHlsPlaybackEvent","onHmsHlsStatsEvent","HMSHLSPlayer","forwardRef","create","flex","alignItems","justifyContent","backgroundColor","width","height"],"sources":["HMSHLSPlayer.tsx"],"sourcesContent":["import React, { useImperativeHandle, useRef } from 'react';\nimport { View, StyleSheet, UIManager, findNodeHandle } from 'react-native';\nimport type { StyleProp, ViewStyle } from 'react-native';\n\nimport {\n setHMSHLSPlayerCue,\n setHMSHLSPlayerPlaybackError,\n setHMSHLSPlayerPlaybackState,\n setHMSHLSPlayerResolution,\n setHMSHLSPlayerStats,\n setHMSHLSPlayerStatsError,\n} from './hooks';\nimport {\n RCTHMSHLSPlayer,\n RCTHMSHLSPlayerViewManagerConfig,\n} from './RCTHMSHLSPlayer';\nimport type {\n HmsHlsPlaybackEventHandler,\n HmsHlsStatsEventHandler,\n RCTHMSHLSPlayerRef,\n} from './RCTHMSHLSPlayer';\nimport {\n HMSHLSPlayerPlaybackEventTypes,\n HMSHLSPlayerStatsEventTypes,\n} from '../../types';\nimport type { HMSHLSPlayerPlaybackCueEventData } from '../../types';\nimport { HMSEncoder } from '../../classes/HMSEncoder';\nimport type { HMSHLSPlayerPlaybackCue } from '../../stores/types';\n\nexport interface HMSHLSPlayerProps {\n url?: string;\n style?: StyleProp<ViewStyle>;\n containerStyle?: StyleProp<ViewStyle>;\n aspectRatio?: number;\n enableStats?: boolean;\n enableControls?: boolean;\n}\n\nexport interface HMSHLSPlayerRefProperties {\n play: (url?: string) => void;\n stop: () => void;\n pause: () => void;\n resume: () => void;\n seekForward: (seconds: number) => void;\n seekBackward: (seconds: number) => void;\n seekToLivePosition: () => void;\n setVolume: (level: number) => void;\n}\n\nconst _HMSHLSPlayer: React.ForwardRefRenderFunction<\n HMSHLSPlayerRefProperties,\n HMSHLSPlayerProps\n> = (\n { url = '', style, containerStyle, enableStats, enableControls = false },\n ref\n) => {\n const hmsHlsPlayerRef = useRef<RCTHMSHLSPlayerRef | null>(null);\n\n useImperativeHandle(\n ref,\n () => ({\n play: (url?: string) => {\n if (\n hmsHlsPlayerRef.current &&\n RCTHMSHLSPlayerViewManagerConfig.Commands.play\n ) {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(hmsHlsPlayerRef.current),\n RCTHMSHLSPlayerViewManagerConfig.Commands.play,\n url ? [url] : ['']\n );\n }\n },\n stop: () => {\n if (\n hmsHlsPlayerRef.current &&\n RCTHMSHLSPlayerViewManagerConfig.Commands.stop\n ) {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(hmsHlsPlayerRef.current),\n RCTHMSHLSPlayerViewManagerConfig.Commands.stop,\n undefined\n );\n }\n },\n pause: () => {\n if (\n hmsHlsPlayerRef.current &&\n RCTHMSHLSPlayerViewManagerConfig.Commands.pause\n ) {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(hmsHlsPlayerRef.current),\n RCTHMSHLSPlayerViewManagerConfig.Commands.pause,\n undefined\n );\n }\n },\n resume: () => {\n if (\n hmsHlsPlayerRef.current &&\n RCTHMSHLSPlayerViewManagerConfig.Commands.resume\n ) {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(hmsHlsPlayerRef.current),\n RCTHMSHLSPlayerViewManagerConfig.Commands.resume,\n undefined\n );\n }\n },\n seekForward: (seconds: number) => {\n if (typeof seconds !== 'number') {\n throw new Error(\n seconds\n ? 'seconds must be a `number` type'\n : 'seconds was not provided'\n );\n }\n\n if (\n hmsHlsPlayerRef.current &&\n RCTHMSHLSPlayerViewManagerConfig.Commands.seekForward\n ) {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(hmsHlsPlayerRef.current),\n RCTHMSHLSPlayerViewManagerConfig.Commands.seekForward,\n [seconds]\n );\n }\n },\n seekBackward: (seconds: number) => {\n if (typeof seconds !== 'number') {\n throw new Error(\n seconds\n ? 'seconds must be a `number` type'\n : 'seconds was not provided'\n );\n }\n\n if (\n hmsHlsPlayerRef.current &&\n RCTHMSHLSPlayerViewManagerConfig.Commands.seekBackward\n ) {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(hmsHlsPlayerRef.current),\n RCTHMSHLSPlayerViewManagerConfig.Commands.seekBackward,\n [seconds]\n );\n }\n },\n seekToLivePosition: () => {\n if (\n hmsHlsPlayerRef.current &&\n RCTHMSHLSPlayerViewManagerConfig.Commands.seekToLivePosition\n ) {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(hmsHlsPlayerRef.current),\n RCTHMSHLSPlayerViewManagerConfig.Commands.seekToLivePosition,\n undefined\n );\n }\n },\n setVolume: (level: number) => {\n if (typeof level !== 'number') {\n throw new Error(\n level ? 'level must be a `number` type' : 'level was not provided'\n );\n }\n\n if (\n hmsHlsPlayerRef.current &&\n RCTHMSHLSPlayerViewManagerConfig.Commands.setVolume\n ) {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(hmsHlsPlayerRef.current),\n RCTHMSHLSPlayerViewManagerConfig.Commands.setVolume,\n [level]\n );\n }\n },\n }),\n []\n );\n\n // Handle HLS Playback events\n const handleHLSPlaybackEvent: HmsHlsPlaybackEventHandler = ({\n nativeEvent,\n }) => {\n const { event, data } = nativeEvent;\n\n if (event === HMSHLSPlayerPlaybackEventTypes.ON_PLAYBACK_CUE_EVENT) {\n const transformedData = HMSEncoder.transformHMSHLSCueEventData<\n HMSHLSPlayerPlaybackCueEventData,\n HMSHLSPlayerPlaybackCue\n >(data);\n setHMSHLSPlayerCue(transformedData);\n } else if (\n event === HMSHLSPlayerPlaybackEventTypes.ON_PLAYBACK_FAILURE_EVENT\n ) {\n setHMSHLSPlayerPlaybackError(data.error);\n } else if (\n event ===\n HMSHLSPlayerPlaybackEventTypes.ON_PLAYBACK_RESOLUTION_CHANGE_EVENT\n ) {\n setHMSHLSPlayerResolution({ ...data });\n } else {\n setHMSHLSPlayerPlaybackState(data.state);\n }\n };\n\n // Handle HLS Stats events\n const handleHLSStatsEvent: HmsHlsStatsEventHandler = ({ nativeEvent }) => {\n const { event, data } = nativeEvent;\n\n if (event === HMSHLSPlayerStatsEventTypes.ON_STATS_EVENT_ERROR) {\n setHMSHLSPlayerStatsError(data);\n } else {\n setHMSHLSPlayerStats(data);\n }\n };\n\n return (\n <View style={[styles.container, containerStyle]}>\n <View style={[styles.playerWrapper, style]}>\n <RCTHMSHLSPlayer\n ref={hmsHlsPlayerRef}\n url={url}\n style={styles.player}\n enableStats={enableStats}\n enableControls={enableControls}\n onHmsHlsPlaybackEvent={handleHLSPlaybackEvent}\n onHmsHlsStatsEvent={handleHLSStatsEvent}\n />\n </View>\n </View>\n );\n};\n\nexport const HMSHLSPlayer = React.forwardRef<\n HMSHLSPlayerRefProperties,\n HMSHLSPlayerProps\n>(_HMSHLSPlayer);\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n },\n playerWrapper: {\n backgroundColor: '#000000',\n alignItems: 'center',\n justifyContent: 'center',\n },\n player: {\n width: '100%',\n height: '100%',\n flex: 1,\n },\n});\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,mBAAmB,EAAEC,MAAM,QAAQ,OAAO;AAC1D,SAASC,IAAI,EAAEC,UAAU,EAAEC,SAAS,EAAEC,cAAc,QAAQ,cAAc;AAG1E,SACEC,kBAAkB,EAClBC,4BAA4B,EAC5BC,4BAA4B,EAC5BC,yBAAyB,EACzBC,oBAAoB,EACpBC,yBAAyB,QACpB,SAAS;AAChB,SACEC,eAAe,EACfC,gCAAgC,QAC3B,mBAAmB;AAM1B,SACEC,8BAA8B,EAC9BC,2BAA2B,QACtB,aAAa;AAEpB,SAASC,UAAU,QAAQ,0BAA0B;AAuBrD,MAAMC,aAGL,GAAGA,CACF;EAAEC,GAAG,GAAG,EAAE;EAAEC,KAAK;EAAEC,cAAc;EAAEC,WAAW;EAAEC,cAAc,GAAG;AAAM,CAAC,EACxEC,GAAG,KACA;EACH,MAAMC,eAAe,GAAGvB,MAAM,CAA4B,IAAI,CAAC;EAE/DD,mBAAmB,CACjBuB,GAAG,EACH,OAAO;IACLE,IAAI,EAAGP,GAAY,IAAK;MACtB,IACEM,eAAe,CAACE,OAAO,IACvBb,gCAAgC,CAACc,QAAQ,CAACF,IAAI,EAC9C;QACArB,SAAS,CAACwB,0BAA0B,CAClCvB,cAAc,CAACmB,eAAe,CAACE,OAAO,CAAC,EACvCb,gCAAgC,CAACc,QAAQ,CAACF,IAAI,EAC9CP,GA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ACF,CAAC;AAEX,CAAC;AAED,OAAO,MAAMS,YAAY,gBAAG7D,KAAK,CAAC8D,UAAU,CAG1C5C,aAAa,CAAC;AAEhB,MAAMqC,MAAM,GAAGnD,UAAU,CAAC2D,MAAM,CAAC;EAC/BP,SAAS,EAAE;IACTQ,IAAI,EAAE,CAAC;IACPC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB,CAAC;EACDT,aAAa,EAAE;IACbU,eAAe,EAAE,SAAS;IAC1BF,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB,CAAC;EACDR,MAAM,EAAE;IACNU,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE,MAAM;IACdL,IAAI,EAAE;EACR;AACF,CAAC,CAAC"}
@@ -90,6 +90,11 @@ export { HMSPollUpdateType } from './classes/polls/HMSPollUpdateType';
90
90
  export { HMSPollState } from './classes/polls/HMSPollState';
91
91
  export { HMSPollQuestion } from './classes/polls/HMSPollQuestion';
92
92
  export { HMSPollQuestionOption } from './classes/polls/HMSPollQuestionOption';
93
+ export { HMSPollQuestionAnswer } from './classes/polls/HMSPollQuestionAnswer';
94
+ export { HMSPollQuestionResponse } from './classes/polls/HMSPollQuestionResponse';
95
+ export { PollLeaderboardResponse } from './classes/polls/PollLeaderboardResponse';
96
+ export { HMSPollLeaderboardEntry } from './classes/polls/HMSPollLeaderboardEntry';
97
+ export { HMSPollLeaderboardSummary } from './classes/polls/HMSPollLeaderboardSummary';
93
98
  import { HMSSDK as HmsManager } from './classes/HMSSDK';
94
99
 
95
100
  // 100ms React Native Module
@@ -1 +1 @@
1
- {"version":3,"names":["HMSRecordingState","HMSPollQuestionType","HMSPollType","HMSPollUserTrackingMode","HMSPollUpdateType","HMSPollState","HMSPollQuestion","HMSPollQuestionOption","HMSSDK","HmsManager","default","HMSManagerModule","useHmsViewsResolutionsState","checkNotifications"],"sources":["index.ts"],"sourcesContent":["export * from './classes/HMSConfig';\nexport * from './classes/HMSUpdateListenerActions';\nexport * from './classes/HMSMessage';\nexport * from './classes/HMSVideoTrackSettings';\nexport * from './classes/HMSVideoTrack';\nexport * from './classes/HMSVideoSettings';\nexport * from './classes/HMSVideoCodec';\nexport * from './classes/HMSTrackSettings';\nexport * from './classes/HMSTrack';\nexport * from './classes/HMSTrackType';\nexport * from './classes/HMSTrackSource';\nexport * from './classes/HMSSubscribeSettings';\nexport * from './classes/HMSSimulcastSettings';\nexport * from './classes/HMSSimulcastLayerSettings';\nexport * from './classes/HMSSDK';\nexport * from './classes/HMSRoom';\nexport * from './classes/HMSRoleChangeRequest';\nexport * from './classes/HMSRole';\nexport * from './classes/HMSRemoteVideoTrack';\nexport * from './classes/HMSRemotePeer';\nexport * from './classes/HMSRemoteAudioTrack';\nexport * from './classes/HMSPublishSettings';\nexport * from './classes/HMSPermissions';\nexport * from './classes/HMSPeer';\nexport * from './classes/HMSLocalVideoTrack';\nexport * from './classes/HMSLocalPeer';\nexport * from './classes/HMSLocalAudioTrack';\nexport * from './classes/HMSHelper';\nexport * from './classes/HMSEncoder';\nexport * from './classes/HMSAudioTrackSettings';\nexport * from './classes/HMSAudioTrack';\nexport * from './classes/HMSAudioSettings';\nexport * from './classes/HMSAudioCodec';\nexport * from './classes/HMSPeerUpdate';\nexport * from './classes/HMSRoomUpdate';\nexport * from './classes/HMSTrackUpdate';\nexport * from './classes/HMSLogger';\nexport * from './classes/HMSLogLevel';\nexport * from './classes/HMSVideoViewMode';\nexport * from './classes/HMSChangeTrackStateRequest';\nexport * from './classes/HMSSpeaker';\nexport * from './classes/HMSCameraFacing';\nexport * from './classes/HMSException';\nexport * from './classes/HMSRtmpStreamingState';\nexport * from './classes/HMSServerRecordingState';\nexport * from './classes/HMSBrowserRecordingState';\nexport * from './classes/HMSRTMPConfig';\nexport * from './classes/HMSHLSConfig';\nexport * from './classes/HMSHLSMeetingURLVariant';\nexport * from './classes/HMSHLSVariant';\nexport * from './classes/HMSHLSStreamingState';\nexport * from './classes/HMSVideoResolution';\nexport * from './classes/HMSLocalAudioStats';\nexport * from './classes/HMSLocalVideoStats';\nexport * from './classes/HMSRTCStats';\nexport * from './classes/HMSRTCStatsReport';\nexport * from './classes/HMSRemoteAudioStats';\nexport * from './classes/HMSRemoteVideoStats';\nexport * from './classes/HMSHLSRecordingConfig';\nexport * from './classes/HMSHLSRecordingState';\nexport * from './classes/HMSMessageRecipient';\nexport * from './classes/HMSMessageRecipientType';\nexport * from './classes/HMSNetworkQuality';\nexport * from './classes/HMSRtmpVideoResolution';\nexport * from './classes/HMSAudioDevice';\nexport * from './classes/HMSAudioMode';\nexport * from './classes/HMSAudioMixingMode';\nexport * from './classes/HMSAudioNode';\nexport * from './classes/HMSMicNode';\nexport * from './classes/HMSScreenBroadcastAudioReceiverNode';\nexport * from './classes/HMSAudioFilePlayerNode';\nexport * from './classes/HMSAudioMixerSource';\nexport * from './classes/HMSTrackSettingsInitState';\nexport * from './classes/HMSLogSettings';\nexport * from './classes/HMSLogAlarmManager';\nexport * from './classes/HMSPIPListenerActions';\nexport * from './classes/HMSLayer';\nexport * from './classes/HMSSimulcastLayerDefinition';\nexport * from './classes/HMSQualityLimitationReasons';\nexport * from './classes/HMSQualityLimitationReason';\nexport * from './classes/HMSCameraControl';\nexport * from './classes/HMSIOSAudioMode';\nexport * from './classes/HMSRecordingState';\nexport * from './classes/HMSStreamingState';\nexport type {\n HMSSessionStore,\n JsonArray,\n JsonMap,\n JsonPrimitive,\n JsonValue,\n} from './classes/HMSSessionStore';\nexport type {\n HmsViewComponent as HMSView,\n HmsComponentProps as HMSViewProps,\n} from './classes/HmsView';\nexport type { HMSPIPConfig } from './classes/HMSPIPConfig';\nexport { HMSRecordingState } from './classes/HMSRecordingState';\nexport type { HMSPoll } from './classes/polls/HMSPoll';\n\nexport { HMSPollQuestionType } from './classes/polls/HMSPollQuestionType';\nexport { HMSPollType } from './classes/polls/HMSPollType';\nexport { HMSPollUserTrackingMode } from './classes/polls/HMSPollUserTrackingMode';\nexport { HMSPollUpdateType } from './classes/polls/HMSPollUpdateType';\nexport { HMSPollState } from './classes/polls/HMSPollState';\nexport { HMSPollQuestion } from './classes/polls/HMSPollQuestion';\nexport { HMSPollQuestionOption } from './classes/polls/HMSPollQuestionOption';\n\nimport { HMSSDK as HmsManager } from './classes/HMSSDK';\n\n// 100ms React Native Module\nexport { default as HMSManagerModule } from './modules/HMSManagerModule';\n\n// 100ms Components\nexport * from './components/HMSHLSPlayer';\n\n// 100ms Hooks\nexport * from './hooks/useHMSPeerUpdates';\nexport { useHmsViewsResolutionsState } from './hooks/hmsviews';\n\n// 100ms Utilities\nexport type { NotificationResult } from './utils/notification';\nexport { checkNotifications } from './utils/notification';\n\nexport * from './utils/windowController';\nexport * from './utils/keyboard';\n\n// 100ms types\nexport * from './types';\nexport * from './stores/types';\n\nexport default HmsManager;\n"],"mappings":"AAAA,cAAc,qBAAqB;AACnC,cAAc,oCAAoC;AAClD,cAAc,sBAAsB;AACpC,cAAc,iCAAiC;AAC/C,cAAc,yBAAyB;AACvC,cAAc,4BAA4B;AAC1C,cAAc,yBAAyB;AACvC,cAAc,4BAA4B;AAC1C,cAAc,oBAAoB;AAClC,cAAc,wBAAwB;AACtC,cAAc,0BAA0B;AACxC,cAAc,gCAAgC;AAC9C,cAAc,gCAAgC;AAC9C,cAAc,qCAAqC;AACnD,cAAc,kBAAkB;AAChC,cAAc,mBAAmB;AACjC,cAAc,gCAAgC;AAC9C,cAAc,mBAAmB;AACjC,cAAc,+BAA+B;AAC7C,cAAc,yBAAyB;AACvC,cAAc,+BAA+B;AAC7C,cAAc,8BAA8B;AAC5C,cAAc,0BAA0B;AACxC,cAAc,mBAAmB;AACjC,cAAc,8BAA8B;AAC5C,cAAc,wBAAwB;AACtC,cAAc,8BAA8B;AAC5C,cAAc,qBAAqB;AACnC,cAAc,sBAAsB;AACpC,cAAc,iCAAiC;AAC/C,cAAc,yBAAyB;AACvC,cAAc,4BAA4B;AAC1C,cAAc,yBAAyB;AACvC,cAAc,yBAAyB;AACvC,cAAc,y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QAAQ,8BAA8B;AAC3D,SAASC,eAAe,QAAQ,iCAAiC;AACjE,SAASC,qBAAqB,QAAQ,uCAAuC;AAE7E,SAASC,MAAM,IAAIC,UAAU,QAAQ,kBAAkB;;AAEvD;AACA,SAASC,OAAO,IAAIC,gBAAgB,QAAQ,4BAA4B;;AAExE;AACA,cAAc,2BAA2B;;AAEzC;AACA,cAAc,2BAA2B;AACzC,SAASC,2BAA2B,QAAQ,kBAAkB;;AAE9D;;AAEA,SAASC,kBAAkB,QAAQ,sBAAsB;AAEzD,cAAc,0BAA0B;AACxC,cAAc,kBAAkB;;AAEhC;AACA,cAAc,SAAS;AACvB,cAAc,gBAAgB;AAE9B,eAAeJ,UAAU"}
1
+ {"version":3,"names":["HMSRecordingState","HMSPollQuestionType","HMSPollType","HMSPollUserTrackingMode","HMSPollUpdateType","HMSPollState","HMSPollQuestion","HMSPollQuestionOption","HMSPollQuestionAnswer","HMSPollQuestionResponse","PollLeaderboardResponse","HMSPollLeaderboardEntry","HMSPollLeaderboardSummary","HMSSDK","HmsManager","default","HMSManagerModule","useHmsViewsResolutionsState","checkNotifications"],"sources":["index.ts"],"sourcesContent":["export * from './classes/HMSConfig';\nexport * from './classes/HMSUpdateListenerActions';\nexport * from './classes/HMSMessage';\nexport * from './classes/HMSVideoTrackSettings';\nexport * from './classes/HMSVideoTrack';\nexport * from './classes/HMSVideoSettings';\nexport * from './classes/HMSVideoCodec';\nexport * from './classes/HMSTrackSettings';\nexport * from './classes/HMSTrack';\nexport * from './classes/HMSTrackType';\nexport * from './classes/HMSTrackSource';\nexport * from './classes/HMSSubscribeSettings';\nexport * from './classes/HMSSimulcastSettings';\nexport * from './classes/HMSSimulcastLayerSettings';\nexport * from './classes/HMSSDK';\nexport * from './classes/HMSRoom';\nexport * from './classes/HMSRoleChangeRequest';\nexport * from './classes/HMSRole';\nexport * from './classes/HMSRemoteVideoTrack';\nexport * from './classes/HMSRemotePeer';\nexport * from './classes/HMSRemoteAudioTrack';\nexport * from './classes/HMSPublishSettings';\nexport * from './classes/HMSPermissions';\nexport * from './classes/HMSPeer';\nexport * from './classes/HMSLocalVideoTrack';\nexport * from './classes/HMSLocalPeer';\nexport * from './classes/HMSLocalAudioTrack';\nexport * from './classes/HMSHelper';\nexport * from './classes/HMSEncoder';\nexport * from './classes/HMSAudioTrackSettings';\nexport * from './classes/HMSAudioTrack';\nexport * from './classes/HMSAudioSettings';\nexport * from './classes/HMSAudioCodec';\nexport * from './classes/HMSPeerUpdate';\nexport * from './classes/HMSRoomUpdate';\nexport * from './classes/HMSTrackUpdate';\nexport * from './classes/HMSLogger';\nexport * from './classes/HMSLogLevel';\nexport * from './classes/HMSVideoViewMode';\nexport * from './classes/HMSChangeTrackStateRequest';\nexport * from './classes/HMSSpeaker';\nexport * from './classes/HMSCameraFacing';\nexport * from './classes/HMSException';\nexport * from './classes/HMSRtmpStreamingState';\nexport * from './classes/HMSServerRecordingState';\nexport * from './classes/HMSBrowserRecordingState';\nexport * from './classes/HMSRTMPConfig';\nexport * from './classes/HMSHLSConfig';\nexport * from './classes/HMSHLSMeetingURLVariant';\nexport * from './classes/HMSHLSVariant';\nexport * from './classes/HMSHLSStreamingState';\nexport * from './classes/HMSVideoResolution';\nexport * from './classes/HMSLocalAudioStats';\nexport * from './classes/HMSLocalVideoStats';\nexport * from './classes/HMSRTCStats';\nexport * from './classes/HMSRTCStatsReport';\nexport * from './classes/HMSRemoteAudioStats';\nexport * from './classes/HMSRemoteVideoStats';\nexport * from './classes/HMSHLSRecordingConfig';\nexport * from './classes/HMSHLSRecordingState';\nexport * from './classes/HMSMessageRecipient';\nexport * from './classes/HMSMessageRecipientType';\nexport * from './classes/HMSNetworkQuality';\nexport * from './classes/HMSRtmpVideoResolution';\nexport * from './classes/HMSAudioDevice';\nexport * from './classes/HMSAudioMode';\nexport * from './classes/HMSAudioMixingMode';\nexport * from './classes/HMSAudioNode';\nexport * from './classes/HMSMicNode';\nexport * from './classes/HMSScreenBroadcastAudioReceiverNode';\nexport * from './classes/HMSAudioFilePlayerNode';\nexport * from './classes/HMSAudioMixerSource';\nexport * from './classes/HMSTrackSettingsInitState';\nexport * from './classes/HMSLogSettings';\nexport * from './classes/HMSLogAlarmManager';\nexport * from './classes/HMSPIPListenerActions';\nexport * from './classes/HMSLayer';\nexport * from './classes/HMSSimulcastLayerDefinition';\nexport * from './classes/HMSQualityLimitationReasons';\nexport * from './classes/HMSQualityLimitationReason';\nexport * from './classes/HMSCameraControl';\nexport * from './classes/HMSIOSAudioMode';\nexport * from './classes/HMSRecordingState';\nexport * from './classes/HMSStreamingState';\nexport type {\n HMSSessionStore,\n JsonArray,\n JsonMap,\n JsonPrimitive,\n JsonValue,\n} from './classes/HMSSessionStore';\nexport type {\n HmsViewComponent as HMSView,\n HmsComponentProps as HMSViewProps,\n} from './classes/HmsView';\nexport type { HMSPIPConfig } from './classes/HMSPIPConfig';\nexport { HMSRecordingState } from './classes/HMSRecordingState';\nexport type { HMSPoll } from './classes/polls/HMSPoll';\n\nexport { HMSPollQuestionType } from './classes/polls/HMSPollQuestionType';\nexport { HMSPollType } from './classes/polls/HMSPollType';\nexport { HMSPollUserTrackingMode } from './classes/polls/HMSPollUserTrackingMode';\nexport { HMSPollUpdateType } from './classes/polls/HMSPollUpdateType';\nexport { HMSPollState } from './classes/polls/HMSPollState';\nexport { HMSPollQuestion } from './classes/polls/HMSPollQuestion';\nexport { HMSPollQuestionOption } from './classes/polls/HMSPollQuestionOption';\nexport { HMSPollQuestionAnswer } from './classes/polls/HMSPollQuestionAnswer';\nexport { HMSPollQuestionResponse } from './classes/polls/HMSPollQuestionResponse';\nexport { PollLeaderboardResponse } from './classes/polls/PollLeaderboardResponse';\nexport { HMSPollLeaderboardEntry } from './classes/polls/HMSPollLeaderboardEntry';\nexport { HMSPollLeaderboardSummary } from './classes/polls/HMSPollLeaderboardSummary';\n\nimport { HMSSDK as HmsManager } from './classes/HMSSDK';\n\n// 100ms React Native Module\nexport { default as HMSManagerModule } from './modules/HMSManagerModule';\n\n// 100ms Components\nexport * from './components/HMSHLSPlayer';\n\n// 100ms Hooks\nexport * from './hooks/useHMSPeerUpdates';\nexport { useHmsViewsResolutionsState } from './hooks/hmsviews';\n\n// 100ms Utilities\nexport type { NotificationResult } from './utils/notification';\nexport { checkNotifications } from './utils/notification';\n\nexport * from './utils/windowController';\nexport * from './utils/keyboard';\n\n// 100ms types\nexport * from './types';\nexport * from './stores/types';\n\nexport default HmsManager;\n"],"mappings":"AAAA,cAAc,qBAAqB;AACnC,cAAc,oCAAoC;AAClD,cAAc,sBAAsB;AACpC,cAAc,iCAAiC;AAC/C,cAAc,yBAAyB;AACvC,cAAc,4BAA4B;AAC1C,cAAc,yBAAyB;AACvC,cAAc,4BAA4B;AAC1C,cAAc,oBAAoB;AAClC,cAAc,wBAAwB;AACtC,cAAc,0BAA0B;AACxC,cAAc,gCAAgC;AAC9C,cAAc,gCAAgC;AAC9C,cAAc,qCAAqC;AACnD,cAAc,kBAAkB;AAChC,cAAc,mBAAmB;AACjC,cAAc,gCAAgC;AAC9C,cAAc,mBAAmB;AACjC,cAAc,+BAA+B;AAC7C,cAAc,yBAAyB;AACvC,cAAc,+BAA+B;AAC7C,cAAc,8BAA8B;AAC5C,cAAc,0BAA0B;AACxC,cAAc,mBAAmB;AACjC,cAAc,8BAA8B;AAC5C,cAAc,wBAAwB;AACtC,cAAc,8BAA8B;AAC5C,cAAc,qBAAqB;AACnC,cAAc,sBAAsB;AACpC,cAAc,iCAAiC;AAC/C,cAAc,yBAAyB;AACvC,cAAc,4BAA4B;AAC1C,cAAc,yBAAyB;AACvC,cAAc,yBAAyB;AACvC,cAAc,yBAAyB;AACvC,cAAc,0BAA0B;AACxC,cAAc,qBAAqB;AACnC,cAAc,uBAAuB;AACrC,cAAc,4BAA4B;AAC1C,cAAc,sCAAsC;AACpD,cAAc,sBAAsB;AACpC,cAAc,2BAA2B;AACzC,cAAc,wBAAwB;AACtC,cAAc,iCAAiC;AAC/C,cAAc,mCAAmC;AACjD,c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Q,yCAAyC;AACjF,SAASC,yBAAyB,QAAQ,2CAA2C;AAErF,SAASC,MAAM,IAAIC,UAAU,QAAQ,kBAAkB;;AAEvD;AACA,SAASC,OAAO,IAAIC,gBAAgB,QAAQ,4BAA4B;;AAExE;AACA,cAAc,2BAA2B;;AAEzC;AACA,cAAc,2BAA2B;AACzC,SAASC,2BAA2B,QAAQ,kBAAkB;;AAE9D;;AAEA,SAASC,kBAAkB,QAAQ,sBAAsB;AAEzD,cAAc,0BAA0B;AACxC,cAAc,kBAAkB;;AAEhC;AACA,cAAc,SAAS;AACvB,cAAc,gBAAgB;AAE9B,eAAeJ,UAAU"}
@@ -0,0 +1,4 @@
1
+ export interface HMSHLSTimedMetadata {
2
+ payload: string;
3
+ duration: number;
4
+ }
@@ -1,6 +1,7 @@
1
1
  import type { HMSPoll } from './polls/HMSPoll';
2
2
  import type { HMSPollCreateParams } from './polls/HMSPollCreateParams';
3
3
  import type { HMSPollUpdateType } from './polls/HMSPollUpdateType';
4
+ import type { PollLeaderboardResponse } from './polls/PollLeaderboardResponse';
4
5
  type PollQuestionResponseCreateParams = {
5
6
  pollId: string;
6
7
  pollQuestionIndex: number;
@@ -31,5 +32,14 @@ export declare class HMSInteractivityCenter {
31
32
  startPoll(pollParams: HMSPollCreateParams): Promise<any>;
32
33
  add(pollQuestionResponseParams: PollQuestionResponseCreateParams): Promise<any>;
33
34
  stop(pollId: string): Promise<any>;
35
+ /**
36
+ * Fetches the leaderboard for a poll
37
+ * @param pollId - The id of the poll
38
+ * @param count - The number of entries to fetch
39
+ * @param startIndex - The index to start fetching from
40
+ * @param includeCurrentPeer - Whether to include the current peer in the fetched leaderboard entries
41
+ * @returns Promise<PollLeaderboardResponse>
42
+ */
43
+ fetchLeaderboard(pollId: string, count: number, startIndex: number, includeCurrentPeer: boolean): Promise<PollLeaderboardResponse>;
34
44
  }
35
45
  export {};
@@ -1,4 +1,7 @@
1
+ import type { DecodedPollLeaderboardResponse } from './polls/DecodedPollLeaderboardResponse';
1
2
  import type { HMSPoll } from './polls/HMSPoll';
3
+ import type { PollLeaderboardResponse } from './polls/PollLeaderboardResponse';
2
4
  export declare class HMSInteractivityEncoder {
3
5
  static transformPoll(poll: HMSPoll): HMSPoll;
6
+ static transformPollLeaderboardResponse(decodedPollLeaderboardResponse: DecodedPollLeaderboardResponse): PollLeaderboardResponse;
4
7
  }
@@ -22,6 +22,7 @@ import type { HMSPeerListIteratorOptions } from './HMSPeerListIteratorOptions';
22
22
  import { HMSPeerListIterator } from './HMSPeerListIterator';
23
23
  import type { HMSPIPConfig } from './HMSPIPConfig';
24
24
  import { HMSInteractivityCenter } from './HMSInteractivityCenter';
25
+ import type { HMSHLSTimedMetadata } from './HMSHLSTimedMetadata';
25
26
  type HmsViewProps = Omit<HmsComponentProps, 'id'>;
26
27
  export declare class HMSSDK {
27
28
  id: string;
@@ -217,6 +218,12 @@ export declare class HMSSDK {
217
218
  * @memberof HMSSDK
218
219
  */
219
220
  stopHLSStreaming: () => Promise<any>;
221
+ /**
222
+ * send timed metadata for HLS player
223
+ * @param metadata list of {@link HMSHLSTimedMetadata} to be sent
224
+ * @returns Promise<boolean>
225
+ */
226
+ sendHLSTimedMetadata: (metadata: HMSHLSTimedMetadata[]) => Promise<boolean>;
220
227
  /**
221
228
  * @deprecated This function has been deprecated in favor of #Function changeRoleOfPeer
222
229
  *
@@ -0,0 +1,37 @@
1
+ import type { HMSPollLeaderboardEntry } from './HMSPollLeaderboardEntry';
2
+ import type { HMSPollLeaderboardSummary } from './HMSPollLeaderboardSummary';
3
+ import type { PollLeaderboardResponse } from './PollLeaderboardResponse';
4
+ type NumberString = string;
5
+ export interface DecodedPollLeaderboardResponse extends Pick<PollLeaderboardResponse, 'hasNext'> {
6
+ entries?: DecodedHMSPollLeaderboardEntry[];
7
+ summary?: DecodedHMSPollLeaderboardSummary;
8
+ }
9
+ export interface DecodedHMSPollLeaderboardEntry extends Pick<HMSPollLeaderboardEntry, 'peer'> {
10
+ /**
11
+ * convert this value to number
12
+ */
13
+ duration?: NumberString | number;
14
+ /**
15
+ * convert this value to number
16
+ */
17
+ totalResponses?: NumberString | number;
18
+ /**
19
+ * convert this value to number
20
+ */
21
+ correctResponses?: NumberString | number;
22
+ /**
23
+ * convert this value to number
24
+ */
25
+ position?: NumberString | number;
26
+ /**
27
+ * convert this value to number
28
+ */
29
+ score?: NumberString | number;
30
+ }
31
+ export interface DecodedHMSPollLeaderboardSummary extends Omit<HMSPollLeaderboardSummary, 'averageTime'> {
32
+ /**
33
+ * convert this value to number
34
+ */
35
+ averageTime?: NumberString | number;
36
+ }
37
+ export {};
@@ -5,13 +5,6 @@ import type { HMSRole } from '../HMSRole';
5
5
  import type { HMSPollUserTrackingMode } from './HMSPollUserTrackingMode';
6
6
  import type { HMSPollType } from './HMSPollType';
7
7
  import type { HMSPeer } from '../HMSPeer';
8
- type HMSPeerSubset = {
9
- peerID: HMSPeer['peerID'];
10
- name: HMSPeer['name'];
11
- };
12
- type HMSRoleSubset = {
13
- name: HMSRole['name'];
14
- };
15
8
  export interface HMSPoll {
16
9
  /**
17
10
  The unique identifier of the poll.
@@ -36,23 +29,23 @@ export interface HMSPoll {
36
29
  /**
37
30
  The roles that can vote in the poll.
38
31
  */
39
- rolesThatCanVote?: HMSRoleSubset[];
32
+ rolesThatCanVote?: HMSRole[];
40
33
  /**
41
34
  The roles that can view the poll responses.
42
35
  */
43
- rolesThatCanViewResponses?: HMSRoleSubset[];
36
+ rolesThatCanViewResponses?: HMSRole[];
44
37
  /**
45
38
  The peer who started the poll.
46
39
  */
47
- startedBy?: HMSPeerSubset;
40
+ startedBy?: HMSPeer;
48
41
  /**
49
42
  The peer who stopped the poll.
50
43
  */
51
- stoppedBy?: HMSPeerSubset;
44
+ stoppedBy?: HMSPeer;
52
45
  /**
53
46
  The peer who created the poll.
54
47
  */
55
- createdBy?: HMSPeerSubset;
48
+ createdBy?: HMSPeer;
56
49
  /**
57
50
  The date and time when the poll was started.
58
51
  */
@@ -78,4 +71,3 @@ export interface HMSPoll {
78
71
  */
79
72
  result?: HMSPollResult;
80
73
  }
81
- export {};
@@ -1,9 +1,6 @@
1
- import type { HMSRole } from '../HMSRole';
2
1
  import type { HMSPoll } from './HMSPoll';
3
2
  import type { HMSPollQuestionCreateParams } from './HMSPollQuestionCreateParams';
4
- export interface HMSPollCreateParams extends Pick<HMSPoll, 'title' | 'type' | 'duration' | 'anonymous' | 'mode'> {
3
+ export interface HMSPollCreateParams extends Pick<HMSPoll, 'title' | 'type' | 'duration' | 'anonymous' | 'mode' | 'rolesThatCanVote' | 'rolesThatCanViewResponses'> {
5
4
  pollId?: HMSPoll['pollId'];
6
5
  questions?: HMSPollQuestionCreateParams[];
7
- rolesThatCanVote?: HMSRole[];
8
- rolesThatCanViewResponses?: HMSRole[];
9
6
  }
@@ -0,0 +1,9 @@
1
+ import type { HMSPollResponsePeerInfo } from './HMSPollResponsePeerInfo';
2
+ export interface HMSPollLeaderboardEntry {
3
+ duration?: number;
4
+ totalResponses?: number;
5
+ correctResponses?: number;
6
+ position?: number;
7
+ score?: number;
8
+ peer?: HMSPollResponsePeerInfo;
9
+ }
@@ -0,0 +1,7 @@
1
+ export interface HMSPollLeaderboardSummary {
2
+ averageScore?: number;
3
+ averageTime?: number;
4
+ respondedCorrectlyPeersCount?: number;
5
+ respondedPeersCount?: number;
6
+ totalPeersCount?: number;
7
+ }
@@ -0,0 +1,7 @@
1
+ import type { HMSPollLeaderboardEntry } from './HMSPollLeaderboardEntry';
2
+ import type { HMSPollLeaderboardSummary } from './HMSPollLeaderboardSummary';
3
+ export interface PollLeaderboardResponse {
4
+ entries?: HMSPollLeaderboardEntry[];
5
+ hasNext?: boolean;
6
+ summary?: HMSPollLeaderboardSummary;
7
+ }
@@ -94,6 +94,11 @@ export { HMSPollUpdateType } from './classes/polls/HMSPollUpdateType';
94
94
  export { HMSPollState } from './classes/polls/HMSPollState';
95
95
  export { HMSPollQuestion } from './classes/polls/HMSPollQuestion';
96
96
  export { HMSPollQuestionOption } from './classes/polls/HMSPollQuestionOption';
97
+ export { HMSPollQuestionAnswer } from './classes/polls/HMSPollQuestionAnswer';
98
+ export { HMSPollQuestionResponse } from './classes/polls/HMSPollQuestionResponse';
99
+ export { PollLeaderboardResponse } from './classes/polls/PollLeaderboardResponse';
100
+ export { HMSPollLeaderboardEntry } from './classes/polls/HMSPollLeaderboardEntry';
101
+ export { HMSPollLeaderboardSummary } from './classes/polls/HMSPollLeaderboardSummary';
97
102
  import { HMSSDK as HmsManager } from './classes/HMSSDK';
98
103
  export { default as HMSManagerModule } from './modules/HMSManagerModule';
99
104
  export * from './components/HMSHLSPlayer';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@100mslive/react-native-hms",
3
- "version": "1.9.11",
3
+ "version": "1.10.0",
4
4
  "description": "Integrate Real Time Audio and Video conferencing, Interactive Live Streaming, and Chat in your apps with 100ms React Native SDK. With support for HLS and RTMP Live Streaming and Recording, Picture-in-Picture (PiP), one-to-one Video Call Modes, Audio Rooms, Video Player and much more, add immersive real-time communications to your apps.",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
package/sdk-versions.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
- "ios": "1.5.1",
2
+ "ios": "1.6.0",
3
3
  "iOSBroadcastExtension": "0.0.9",
4
4
  "iOSHMSHLSPlayer": "0.0.2",
5
- "android": "2.9.2"
5
+ "android": "2.9.4"
6
6
  }
@@ -0,0 +1,4 @@
1
+ export interface HMSHLSTimedMetadata {
2
+ payload: string;
3
+ duration: number;
4
+ }
@@ -10,6 +10,8 @@ import HMSNativeEventListener from './HMSNativeEventListener';
10
10
  import type { HMSEventSubscription } from './HMSNativeEventEmitter';
11
11
  import { HMSInteractivityEncoder } from './HMSInteractivityEncoder';
12
12
  import { HMSHelper } from './HMSHelper';
13
+ import type { PollLeaderboardResponse } from './polls/PollLeaderboardResponse';
14
+ import type { DecodedPollLeaderboardResponse } from './polls/DecodedPollLeaderboardResponse';
13
15
 
14
16
  type PollUpdateListener = (data: {
15
17
  updatedPoll: HMSPoll;
@@ -134,4 +136,32 @@ export class HMSInteractivityCenter {
134
136
  logger?.verbose('#Function stop', JSON.stringify(data));
135
137
  return HMSManager.stopPoll(data);
136
138
  }
139
+
140
+ /**
141
+ * Fetches the leaderboard for a poll
142
+ * @param pollId - The id of the poll
143
+ * @param count - The number of entries to fetch
144
+ * @param startIndex - The index to start fetching from
145
+ * @param includeCurrentPeer - Whether to include the current peer in the fetched leaderboard entries
146
+ * @returns Promise<PollLeaderboardResponse>
147
+ */
148
+ async fetchLeaderboard(
149
+ pollId: string,
150
+ count: number,
151
+ startIndex: number,
152
+ includeCurrentPeer: boolean
153
+ ): Promise<PollLeaderboardResponse> {
154
+ const data = {
155
+ id: HMSConstants.DEFAULT_SDK_ID,
156
+ pollId,
157
+ count,
158
+ startIndex,
159
+ includeCurrentPeer,
160
+ };
161
+ logger?.verbose('#Function fetchLeaderboard', data);
162
+
163
+ const response: DecodedPollLeaderboardResponse =
164
+ await HMSManager.fetchLeaderboard(data);
165
+ return HMSInteractivityEncoder.transformPollLeaderboardResponse(response);
166
+ }
137
167
  }
@@ -1,4 +1,7 @@
1
+ import { HMSEncoder } from './HMSEncoder';
2
+ import type { DecodedPollLeaderboardResponse } from './polls/DecodedPollLeaderboardResponse';
1
3
  import type { HMSPoll } from './polls/HMSPoll';
4
+ import type { PollLeaderboardResponse } from './polls/PollLeaderboardResponse';
2
5
 
3
6
  export class HMSInteractivityEncoder {
4
7
  static transformPoll(poll: HMSPoll): HMSPoll {
@@ -20,10 +23,62 @@ export class HMSInteractivityEncoder {
20
23
  poll.stoppedAt = new Date(dateNum);
21
24
  }
22
25
  }
23
- // poll.rolesThatCanVote: HMSRole[];
24
- // poll.rolesThatCanViewResponses: HMSRole[];
26
+ if (poll.createdBy) {
27
+ poll.createdBy = HMSEncoder.encodeHmsPeer(poll.createdBy);
28
+ }
29
+ if (poll.startedBy) {
30
+ poll.startedBy = HMSEncoder.encodeHmsPeer(poll.startedBy);
31
+ }
32
+ if (poll.stoppedBy) {
33
+ poll.stoppedBy = HMSEncoder.encodeHmsPeer(poll.stoppedBy);
34
+ }
35
+ if (poll.rolesThatCanVote) {
36
+ poll.rolesThatCanVote = poll.rolesThatCanVote.map((role) =>
37
+ HMSEncoder.encodeHmsRole(role)
38
+ );
39
+ }
40
+ if (poll.rolesThatCanViewResponses) {
41
+ poll.rolesThatCanViewResponses = poll.rolesThatCanViewResponses.map(
42
+ (role) => HMSEncoder.encodeHmsRole(role)
43
+ );
44
+ }
45
+
25
46
  // --- poll.questions: HMSPollQuestion[]
26
47
  // --- poll.result: HMSPollResult
27
48
  return poll;
28
49
  }
50
+
51
+ static transformPollLeaderboardResponse(
52
+ decodedPollLeaderboardResponse: DecodedPollLeaderboardResponse
53
+ ): PollLeaderboardResponse {
54
+ const summary = decodedPollLeaderboardResponse.summary;
55
+ if (summary) {
56
+ if (typeof summary.averageTime === 'string') {
57
+ summary.averageTime = parseInt(summary.averageTime);
58
+ }
59
+ }
60
+
61
+ const entries = decodedPollLeaderboardResponse.entries;
62
+ if (entries) {
63
+ entries.forEach((entry) => {
64
+ if (typeof entry.duration === 'string') {
65
+ entry.duration = parseInt(entry.duration);
66
+ }
67
+ if (typeof entry.totalResponses === 'string') {
68
+ entry.totalResponses = parseInt(entry.totalResponses);
69
+ }
70
+ if (typeof entry.correctResponses === 'string') {
71
+ entry.correctResponses = parseInt(entry.correctResponses);
72
+ }
73
+ if (typeof entry.position === 'string') {
74
+ entry.position = parseInt(entry.position);
75
+ }
76
+ if (typeof entry.score === 'string') {
77
+ entry.score = parseInt(entry.score);
78
+ }
79
+ });
80
+ }
81
+
82
+ return decodedPollLeaderboardResponse as PollLeaderboardResponse;
83
+ }
29
84
  }
@@ -47,6 +47,7 @@ import type { HMSPeerListIteratorOptions } from './HMSPeerListIteratorOptions';
47
47
  import { HMSPeerListIterator } from './HMSPeerListIterator';
48
48
  import type { HMSPIPConfig } from './HMSPIPConfig';
49
49
  import { HMSInteractivityCenter } from './HMSInteractivityCenter';
50
+ import type { HMSHLSTimedMetadata } from './HMSHLSTimedMetadata';
50
51
 
51
52
  type HmsViewProps = Omit<HmsComponentProps, 'id'>;
52
53
 
@@ -430,6 +431,19 @@ export class HMSSDK {
430
431
  return await HMSManager.stopHLSStreaming({ id: this.id });
431
432
  };
432
433
 
434
+ /**
435
+ * send timed metadata for HLS player
436
+ * @param metadata list of {@link HMSHLSTimedMetadata} to be sent
437
+ * @returns Promise<boolean>
438
+ */
439
+ sendHLSTimedMetadata = async (
440
+ metadata: HMSHLSTimedMetadata[]
441
+ ): Promise<boolean> => {
442
+ const data = { metadata, id: this.id };
443
+ logger?.verbose('#Function sendHLSTimedMetadata', data);
444
+ return await HMSManager.sendHLSTimedMetadata(data);
445
+ };
446
+
433
447
  /**
434
448
  * @deprecated This function has been deprecated in favor of #Function changeRoleOfPeer
435
449
  *