@100mslive/react-native-hms 1.10.2 → 1.10.4
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/local.properties +8 -1
- package/android/src/main/java/com/reactnativehmssdk/HMSDecoder.kt +3 -0
- package/android/src/main/java/com/reactnativehmssdk/HMSHLSPlayer.kt +94 -0
- package/android/src/main/java/com/reactnativehmssdk/HMSHLSPlayerManager.kt +32 -0
- package/ios/HMSDecoder.swift +12 -0
- package/ios/HMSHLSPlayerManager.m +6 -0
- package/ios/HMSHLSPlayerManager.swift +140 -1
- package/ios/Hmssdk.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/Hmssdk.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/Hmssdk.xcodeproj/project.xcworkspace/xcuserdata/jatinnagar.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/Hmssdk.xcodeproj/xcuserdata/jatinnagar.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
- package/lib/commonjs/classes/HMSEncoder.js +11 -1
- package/lib/commonjs/classes/HMSEncoder.js.map +1 -1
- package/lib/commonjs/classes/HMSHLSPlaylistType.js +12 -0
- package/lib/commonjs/classes/HMSHLSPlaylistType.js.map +1 -0
- package/lib/commonjs/classes/HMSHLSVariant.js +2 -0
- package/lib/commonjs/classes/HMSHLSVariant.js.map +1 -1
- package/lib/commonjs/classes/HMSNoiseCancellationPlugin.js +1 -0
- package/lib/commonjs/classes/HMSNoiseCancellationPlugin.js.map +1 -1
- package/lib/commonjs/components/HMSHLSPlayer/HMSHLSPlayer.js +98 -2
- package/lib/commonjs/components/HMSHLSPlayer/HMSHLSPlayer.js.map +1 -1
- package/lib/commonjs/components/HMSHLSPlayer/RCTHMSHLSPlayer.js.map +1 -1
- package/lib/commonjs/components/HMSHLSPlayer/hooks.js +16 -6
- package/lib/commonjs/components/HMSHLSPlayer/hooks.js.map +1 -1
- package/lib/commonjs/components/HMSHLSPlayer/index.js +15 -1
- package/lib/commonjs/components/HMSHLSPlayer/index.js.map +1 -1
- package/lib/commonjs/index.js +12 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/stores/hls-player-playback-slice.js +6 -0
- package/lib/commonjs/stores/hls-player-playback-slice.js.map +1 -1
- package/lib/commonjs/stores/hls-player-stats-store.js +27 -15
- package/lib/commonjs/stores/hls-player-stats-store.js.map +1 -1
- package/lib/commonjs/stores/types.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/module/classes/HMSEncoder.js +11 -1
- package/lib/module/classes/HMSEncoder.js.map +1 -1
- package/lib/module/classes/HMSHLSPlaylistType.js +6 -0
- package/lib/module/classes/HMSHLSPlaylistType.js.map +1 -0
- package/lib/module/classes/HMSHLSVariant.js +2 -0
- package/lib/module/classes/HMSHLSVariant.js.map +1 -1
- package/lib/module/classes/HMSNoiseCancellationPlugin.js +1 -0
- package/lib/module/classes/HMSNoiseCancellationPlugin.js.map +1 -1
- package/lib/module/components/HMSHLSPlayer/HMSHLSPlayer.js +101 -5
- package/lib/module/components/HMSHLSPlayer/HMSHLSPlayer.js.map +1 -1
- package/lib/module/components/HMSHLSPlayer/RCTHMSHLSPlayer.js.map +1 -1
- package/lib/module/components/HMSHLSPlayer/hooks.js +12 -4
- package/lib/module/components/HMSHLSPlayer/hooks.js.map +1 -1
- package/lib/module/components/HMSHLSPlayer/index.js +1 -1
- package/lib/module/components/HMSHLSPlayer/index.js.map +1 -1
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/stores/hls-player-playback-slice.js +6 -0
- package/lib/module/stores/hls-player-playback-slice.js.map +1 -1
- package/lib/module/stores/hls-player-stats-store.js +27 -15
- package/lib/module/stores/hls-player-stats-store.js.map +1 -1
- package/lib/module/stores/types.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/typescript/classes/HMSEncoder.d.ts +2 -0
- package/lib/typescript/classes/HMSHLSPlaylistType.d.ts +4 -0
- package/lib/typescript/classes/HMSHLSVariant.d.ts +3 -0
- package/lib/typescript/classes/HMSNoiseCancellationPlugin.d.ts +1 -0
- package/lib/typescript/components/HMSHLSPlayer/HMSHLSPlayer.d.ts +6 -0
- package/lib/typescript/components/HMSHLSPlayer/RCTHMSHLSPlayer.d.ts +5 -1
- package/lib/typescript/components/HMSHLSPlayer/hooks.d.ts +3 -0
- package/lib/typescript/components/HMSHLSPlayer/index.d.ts +1 -1
- package/lib/typescript/index.d.ts +1 -0
- package/lib/typescript/stores/hls-player-stats-store.d.ts +4 -3
- package/lib/typescript/stores/types.d.ts +7 -1
- package/lib/typescript/types.d.ts +9 -0
- package/package.json +1 -1
- package/sdk-versions.json +2 -2
- package/src/classes/HMSEncoder.ts +13 -0
- package/src/classes/HMSHLSPlaylistType.ts +4 -0
- package/src/classes/HMSHLSVariant.ts +5 -0
- package/src/classes/HMSNoiseCancellationPlugin.ts +1 -0
- package/src/components/HMSHLSPlayer/HMSHLSPlayer.tsx +158 -4
- package/src/components/HMSHLSPlayer/RCTHMSHLSPlayer.ts +12 -0
- package/src/components/HMSHLSPlayer/hooks.ts +16 -4
- package/src/components/HMSHLSPlayer/index.ts +2 -0
- package/src/index.ts +1 -0
- package/src/stores/hls-player-playback-slice.ts +8 -0
- package/src/stores/hls-player-stats-store.ts +28 -18
- package/src/stores/types.ts +9 -1
- package/src/types.ts +15 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","shallow","useHMSHLSPlayerStatsStore","useHMSStore","useHMSHLSPlayerPlaybackState","state","playbackState","useHMSHLSPlayerResolution","resolution","useHMSHLSPlayerStats","stats","error","useHMSHLSPlayerStat","stat","useHMSHLSPlayerStatsError","callback","deps","subscribe","data","useHMSHLSPlayerPlaybackError","useHMSHLSPlayerCue","cue","setHMSHLSPlayerPlaybackState","getState","setPlaybackState","setHMSHLSPlayerResolution","setResolution","setHMSHLSPlayerCue","setCue","setHMSHLSPlayerPlaybackError","setPlaybackError","setHMSHLSPlayerStats","changeStats","setHMSHLSPlayerStatsError","setError"],"sources":["hooks.ts"],"sourcesContent":["import { useEffect } from 'react';\nimport type { DependencyList } from 'react';\nimport { shallow } from 'zustand/shallow';\n\nimport { useHMSHLSPlayerStatsStore } from '../../stores/hls-player-stats-store';\nimport { useHMSStore } from '../../stores/hms-store';\nimport type { HMSHLSPlayerStatsUpdateEventData } from '../../types';\nimport type {\n HMSHLSPlayerCue,\n HMSHLSPlayerPlaybackError,\n HMSHLSPlayerStatsError,\n} from '../../stores/types';\n\n// use latest state (with component rerender)\n\nexport const useHMSHLSPlayerPlaybackState = () => {\n return useHMSStore((state) => state.playbackState);\n};\n\nexport const useHMSHLSPlayerResolution = () => {\n return useHMSStore((state) => state.resolution);\n};\n\nexport const useHMSHLSPlayerStats = () => {\n return useHMSHLSPlayerStatsStore(\n (state) => ({\n stats: state.stats,\n error: state.error,\n }),\n shallow\n );\n};\n\nexport const useHMSHLSPlayerStat = <\n T extends keyof HMSHLSPlayerStatsUpdateEventData,\n>(\n stat: T\n) => {\n return useHMSHLSPlayerStatsStore((state) => state.stats[stat]);\n};\n\n
|
|
1
|
+
{"version":3,"names":["useEffect","Platform","shallow","useHMSHLSPlayerStatsStore","useHMSStore","useHMSHLSPlayerPlaybackState","state","playbackState","useHMSHLSPlayerResolution","resolution","useHMSHLSPlayerStats","stats","error","useHMSHLSPlayerStat","stat","useHMSHLSPlayerSubtitles","subtitles","useIsHLSStreamLive","liveOffsetMillis","select","default","ios","distanceFromLive","useHMSHLSPlayerStatsError","callback","deps","subscribe","data","useHMSHLSPlayerPlaybackError","useHMSHLSPlayerCue","cue","setHMSHLSPlayerPlaybackState","getState","setPlaybackState","setHMSHLSPlayerResolution","setResolution","setHMSHLSPlayerCue","setCue","setHMSHLSPlayerPlaybackError","setPlaybackError","setHMSHLSPlayerStats","changeStats","setHMSHLSPlayerStatsError","setError","setHMSHLSPlayerSubtitles","setSubtitles"],"sources":["hooks.ts"],"sourcesContent":["import { useEffect } from 'react';\nimport { Platform } from 'react-native';\nimport type { DependencyList } from 'react';\nimport { shallow } from 'zustand/shallow';\n\nimport { useHMSHLSPlayerStatsStore } from '../../stores/hls-player-stats-store';\nimport { useHMSStore } from '../../stores/hms-store';\nimport type { HMSHLSPlayerStatsUpdateEventData } from '../../types';\nimport type {\n HMSHLSPlayerCue,\n HMSHLSPlayerPlaybackError,\n HMSHLSPlayerStatsError,\n} from '../../stores/types';\n\n// use latest state (with component rerender)\n\nexport const useHMSHLSPlayerPlaybackState = () => {\n return useHMSStore((state) => state.playbackState);\n};\n\nexport const useHMSHLSPlayerResolution = () => {\n return useHMSStore((state) => state.resolution);\n};\n\nexport const useHMSHLSPlayerStats = () => {\n return useHMSHLSPlayerStatsStore(\n (state) => ({\n stats: state.stats,\n error: state.error,\n }),\n shallow\n );\n};\n\nexport const useHMSHLSPlayerStat = <\n T extends keyof HMSHLSPlayerStatsUpdateEventData,\n>(\n stat: T\n) => {\n return useHMSHLSPlayerStatsStore((state) => state.stats[stat]);\n};\n\nexport const useHMSHLSPlayerSubtitles = () => {\n return useHMSHLSPlayerStatsStore((state) => state.subtitles);\n};\n\n// The distance of current playback position from the live edge of HLS stream\nexport const useIsHLSStreamLive = (\n liveOffsetMillis: number = Platform.select({ default: 10000, ios: 5000 })\n) => {\n return useHMSHLSPlayerStatsStore(\n (state) => state.stats.distanceFromLive < liveOffsetMillis\n );\n};\n\n// get latest state (without component rerender)\n\nexport const useHMSHLSPlayerStatsError = (\n callback: (error: NonNullable<HMSHLSPlayerStatsError>) => void,\n deps: DependencyList\n) => {\n useEffect(() => {\n return useHMSHLSPlayerStatsStore.subscribe(\n (state) => state.error,\n (data) => {\n if (data) callback(data);\n }\n );\n }, deps);\n};\n\nexport const useHMSHLSPlayerPlaybackError = (\n callback: (error: NonNullable<HMSHLSPlayerPlaybackError>) => void,\n deps: DependencyList\n) => {\n useEffect(() => {\n return useHMSStore.subscribe(\n (state) => state.error,\n (data) => {\n if (data) callback(data);\n }\n );\n }, deps);\n};\n\nexport const useHMSHLSPlayerCue = (\n callback: (error: NonNullable<HMSHLSPlayerCue>) => void,\n deps: DependencyList\n) => {\n useEffect(() => {\n return useHMSStore.subscribe(\n (state) => state.cue,\n (data) => {\n if (data) callback(data);\n }\n );\n }, deps);\n};\n\n// state setters\n\nexport const setHMSHLSPlayerPlaybackState =\n useHMSStore.getState().setPlaybackState;\n\nexport const setHMSHLSPlayerResolution = useHMSStore.getState().setResolution;\n\nexport const setHMSHLSPlayerCue = useHMSStore.getState().setCue;\n\nexport const setHMSHLSPlayerPlaybackError =\n useHMSStore.getState().setPlaybackError;\n\nexport const setHMSHLSPlayerStats =\n useHMSHLSPlayerStatsStore.getState().changeStats;\n\nexport const setHMSHLSPlayerStatsError =\n useHMSHLSPlayerStatsStore.getState().setError;\n\nexport const setHMSHLSPlayerSubtitles =\n useHMSHLSPlayerStatsStore.getState().setSubtitles;\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export * from './HMSHLSPlayer';
|
|
2
|
-
export { useHMSHLSPlayerPlaybackState, useHMSHLSPlayerCue, useHMSHLSPlayerPlaybackError, useHMSHLSPlayerStats, useHMSHLSPlayerStat, useHMSHLSPlayerStatsError, useHMSHLSPlayerResolution } from './hooks';
|
|
2
|
+
export { useHMSHLSPlayerPlaybackState, useHMSHLSPlayerCue, useHMSHLSPlayerPlaybackError, useHMSHLSPlayerStats, useHMSHLSPlayerStat, useHMSHLSPlayerStatsError, useHMSHLSPlayerResolution, useHMSHLSPlayerSubtitles, useIsHLSStreamLive } from './hooks';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useHMSHLSPlayerPlaybackState","useHMSHLSPlayerCue","useHMSHLSPlayerPlaybackError","useHMSHLSPlayerStats","useHMSHLSPlayerStat","useHMSHLSPlayerStatsError","useHMSHLSPlayerResolution"],"sources":["index.ts"],"sourcesContent":["export * from './HMSHLSPlayer';\nexport {\n useHMSHLSPlayerPlaybackState,\n useHMSHLSPlayerCue,\n useHMSHLSPlayerPlaybackError,\n useHMSHLSPlayerStats,\n useHMSHLSPlayerStat,\n useHMSHLSPlayerStatsError,\n useHMSHLSPlayerResolution,\n} from './hooks';\n"],"mappings":"AAAA,cAAc,gBAAgB;AAC9B,SACEA,4BAA4B,EAC5BC,kBAAkB,EAClBC,4BAA4B,EAC5BC,oBAAoB,EACpBC,mBAAmB,EACnBC,yBAAyB,EACzBC,yBAAyB,
|
|
1
|
+
{"version":3,"names":["useHMSHLSPlayerPlaybackState","useHMSHLSPlayerCue","useHMSHLSPlayerPlaybackError","useHMSHLSPlayerStats","useHMSHLSPlayerStat","useHMSHLSPlayerStatsError","useHMSHLSPlayerResolution","useHMSHLSPlayerSubtitles","useIsHLSStreamLive"],"sources":["index.ts"],"sourcesContent":["export * from './HMSHLSPlayer';\nexport {\n useHMSHLSPlayerPlaybackState,\n useHMSHLSPlayerCue,\n useHMSHLSPlayerPlaybackError,\n useHMSHLSPlayerStats,\n useHMSHLSPlayerStat,\n useHMSHLSPlayerStatsError,\n useHMSHLSPlayerResolution,\n useHMSHLSPlayerSubtitles,\n useIsHLSStreamLive,\n} from './hooks';\n"],"mappings":"AAAA,cAAc,gBAAgB;AAC9B,SACEA,4BAA4B,EAC5BC,kBAAkB,EAClBC,4BAA4B,EAC5BC,oBAAoB,EACpBC,mBAAmB,EACnBC,yBAAyB,EACzBC,yBAAyB,EACzBC,wBAAwB,EACxBC,kBAAkB,QACb,SAAS","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -83,6 +83,7 @@ export * from './classes/HMSCameraControl';
|
|
|
83
83
|
export * from './classes/HMSIOSAudioMode';
|
|
84
84
|
export * from './classes/HMSRecordingState';
|
|
85
85
|
export * from './classes/HMSStreamingState';
|
|
86
|
+
export * from './classes/HMSHLSPlaylistType';
|
|
86
87
|
export { HMSRecordingState } from './classes/HMSRecordingState';
|
|
87
88
|
export * from './classes/HMSNoiseCancellationPlugin';
|
|
88
89
|
export { HMSPollQuestionType } from './classes/polls/HMSPollQuestionType';
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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/HMSPeerType';\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';\nexport * from './classes/HMSNoiseCancellationPlugin';\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,uBAAuB;AACrC,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,cAAc,oCAAoC;AAClD,cAAc,yBAAyB;AACvC,cAAc,wBAAwB;AACtC,cAAc,mCAAmC;AACjD,cAAc,yBAAyB;AACvC,cAAc,gCAAgC;AAC9C,cAAc,8BAA8B;AAC5C,cAAc,8BAA8B;AAC5C,cAAc,8BAA8B;AAC5C,cAAc,uBAAuB;AACrC,cAAc,6BAA6B;AAC3C,cAAc,+BAA+B;AAC7C,cAAc,+BAA+B;AAC7C,cAAc,iCAAiC;AAC/C,cAAc,gCAAgC;AAC9C,cAAc,+BAA+B;AAC7C,cAAc,mCAAmC;AACjD,cAAc,6BAA6B;AAC3C,cAAc,kCAAkC;AAChD,cAAc,0BAA0B;AACxC,cAAc,wBAAwB;AACtC,cAAc,8BAA8B;AAC5C,cAAc,wBAAwB;AACtC,cAAc,sBAAsB;AACpC,cAAc,+CAA+C;AAC7D,cAAc,kCAAkC;AAChD,cAAc,+BAA+B;AAC7C,cAAc,qCAAqC;AACnD,cAAc,0BAA0B;AACxC,cAAc,8BAA8B;AAC5C,cAAc,iCAAiC;AAC/C,cAAc,oBAAoB;AAClC,cAAc,uCAAuC;AACrD,cAAc,uCAAuC;AACrD,cAAc,sCAAsC;AACpD,cAAc,4BAA4B;AAC1C,cAAc,2BAA2B;AACzC,cAAc,6BAA6B;AAC3C,cAAc,6BAA6B;
|
|
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/HMSPeerType';\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 * from './classes/HMSHLSPlaylistType';\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';\nexport * from './classes/HMSNoiseCancellationPlugin';\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,uBAAuB;AACrC,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,cAAc,oCAAoC;AAClD,cAAc,yBAAyB;AACvC,cAAc,wBAAwB;AACtC,cAAc,mCAAmC;AACjD,cAAc,yBAAyB;AACvC,cAAc,gCAAgC;AAC9C,cAAc,8BAA8B;AAC5C,cAAc,8BAA8B;AAC5C,cAAc,8BAA8B;AAC5C,cAAc,uBAAuB;AACrC,cAAc,6BAA6B;AAC3C,cAAc,+BAA+B;AAC7C,cAAc,+BAA+B;AAC7C,cAAc,iCAAiC;AAC/C,cAAc,gCAAgC;AAC9C,cAAc,+BAA+B;AAC7C,cAAc,mCAAmC;AACjD,cAAc,6BAA6B;AAC3C,cAAc,kCAAkC;AAChD,cAAc,0BAA0B;AACxC,cAAc,wBAAwB;AACtC,cAAc,8BAA8B;AAC5C,cAAc,wBAAwB;AACtC,cAAc,sBAAsB;AACpC,cAAc,+CAA+C;AAC7D,cAAc,kCAAkC;AAChD,cAAc,+BAA+B;AAC7C,cAAc,qCAAqC;AACnD,cAAc,0BAA0B;AACxC,cAAc,8BAA8B;AAC5C,cAAc,iCAAiC;AAC/C,cAAc,oBAAoB;AAClC,cAAc,uCAAuC;AACrD,cAAc,uCAAuC;AACrD,cAAc,sCAAsC;AACpD,cAAc,4BAA4B;AAC1C,cAAc,2BAA2B;AACzC,cAAc,6BAA6B;AAC3C,cAAc,6BAA6B;AAC3C,cAAc,8BAA8B;AAa5C,SAASA,iBAAiB,QAAQ,6BAA6B;AAE/D,cAAc,sCAAsC;AAEpD,SAASC,mBAAmB,QAAQ,qCAAqC;AACzE,SAASC,WAAW,QAAQ,6BAA6B;AACzD,SAASC,uBAAuB,QAAQ,yCAAyC;AACjF,SAASC,iBAAiB,QAAQ,mCAAmC;AACrE,SAASC,YAAY,QAAQ,8BAA8B;AAC3D,SAASC,eAAe,QAAQ,iCAAiC;AACjE,SAASC,qBAAqB,QAAQ,uCAAuC;AAC7E,SAASC,qBAAqB,QAAQ,uCAAuC;AAC7E,SAASC,uBAAuB,QAAQ,yCAAyC;AACjF,SAASC,uBAAuB,QAAQ,yCAAyC;AACjF,SAASC,uBAAuB,QAAQ,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","ignoreList":[]}
|
|
@@ -15,6 +15,12 @@ export const createHMSHLSPlayerPlaybackSlice = set => ({
|
|
|
15
15
|
resolution: undefined,
|
|
16
16
|
setResolution: resolution => set({
|
|
17
17
|
resolution
|
|
18
|
+
}),
|
|
19
|
+
resetPlaybackSlice: () => set({
|
|
20
|
+
cue: undefined,
|
|
21
|
+
playbackState: HMSHLSPlayerPlaybackState.UNKNOWN,
|
|
22
|
+
error: undefined,
|
|
23
|
+
resolution: undefined
|
|
18
24
|
})
|
|
19
25
|
});
|
|
20
26
|
//# sourceMappingURL=hls-player-playback-slice.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["HMSHLSPlayerPlaybackState","createHMSHLSPlayerPlaybackSlice","set","cue","undefined","setCue","playbackState","UNKNOWN","setPlaybackState","error","setPlaybackError","resolution","setResolution"],"sources":["hls-player-playback-slice.ts"],"sourcesContent":["import type { StateCreator } from 'zustand';\nimport { HMSHLSPlayerPlaybackState } from '../types';\nimport type {\n HMSHLSPlayerPlaybackCue,\n HMSHLSPlayerPlaybackError,\n HMSHLSPlayerPlaybackSlice,\n HMSStore,\n} from './types';\n\nexport const createHMSHLSPlayerPlaybackSlice: StateCreator<\n HMSStore,\n [],\n [],\n HMSHLSPlayerPlaybackSlice\n> = (set) => ({\n cue: undefined,\n setCue: (cue: HMSHLSPlayerPlaybackCue) => set({ cue }),\n\n playbackState: HMSHLSPlayerPlaybackState.UNKNOWN,\n setPlaybackState: (playbackState: HMSHLSPlayerPlaybackState) =>\n set({ playbackState }),\n\n error: undefined,\n setPlaybackError: (error: HMSHLSPlayerPlaybackError) => set({ error }),\n\n resolution: undefined,\n setResolution: (resolution) => set({ resolution }),\n});\n"],"mappings":"AACA,SAASA,yBAAyB,QAAQ,UAAU;AAQpD,OAAO,MAAMC,+BAKZ,GAAIC,GAAG,KAAM;EACZC,GAAG,EAAEC,SAAS;EACdC,MAAM,EAAGF,GAA4B,IAAKD,GAAG,CAAC;IAAEC;EAAI,CAAC,CAAC;EAEtDG,aAAa,EAAEN,yBAAyB,CAACO,OAAO;EAChDC,gBAAgB,EAAGF,aAAwC,IACzDJ,GAAG,CAAC;IAAEI;EAAc,CAAC,CAAC;EAExBG,KAAK,EAAEL,SAAS;EAChBM,gBAAgB,EAAGD,KAAgC,IAAKP,GAAG,CAAC;IAAEO;EAAM,CAAC,CAAC;EAEtEE,UAAU,EAAEP,SAAS;EACrBQ,aAAa,EAAGD,UAAU,IAAKT,GAAG,CAAC;IAAES;EAAW,CAAC;
|
|
1
|
+
{"version":3,"names":["HMSHLSPlayerPlaybackState","createHMSHLSPlayerPlaybackSlice","set","cue","undefined","setCue","playbackState","UNKNOWN","setPlaybackState","error","setPlaybackError","resolution","setResolution","resetPlaybackSlice"],"sources":["hls-player-playback-slice.ts"],"sourcesContent":["import type { StateCreator } from 'zustand';\nimport { HMSHLSPlayerPlaybackState } from '../types';\nimport type {\n HMSHLSPlayerPlaybackCue,\n HMSHLSPlayerPlaybackError,\n HMSHLSPlayerPlaybackSlice,\n HMSStore,\n} from './types';\n\nexport const createHMSHLSPlayerPlaybackSlice: StateCreator<\n HMSStore,\n [],\n [],\n HMSHLSPlayerPlaybackSlice\n> = (set) => ({\n cue: undefined,\n setCue: (cue: HMSHLSPlayerPlaybackCue) => set({ cue }),\n\n playbackState: HMSHLSPlayerPlaybackState.UNKNOWN,\n setPlaybackState: (playbackState: HMSHLSPlayerPlaybackState) =>\n set({ playbackState }),\n\n error: undefined,\n setPlaybackError: (error: HMSHLSPlayerPlaybackError) => set({ error }),\n\n resolution: undefined,\n setResolution: (resolution) => set({ resolution }),\n\n resetPlaybackSlice: () =>\n set({\n cue: undefined,\n playbackState: HMSHLSPlayerPlaybackState.UNKNOWN,\n error: undefined,\n resolution: undefined,\n }),\n});\n"],"mappings":"AACA,SAASA,yBAAyB,QAAQ,UAAU;AAQpD,OAAO,MAAMC,+BAKZ,GAAIC,GAAG,KAAM;EACZC,GAAG,EAAEC,SAAS;EACdC,MAAM,EAAGF,GAA4B,IAAKD,GAAG,CAAC;IAAEC;EAAI,CAAC,CAAC;EAEtDG,aAAa,EAAEN,yBAAyB,CAACO,OAAO;EAChDC,gBAAgB,EAAGF,aAAwC,IACzDJ,GAAG,CAAC;IAAEI;EAAc,CAAC,CAAC;EAExBG,KAAK,EAAEL,SAAS;EAChBM,gBAAgB,EAAGD,KAAgC,IAAKP,GAAG,CAAC;IAAEO;EAAM,CAAC,CAAC;EAEtEE,UAAU,EAAEP,SAAS;EACrBQ,aAAa,EAAGD,UAAU,IAAKT,GAAG,CAAC;IAAES;EAAW,CAAC,CAAC;EAElDE,kBAAkB,EAAEA,CAAA,KAClBX,GAAG,CAAC;IACFC,GAAG,EAAEC,SAAS;IACdE,aAAa,EAAEN,yBAAyB,CAACO,OAAO;IAChDE,KAAK,EAAEL,SAAS;IAChBO,UAAU,EAAEP;EACd,CAAC;AACL,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { create } from 'zustand';
|
|
2
2
|
import { subscribeWithSelector } from 'zustand/middleware';
|
|
3
|
+
const INITIAL_STATS = {
|
|
4
|
+
// bandwidth
|
|
5
|
+
bandWidthEstimate: 0,
|
|
6
|
+
totalBytesLoaded: 0,
|
|
7
|
+
// bufferedDuration
|
|
8
|
+
bufferedDuration: 0,
|
|
9
|
+
// distanceFromLive
|
|
10
|
+
distanceFromLive: 0,
|
|
11
|
+
// frameInfo
|
|
12
|
+
droppedFrameCount: 0,
|
|
13
|
+
// videoInfo
|
|
14
|
+
averageBitrate: 0,
|
|
15
|
+
videoHeight: 0,
|
|
16
|
+
videoWidth: 0
|
|
17
|
+
};
|
|
3
18
|
export const useHMSHLSPlayerStatsStore = create()(subscribeWithSelector(set => ({
|
|
4
19
|
// Handle Stats
|
|
5
|
-
stats:
|
|
6
|
-
// bandwidth
|
|
7
|
-
bandWidthEstimate: 0,
|
|
8
|
-
totalBytesLoaded: 0,
|
|
9
|
-
// bufferedDuration
|
|
10
|
-
bufferedDuration: 0,
|
|
11
|
-
// distanceFromLive
|
|
12
|
-
distanceFromLive: 0,
|
|
13
|
-
// frameInfo
|
|
14
|
-
droppedFrameCount: 0,
|
|
15
|
-
// videoInfo
|
|
16
|
-
averageBitrate: 0,
|
|
17
|
-
videoHeight: 0,
|
|
18
|
-
videoWidth: 0
|
|
19
|
-
},
|
|
20
|
+
stats: INITIAL_STATS,
|
|
20
21
|
changeStats: stats => set({
|
|
21
22
|
stats
|
|
22
23
|
}),
|
|
@@ -24,6 +25,17 @@ export const useHMSHLSPlayerStatsStore = create()(subscribeWithSelector(set => (
|
|
|
24
25
|
error: undefined,
|
|
25
26
|
setError: error => set({
|
|
26
27
|
error
|
|
28
|
+
}),
|
|
29
|
+
// Handle Closed Caption
|
|
30
|
+
subtitles: null,
|
|
31
|
+
setSubtitles: subtitles => set({
|
|
32
|
+
subtitles
|
|
33
|
+
}),
|
|
34
|
+
// Reset State
|
|
35
|
+
reset: () => set({
|
|
36
|
+
stats: INITIAL_STATS,
|
|
37
|
+
error: undefined,
|
|
38
|
+
subtitles: null
|
|
27
39
|
})
|
|
28
40
|
})));
|
|
29
41
|
//# sourceMappingURL=hls-player-stats-store.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["create","subscribeWithSelector","
|
|
1
|
+
{"version":3,"names":["create","subscribeWithSelector","INITIAL_STATS","bandWidthEstimate","totalBytesLoaded","bufferedDuration","distanceFromLive","droppedFrameCount","averageBitrate","videoHeight","videoWidth","useHMSHLSPlayerStatsStore","set","stats","changeStats","error","undefined","setError","subtitles","setSubtitles","reset"],"sources":["hls-player-stats-store.ts"],"sourcesContent":["import { create } from 'zustand';\nimport { subscribeWithSelector } from 'zustand/middleware';\nimport type {\n HMSHLSPlayerStats,\n HMSHLSPlayerStatsError,\n HMSHLSPlayerStatsStore,\n} from './types';\n\nconst INITIAL_STATS = {\n // bandwidth\n bandWidthEstimate: 0,\n totalBytesLoaded: 0,\n\n // bufferedDuration\n bufferedDuration: 0,\n\n // distanceFromLive\n distanceFromLive: 0,\n\n // frameInfo\n droppedFrameCount: 0,\n\n // videoInfo\n averageBitrate: 0,\n videoHeight: 0,\n videoWidth: 0,\n};\n\nexport const useHMSHLSPlayerStatsStore = create<HMSHLSPlayerStatsStore>()(\n subscribeWithSelector((set) => ({\n // Handle Stats\n stats: INITIAL_STATS,\n changeStats: (stats: HMSHLSPlayerStats) => set({ stats }),\n\n // Handle Stats Error\n error: undefined,\n setError: (error: HMSHLSPlayerStatsError) => set({ error }),\n\n // Handle Closed Caption\n subtitles: null,\n setSubtitles: (subtitles: string | null) => set({ subtitles }),\n\n // Reset State\n reset: () =>\n set({ stats: INITIAL_STATS, error: undefined, subtitles: null }),\n }))\n);\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,SAAS;AAChC,SAASC,qBAAqB,QAAQ,oBAAoB;AAO1D,MAAMC,aAAa,GAAG;EACpB;EACAC,iBAAiB,EAAE,CAAC;EACpBC,gBAAgB,EAAE,CAAC;EAEnB;EACAC,gBAAgB,EAAE,CAAC;EAEnB;EACAC,gBAAgB,EAAE,CAAC;EAEnB;EACAC,iBAAiB,EAAE,CAAC;EAEpB;EACAC,cAAc,EAAE,CAAC;EACjBC,WAAW,EAAE,CAAC;EACdC,UAAU,EAAE;AACd,CAAC;AAED,OAAO,MAAMC,yBAAyB,GAAGX,MAAM,CAAyB,CAAC,CACvEC,qBAAqB,CAAEW,GAAG,KAAM;EAC9B;EACAC,KAAK,EAAEX,aAAa;EACpBY,WAAW,EAAGD,KAAwB,IAAKD,GAAG,CAAC;IAAEC;EAAM,CAAC,CAAC;EAEzD;EACAE,KAAK,EAAEC,SAAS;EAChBC,QAAQ,EAAGF,KAA6B,IAAKH,GAAG,CAAC;IAAEG;EAAM,CAAC,CAAC;EAE3D;EACAG,SAAS,EAAE,IAAI;EACfC,YAAY,EAAGD,SAAwB,IAAKN,GAAG,CAAC;IAAEM;EAAU,CAAC,CAAC;EAE9D;EACAE,KAAK,EAAEA,CAAA,KACLR,GAAG,CAAC;IAAEC,KAAK,EAAEX,aAAa;IAAEa,KAAK,EAAEC,SAAS;IAAEE,SAAS,EAAE;EAAK,CAAC;AACnE,CAAC,CAAC,CACJ,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["// Stores\n\nimport type { HMSPoll } from '../classes/polls/HMSPoll';\nimport type {\n HMSHLSPlayerPlaybackState,\n HMSHLSPlayerPlaybackCueEventData,\n HMSHLSPlayerPlaybackFailureEventData,\n HMSHLSPlayerPlaybackResolutionChangeEventData,\n HMSHLSPlayerStatsErrorEventData,\n HMSHLSPlayerStatsUpdateEventData,\n} from '../types';\n\nexport type HMSStore = HMSHLSPlayerPlaybackSlice & HMSViewsSlice;\nexport type HMSHLSPlayerStatsStore = HMSHLSPlayerStatsSlice;\nexport type HMSInteractivityStore = HMSPollsSlice;\n\n//#region HMSViews Slice\n\nexport type TrackId = string;\n\nexport type Resolution = {\n width: number;\n height: number;\n};\n\nexport interface HMSViewsSlice {\n hmsviewsResolutions: Record<TrackId, Resolution | undefined>;\n setHmsviewsResolutions(trackId: TrackId, resolution: Resolution): void;\n}\n\n//#endregion HMSViews Slice\n\n//#region HLS Player Playback Slice\n\nexport interface HMSHLSPlayerPlaybackCue\n extends Omit<HMSHLSPlayerPlaybackCueEventData, 'endDate' | 'startDate'> {\n endDate?: Date;\n startDate: Date;\n}\n\nexport type HMSHLSPlayerCue = HMSHLSPlayerPlaybackCue | undefined;\n\nexport type HMSHLSPlayerPlaybackError =\n | HMSHLSPlayerPlaybackFailureEventData['error']\n | undefined;\n\nexport type HMSHLSPlayerResolution =\n | HMSHLSPlayerPlaybackResolutionChangeEventData\n | undefined;\n\nexport interface HMSHLSPlayerPlaybackSlice {\n cue: HMSHLSPlayerCue;\n playbackState: HMSHLSPlayerPlaybackState;\n resolution: HMSHLSPlayerResolution;\n error: HMSHLSPlayerPlaybackError;\n setCue(cue: HMSHLSPlayerPlaybackCue): void;\n setPlaybackState(playbackState: HMSHLSPlayerPlaybackState): void;\n setResolution(resolution: HMSHLSPlayerResolution): void;\n setPlaybackError(error: HMSHLSPlayerPlaybackError): void;\n}\n\n//#endregion HLS Player Playback Slice\n\n//#region HLS Player Stats Slice\n\nexport type HMSHLSPlayerStats = HMSHLSPlayerStatsUpdateEventData;\nexport type HMSHLSPlayerStatsError =\n | HMSHLSPlayerStatsErrorEventData\n | undefined;\n\nexport interface HMSHLSPlayerStatsSlice {\n stats: HMSHLSPlayerStats;\n error: HMSHLSPlayerStatsError | undefined;\n changeStats(stats: HMSHLSPlayerStats): void;\n setError(error: HMSHLSPlayerStatsError): void;\n}\n\n//#endregion HLS Player Stats Slice\n\n//#region Polls Slice\n\nexport type HMSPollsSlice = {\n polls: Record<string, HMSPoll>;\n setPolls(poll: HMSPoll): void;\n};\n\n//#endregion Polls Slice\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["// Stores\n\nimport type { HMSPoll } from '../classes/polls/HMSPoll';\nimport type {\n HMSHLSPlayerPlaybackState,\n HMSHLSPlayerPlaybackCueEventData,\n HMSHLSPlayerPlaybackFailureEventData,\n HMSHLSPlayerPlaybackResolutionChangeEventData,\n HMSHLSPlayerStatsErrorEventData,\n HMSHLSPlayerStatsUpdateEventData,\n} from '../types';\n\nexport type HMSStore = HMSHLSPlayerPlaybackSlice & HMSViewsSlice;\nexport type HMSHLSPlayerStatsStore = HMSHLSPlayerStatsSlice &\n HLSPlayerClosedCaptionsSlice;\nexport type HMSInteractivityStore = HMSPollsSlice;\n\n//#region HMSViews Slice\n\nexport type TrackId = string;\n\nexport type Resolution = {\n width: number;\n height: number;\n};\n\nexport interface HMSViewsSlice {\n hmsviewsResolutions: Record<TrackId, Resolution | undefined>;\n setHmsviewsResolutions(trackId: TrackId, resolution: Resolution): void;\n}\n\n//#endregion HMSViews Slice\n\n//#region HLS Player Playback Slice\n\nexport interface HMSHLSPlayerPlaybackCue\n extends Omit<HMSHLSPlayerPlaybackCueEventData, 'endDate' | 'startDate'> {\n endDate?: Date;\n startDate: Date;\n}\n\nexport type HMSHLSPlayerCue = HMSHLSPlayerPlaybackCue | undefined;\n\nexport type HMSHLSPlayerPlaybackError =\n | HMSHLSPlayerPlaybackFailureEventData['error']\n | undefined;\n\nexport type HMSHLSPlayerResolution =\n | HMSHLSPlayerPlaybackResolutionChangeEventData\n | undefined;\n\nexport interface HMSHLSPlayerPlaybackSlice {\n cue: HMSHLSPlayerCue;\n playbackState: HMSHLSPlayerPlaybackState;\n resolution: HMSHLSPlayerResolution;\n error: HMSHLSPlayerPlaybackError;\n setCue(cue: HMSHLSPlayerPlaybackCue): void;\n setPlaybackState(playbackState: HMSHLSPlayerPlaybackState): void;\n setResolution(resolution: HMSHLSPlayerResolution): void;\n setPlaybackError(error: HMSHLSPlayerPlaybackError): void;\n resetPlaybackSlice(): void;\n}\n\n//#endregion HLS Player Playback Slice\n\n//#region HLS Player Stats Slice\n\nexport type HMSHLSPlayerStats = HMSHLSPlayerStatsUpdateEventData;\nexport type HMSHLSPlayerStatsError =\n | HMSHLSPlayerStatsErrorEventData\n | undefined;\n\nexport interface HMSHLSPlayerStatsSlice {\n stats: HMSHLSPlayerStats;\n error: HMSHLSPlayerStatsError | undefined;\n changeStats(stats: HMSHLSPlayerStats): void;\n setError(error: HMSHLSPlayerStatsError): void;\n reset(): void;\n}\n\nexport interface HLSPlayerClosedCaptionsSlice {\n subtitles: string | null;\n setSubtitles(subtitles: string | null): void;\n}\n\n//#endregion HLS Player Stats Slice\n\n//#region Polls Slice\n\nexport type HMSPollsSlice = {\n polls: Record<string, HMSPoll>;\n setPolls(poll: HMSPoll): void;\n};\n\n//#endregion Polls Slice\n"],"mappings":"","ignoreList":[]}
|
package/lib/module/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["HMSHLSPlayerPlaybackEventTypes","HMSHLSPlayerPlaybackState","HMSHLSPlayerStatsEventTypes"],"sources":["types.ts"],"sourcesContent":["// Base HMSHLSPlayer Event\ntype HMSHLSPlayerEvent<T extends string, U> = {\n event: T;\n data: U;\n};\n\n// #region HMSHLSPlayer Playback Events\n\nexport enum HMSHLSPlayerPlaybackEventTypes {\n ON_PLAYBACK_CUE_EVENT = 'ON_PLAYBACK_CUE_EVENT',\n ON_PLAYBACK_FAILURE_EVENT = 'ON_PLAYBACK_FAILURE_EVENT',\n ON_PLAYBACK_STATE_CHANGE_EVENT = 'ON_PLAYBACK_STATE_CHANGE_EVENT',\n ON_PLAYBACK_RESOLUTION_CHANGE_EVENT = 'ON_PLAYBACK_RESOLUTION_CHANGE_EVENT',\n}\n\nexport type HMSHLSPlayerPlaybackCueEventData = {\n id?: string;\n endDate?: string;\n payloadval?: string;\n startDate: string;\n};\n\nexport type HMSHLSPlayerPlaybackFailureEventData = {\n error: {\n errorCode: number;\n errorCodeName: string;\n message?: string;\n };\n};\n\nexport enum HMSHLSPlayerPlaybackState {\n BUFFERING = 'buffering',\n FAILED = 'failed',\n PAUSED = 'paused',\n PLAYING = 'playing',\n STOPPED = 'stopped',\n UNKNOWN = 'unknown',\n}\n\nexport type HMSHLSPlayerPlaybackStateChangeEventData = {\n state: HMSHLSPlayerPlaybackState;\n};\n\nexport type HMSHLSPlayerPlaybackResolutionChangeEventData = {\n width: number;\n height: number;\n};\n\ntype HMSHLSPlayerPlaybackCueEvent = HMSHLSPlayerEvent<\n HMSHLSPlayerPlaybackEventTypes.ON_PLAYBACK_CUE_EVENT,\n HMSHLSPlayerPlaybackCueEventData\n>;\n\ntype HMSHLSPlayerPlaybackFailureEvent = HMSHLSPlayerEvent<\n HMSHLSPlayerPlaybackEventTypes.ON_PLAYBACK_FAILURE_EVENT,\n HMSHLSPlayerPlaybackFailureEventData\n>;\n\ntype HMSHLSPlayerPlaybackStateChangeEvent = HMSHLSPlayerEvent<\n HMSHLSPlayerPlaybackEventTypes.ON_PLAYBACK_STATE_CHANGE_EVENT,\n HMSHLSPlayerPlaybackStateChangeEventData\n>;\n\ntype HMSHLSPLayerPlaybackResolutionChangeEvent = HMSHLSPlayerEvent<\n HMSHLSPlayerPlaybackEventTypes.ON_PLAYBACK_RESOLUTION_CHANGE_EVENT,\n HMSHLSPlayerPlaybackResolutionChangeEventData\n>;\n\nexport type HMSHLSPlayerPlaybackEvent =\n | HMSHLSPlayerPlaybackCueEvent\n | HMSHLSPlayerPlaybackFailureEvent\n | HMSHLSPlayerPlaybackStateChangeEvent\n | HMSHLSPLayerPlaybackResolutionChangeEvent;\n\n// #endregion HMS HLSPlayer Playback Events\n\n// #region HMS HLSPlayer Stats Events\n\nexport enum HMSHLSPlayerStatsEventTypes {\n ON_STATS_EVENT_ERROR = 'ON_STATS_EVENT_ERROR',\n ON_STATS_EVENT_UPDATE = 'ON_STATS_EVENT_UPDATE',\n}\n\nexport type HMSHLSPlayerStatsErrorEventData = {\n action: string;\n code: number;\n description: string;\n isTerminal: boolean;\n message: string;\n name: string;\n};\n\nexport type HMSHLSPlayerStatsUpdateEventData = {\n // bandwidth\n bandWidthEstimate: number;\n totalBytesLoaded: number;\n\n // bufferedDuration\n bufferedDuration: number;\n\n // distanceFromLive\n distanceFromLive: number;\n\n // frameInfo\n droppedFrameCount: number;\n\n // videoInfo\n averageBitrate: number;\n\n videoHeight: number;\n videoWidth: number;\n};\n\ntype HMSHLSPlayerStatsErrorEvent = HMSHLSPlayerEvent<\n HMSHLSPlayerStatsEventTypes.ON_STATS_EVENT_ERROR,\n HMSHLSPlayerStatsErrorEventData\n>;\n\ntype HMSHLSPlayerStatsUpdateEvent = HMSHLSPlayerEvent<\n HMSHLSPlayerStatsEventTypes.ON_STATS_EVENT_UPDATE,\n HMSHLSPlayerStatsUpdateEventData\n>;\n\nexport type HMSHLSPlayerStatsEvent =\n | HMSHLSPlayerStatsErrorEvent\n | HMSHLSPlayerStatsUpdateEvent;\n\n// #endregion HMS HLSPlayer Stats Events\n\n// #region Utility types\n// #endregion Utility types\n"],"mappings":"AAAA;;AAMA;;AAEA,WAAYA,8BAA8B,0BAA9BA,8BAA8B;EAA9BA,8BAA8B;EAA9BA,8BAA8B;EAA9BA,8BAA8B;EAA9BA,8BAA8B;EAAA,OAA9BA,8BAA8B;AAAA;AAsB1C,WAAYC,yBAAyB,0BAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAA,OAAzBA,yBAAyB;AAAA;AA4CrC;;AAEA;;AAEA,WAAYC,2BAA2B,0BAA3BA,2BAA2B;EAA3BA,2BAA2B;EAA3BA,2BAA2B;EAAA,OAA3BA,2BAA2B;AAAA;;
|
|
1
|
+
{"version":3,"names":["HMSHLSPlayerPlaybackEventTypes","HMSHLSPlayerPlaybackState","HMSHLSPlayerStatsEventTypes"],"sources":["types.ts"],"sourcesContent":["// Base HMSHLSPlayer Event\ntype HMSHLSPlayerEvent<T extends string, U> = {\n event: T;\n data: U;\n};\n\n// #region HMSHLSPlayer Playback Events\n\nexport enum HMSHLSPlayerPlaybackEventTypes {\n ON_PLAYBACK_CUE_EVENT = 'ON_PLAYBACK_CUE_EVENT',\n ON_PLAYBACK_FAILURE_EVENT = 'ON_PLAYBACK_FAILURE_EVENT',\n ON_PLAYBACK_STATE_CHANGE_EVENT = 'ON_PLAYBACK_STATE_CHANGE_EVENT',\n ON_PLAYBACK_RESOLUTION_CHANGE_EVENT = 'ON_PLAYBACK_RESOLUTION_CHANGE_EVENT',\n}\n\nexport type HMSHLSPlayerPlaybackCueEventData = {\n id?: string;\n endDate?: string;\n payloadval?: string;\n startDate: string;\n};\n\nexport type HMSHLSPlayerPlaybackFailureEventData = {\n error: {\n errorCode: number;\n errorCodeName: string;\n message?: string;\n };\n};\n\nexport enum HMSHLSPlayerPlaybackState {\n BUFFERING = 'buffering',\n FAILED = 'failed',\n PAUSED = 'paused',\n PLAYING = 'playing',\n STOPPED = 'stopped',\n UNKNOWN = 'unknown',\n}\n\nexport type HMSHLSPlayerPlaybackStateChangeEventData = {\n state: HMSHLSPlayerPlaybackState;\n};\n\nexport type HMSHLSPlayerPlaybackResolutionChangeEventData = {\n width: number;\n height: number;\n};\n\ntype HMSHLSPlayerPlaybackCueEvent = HMSHLSPlayerEvent<\n HMSHLSPlayerPlaybackEventTypes.ON_PLAYBACK_CUE_EVENT,\n HMSHLSPlayerPlaybackCueEventData\n>;\n\ntype HMSHLSPlayerPlaybackFailureEvent = HMSHLSPlayerEvent<\n HMSHLSPlayerPlaybackEventTypes.ON_PLAYBACK_FAILURE_EVENT,\n HMSHLSPlayerPlaybackFailureEventData\n>;\n\ntype HMSHLSPlayerPlaybackStateChangeEvent = HMSHLSPlayerEvent<\n HMSHLSPlayerPlaybackEventTypes.ON_PLAYBACK_STATE_CHANGE_EVENT,\n HMSHLSPlayerPlaybackStateChangeEventData\n>;\n\ntype HMSHLSPLayerPlaybackResolutionChangeEvent = HMSHLSPlayerEvent<\n HMSHLSPlayerPlaybackEventTypes.ON_PLAYBACK_RESOLUTION_CHANGE_EVENT,\n HMSHLSPlayerPlaybackResolutionChangeEventData\n>;\n\nexport type HMSHLSPlayerPlaybackEvent =\n | HMSHLSPlayerPlaybackCueEvent\n | HMSHLSPlayerPlaybackFailureEvent\n | HMSHLSPlayerPlaybackStateChangeEvent\n | HMSHLSPLayerPlaybackResolutionChangeEvent;\n\n// #endregion HMS HLSPlayer Playback Events\n\n// #region HMS HLSPlayer Stats Events\n\nexport enum HMSHLSPlayerStatsEventTypes {\n ON_STATS_EVENT_ERROR = 'ON_STATS_EVENT_ERROR',\n ON_STATS_EVENT_UPDATE = 'ON_STATS_EVENT_UPDATE',\n}\n\nexport type HMSHLSPlayerStatsErrorEventData = {\n action: string;\n code: number;\n description: string;\n isTerminal: boolean;\n message: string;\n name: string;\n};\n\nexport type HMSHLSPlayerStatsUpdateEventData = {\n // bandwidth\n bandWidthEstimate: number;\n totalBytesLoaded: number;\n\n // bufferedDuration\n bufferedDuration: number;\n\n // distanceFromLive\n distanceFromLive: number;\n\n // frameInfo\n droppedFrameCount: number;\n\n // videoInfo\n averageBitrate: number;\n\n videoHeight: number;\n videoWidth: number;\n};\n\ntype HMSHLSPlayerStatsErrorEvent = HMSHLSPlayerEvent<\n HMSHLSPlayerStatsEventTypes.ON_STATS_EVENT_ERROR,\n HMSHLSPlayerStatsErrorEventData\n>;\n\ntype HMSHLSPlayerStatsUpdateEvent = HMSHLSPlayerEvent<\n HMSHLSPlayerStatsEventTypes.ON_STATS_EVENT_UPDATE,\n HMSHLSPlayerStatsUpdateEventData\n>;\n\nexport type HMSHLSPlayerStatsEvent =\n | HMSHLSPlayerStatsErrorEvent\n | HMSHLSPlayerStatsUpdateEvent;\n\nexport type HMSHLSPlayerCuesEvent = HMSHLSPlayerEvent<\n 'ON_CLOSED_CAPTION_UPDATE',\n string | null\n>;\n\nexport type RequestedDataEvent = {\n requestId: number;\n data: any;\n};\n\nexport type HLSPlayerDurationDetails = {\n streamDuration?: number;\n rollingWindowTime?: number;\n};\n\n// #endregion HMS HLSPlayer Stats Events\n\n// #region Utility types\n// #endregion Utility types\n"],"mappings":"AAAA;;AAMA;;AAEA,WAAYA,8BAA8B,0BAA9BA,8BAA8B;EAA9BA,8BAA8B;EAA9BA,8BAA8B;EAA9BA,8BAA8B;EAA9BA,8BAA8B;EAAA,OAA9BA,8BAA8B;AAAA;AAsB1C,WAAYC,yBAAyB,0BAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAA,OAAzBA,yBAAyB;AAAA;AA4CrC;;AAEA;;AAEA,WAAYC,2BAA2B,0BAA3BA,2BAA2B;EAA3BA,2BAA2B;EAA3BA,2BAA2B;EAAA,OAA3BA,2BAA2B;AAAA;;AAgEvC;;AAEA;AACA","ignoreList":[]}
|
|
@@ -34,6 +34,7 @@ import { HMSRemoteAudioStats } from './HMSRemoteAudioStats';
|
|
|
34
34
|
import { HMSRemoteVideoStats } from './HMSRemoteVideoStats';
|
|
35
35
|
import { HMSSimulcastLayerDefinition } from './HMSSimulcastLayerDefinition';
|
|
36
36
|
import { HMSQualityLimitationReasons } from './HMSQualityLimitationReasons';
|
|
37
|
+
import { HMSHLSPlaylistType } from './HMSHLSPlaylistType';
|
|
37
38
|
export declare class HMSEncoder {
|
|
38
39
|
private static data;
|
|
39
40
|
static clearData(): void;
|
|
@@ -72,6 +73,7 @@ export declare class HMSEncoder {
|
|
|
72
73
|
static encodeHLSStreamingState(data: any): HMSHLSStreamingState;
|
|
73
74
|
static encodeHLSRecordingState(data: any): HMSHLSRecordingState | undefined;
|
|
74
75
|
static encodeHLSVariants(data: any): HMSHLSVariant[];
|
|
76
|
+
static getHLSVariantPlaylistType(type: String): HMSHLSPlaylistType;
|
|
75
77
|
static encodeHMSNetworkQuality(data: any): HMSNetworkQuality | undefined;
|
|
76
78
|
static encodeHMSMessage(data: any): HMSMessage | undefined;
|
|
77
79
|
static encodeHMSMessageRecipient(data: any): HMSMessageRecipient;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
+
import type { HMSHLSPlaylistType } from './HMSHLSPlaylistType';
|
|
1
2
|
export declare class HMSHLSVariant {
|
|
2
3
|
hlsStreamUrl?: string;
|
|
3
4
|
meetingUrl?: string;
|
|
4
5
|
metadata?: string;
|
|
5
6
|
startedAt?: Date;
|
|
7
|
+
playlistType?: HMSHLSPlaylistType;
|
|
6
8
|
constructor(params: {
|
|
7
9
|
hlsStreamUrl?: string;
|
|
8
10
|
meetingUrl?: string;
|
|
9
11
|
metadata?: string;
|
|
10
12
|
startedAt?: Date;
|
|
13
|
+
playlistType?: HMSHLSPlaylistType;
|
|
11
14
|
});
|
|
12
15
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Class representing an HMS Noise Cancellation Plugin.
|
|
3
|
+
* Checkout {@link https://www.100ms.live/docs/react-native/v2/how-to-guides/extend-capabilities/noise-cancellation} for more info
|
|
3
4
|
*/
|
|
4
5
|
export declare class HMSNoiseCancellationPlugin {
|
|
5
6
|
modelName: HMSNoiseCancellationModels;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import type { HLSPlayerDurationDetails } from '../../types';
|
|
3
4
|
export interface HMSHLSPlayerProps {
|
|
4
5
|
url?: string;
|
|
5
6
|
style?: StyleProp<ViewStyle>;
|
|
@@ -17,5 +18,10 @@ export interface HMSHLSPlayerRefProperties {
|
|
|
17
18
|
seekBackward: (seconds: number) => void;
|
|
18
19
|
seekToLivePosition: () => void;
|
|
19
20
|
setVolume: (level: number) => void;
|
|
21
|
+
isClosedCaptionSupported: () => Promise<boolean>;
|
|
22
|
+
isClosedCaptionEnabled: () => Promise<boolean>;
|
|
23
|
+
enableClosedCaption: () => void;
|
|
24
|
+
disableClosedCaption: () => void;
|
|
25
|
+
getPlayerDurationDetails: () => Promise<HLSPlayerDurationDetails>;
|
|
20
26
|
}
|
|
21
27
|
export declare const HMSHLSPlayer: React.ForwardRefExoticComponent<HMSHLSPlayerProps & React.RefAttributes<HMSHLSPlayerRefProperties>>;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { StyleProp, NativeSyntheticEvent, ViewStyle, NativeMethods } from 'react-native';
|
|
2
|
-
import type { HMSHLSPlayerPlaybackEvent, HMSHLSPlayerStatsEvent } from '../../types';
|
|
2
|
+
import type { HMSHLSPlayerCuesEvent, HMSHLSPlayerPlaybackEvent, HMSHLSPlayerStatsEvent, RequestedDataEvent } from '../../types';
|
|
3
3
|
export type HmsHlsPlaybackEventHandler = (event: NativeSyntheticEvent<HMSHLSPlayerPlaybackEvent>) => void;
|
|
4
4
|
export type HmsHlsStatsEventHandler = (event: NativeSyntheticEvent<HMSHLSPlayerStatsEvent>) => void;
|
|
5
|
+
export type HlsSPlayerCuesEventHandler = (event: NativeSyntheticEvent<HMSHLSPlayerCuesEvent>) => void;
|
|
6
|
+
export type RequestedDataEventHandler = (event: NativeSyntheticEvent<RequestedDataEvent>) => void;
|
|
5
7
|
export type RCTHMSHLSPlayerProps = {
|
|
6
8
|
url?: string;
|
|
7
9
|
style?: StyleProp<ViewStyle>;
|
|
@@ -9,6 +11,8 @@ export type RCTHMSHLSPlayerProps = {
|
|
|
9
11
|
enableControls?: boolean;
|
|
10
12
|
onHmsHlsPlaybackEvent?: HmsHlsPlaybackEventHandler;
|
|
11
13
|
onHmsHlsStatsEvent?: HmsHlsStatsEventHandler;
|
|
14
|
+
onDataReturned?: RequestedDataEventHandler;
|
|
15
|
+
onHlsPlayerCuesEvent?: HlsSPlayerCuesEventHandler;
|
|
12
16
|
};
|
|
13
17
|
export declare const RCTHMSHLSPlayer: import("react-native").HostComponent<RCTHMSHLSPlayerProps>;
|
|
14
18
|
export type RCTHMSHLSPlayerRef = React.Component<RCTHMSHLSPlayerProps> & Readonly<NativeMethods>;
|
|
@@ -8,6 +8,8 @@ export declare const useHMSHLSPlayerStats: () => {
|
|
|
8
8
|
error: HMSHLSPlayerStatsError;
|
|
9
9
|
};
|
|
10
10
|
export declare const useHMSHLSPlayerStat: <T extends keyof HMSHLSPlayerStatsUpdateEventData>(stat: T) => HMSHLSPlayerStatsUpdateEventData[T];
|
|
11
|
+
export declare const useHMSHLSPlayerSubtitles: () => string | null;
|
|
12
|
+
export declare const useIsHLSStreamLive: (liveOffsetMillis?: number) => boolean;
|
|
11
13
|
export declare const useHMSHLSPlayerStatsError: (callback: (error: NonNullable<HMSHLSPlayerStatsError>) => void, deps: DependencyList) => void;
|
|
12
14
|
export declare const useHMSHLSPlayerPlaybackError: (callback: (error: NonNullable<HMSHLSPlayerPlaybackError>) => void, deps: DependencyList) => void;
|
|
13
15
|
export declare const useHMSHLSPlayerCue: (callback: (error: NonNullable<HMSHLSPlayerCue>) => void, deps: DependencyList) => void;
|
|
@@ -17,3 +19,4 @@ export declare const setHMSHLSPlayerCue: (cue: import("../../stores/types").HMSH
|
|
|
17
19
|
export declare const setHMSHLSPlayerPlaybackError: (error: HMSHLSPlayerPlaybackError) => void;
|
|
18
20
|
export declare const setHMSHLSPlayerStats: (stats: HMSHLSPlayerStatsUpdateEventData) => void;
|
|
19
21
|
export declare const setHMSHLSPlayerStatsError: (error: HMSHLSPlayerStatsError) => void;
|
|
22
|
+
export declare const setHMSHLSPlayerSubtitles: (subtitles: string | null) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './HMSHLSPlayer';
|
|
2
|
-
export { useHMSHLSPlayerPlaybackState, useHMSHLSPlayerCue, useHMSHLSPlayerPlaybackError, useHMSHLSPlayerStats, useHMSHLSPlayerStat, useHMSHLSPlayerStatsError, useHMSHLSPlayerResolution, } from './hooks';
|
|
2
|
+
export { useHMSHLSPlayerPlaybackState, useHMSHLSPlayerCue, useHMSHLSPlayerPlaybackError, useHMSHLSPlayerStats, useHMSHLSPlayerStat, useHMSHLSPlayerStatsError, useHMSHLSPlayerResolution, useHMSHLSPlayerSubtitles, useIsHLSStreamLive, } from './hooks';
|
|
@@ -83,6 +83,7 @@ export * from './classes/HMSCameraControl';
|
|
|
83
83
|
export * from './classes/HMSIOSAudioMode';
|
|
84
84
|
export * from './classes/HMSRecordingState';
|
|
85
85
|
export * from './classes/HMSStreamingState';
|
|
86
|
+
export * from './classes/HMSHLSPlaylistType';
|
|
86
87
|
export type { HMSSessionStore, JsonArray, JsonMap, JsonPrimitive, JsonValue, } from './classes/HMSSessionStore';
|
|
87
88
|
export type { HmsViewComponent as HMSView, HmsComponentProps as HMSViewProps, } from './classes/HmsView';
|
|
88
89
|
export type { HMSPIPConfig } from './classes/HMSPIPConfig';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import type { HMSHLSPlayerStatsStore } from './types';
|
|
2
|
+
export declare const useHMSHLSPlayerStatsStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<HMSHLSPlayerStatsStore>, "subscribe"> & {
|
|
2
3
|
subscribe: {
|
|
3
|
-
(listener: (selectedState:
|
|
4
|
-
<U>(selector: (state:
|
|
4
|
+
(listener: (selectedState: HMSHLSPlayerStatsStore, previousSelectedState: HMSHLSPlayerStatsStore) => void): () => void;
|
|
5
|
+
<U>(selector: (state: HMSHLSPlayerStatsStore) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
5
6
|
equalityFn?: ((a: U, b: U) => boolean) | undefined;
|
|
6
7
|
fireImmediately?: boolean | undefined;
|
|
7
8
|
} | undefined): () => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { HMSPoll } from '../classes/polls/HMSPoll';
|
|
2
2
|
import type { HMSHLSPlayerPlaybackState, HMSHLSPlayerPlaybackCueEventData, HMSHLSPlayerPlaybackFailureEventData, HMSHLSPlayerPlaybackResolutionChangeEventData, HMSHLSPlayerStatsErrorEventData, HMSHLSPlayerStatsUpdateEventData } from '../types';
|
|
3
3
|
export type HMSStore = HMSHLSPlayerPlaybackSlice & HMSViewsSlice;
|
|
4
|
-
export type HMSHLSPlayerStatsStore = HMSHLSPlayerStatsSlice;
|
|
4
|
+
export type HMSHLSPlayerStatsStore = HMSHLSPlayerStatsSlice & HLSPlayerClosedCaptionsSlice;
|
|
5
5
|
export type HMSInteractivityStore = HMSPollsSlice;
|
|
6
6
|
export type TrackId = string;
|
|
7
7
|
export type Resolution = {
|
|
@@ -28,6 +28,7 @@ export interface HMSHLSPlayerPlaybackSlice {
|
|
|
28
28
|
setPlaybackState(playbackState: HMSHLSPlayerPlaybackState): void;
|
|
29
29
|
setResolution(resolution: HMSHLSPlayerResolution): void;
|
|
30
30
|
setPlaybackError(error: HMSHLSPlayerPlaybackError): void;
|
|
31
|
+
resetPlaybackSlice(): void;
|
|
31
32
|
}
|
|
32
33
|
export type HMSHLSPlayerStats = HMSHLSPlayerStatsUpdateEventData;
|
|
33
34
|
export type HMSHLSPlayerStatsError = HMSHLSPlayerStatsErrorEventData | undefined;
|
|
@@ -36,6 +37,11 @@ export interface HMSHLSPlayerStatsSlice {
|
|
|
36
37
|
error: HMSHLSPlayerStatsError | undefined;
|
|
37
38
|
changeStats(stats: HMSHLSPlayerStats): void;
|
|
38
39
|
setError(error: HMSHLSPlayerStatsError): void;
|
|
40
|
+
reset(): void;
|
|
41
|
+
}
|
|
42
|
+
export interface HLSPlayerClosedCaptionsSlice {
|
|
43
|
+
subtitles: string | null;
|
|
44
|
+
setSubtitles(subtitles: string | null): void;
|
|
39
45
|
}
|
|
40
46
|
export type HMSPollsSlice = {
|
|
41
47
|
polls: Record<string, HMSPoll>;
|
|
@@ -66,4 +66,13 @@ export type HMSHLSPlayerStatsUpdateEventData = {
|
|
|
66
66
|
type HMSHLSPlayerStatsErrorEvent = HMSHLSPlayerEvent<HMSHLSPlayerStatsEventTypes.ON_STATS_EVENT_ERROR, HMSHLSPlayerStatsErrorEventData>;
|
|
67
67
|
type HMSHLSPlayerStatsUpdateEvent = HMSHLSPlayerEvent<HMSHLSPlayerStatsEventTypes.ON_STATS_EVENT_UPDATE, HMSHLSPlayerStatsUpdateEventData>;
|
|
68
68
|
export type HMSHLSPlayerStatsEvent = HMSHLSPlayerStatsErrorEvent | HMSHLSPlayerStatsUpdateEvent;
|
|
69
|
+
export type HMSHLSPlayerCuesEvent = HMSHLSPlayerEvent<'ON_CLOSED_CAPTION_UPDATE', string | null>;
|
|
70
|
+
export type RequestedDataEvent = {
|
|
71
|
+
requestId: number;
|
|
72
|
+
data: any;
|
|
73
|
+
};
|
|
74
|
+
export type HLSPlayerDurationDetails = {
|
|
75
|
+
streamDuration?: number;
|
|
76
|
+
rollingWindowTime?: number;
|
|
77
|
+
};
|
|
69
78
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@100mslive/react-native-hms",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.4",
|
|
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
|
@@ -40,6 +40,7 @@ import { HMSLayer } from './HMSLayer';
|
|
|
40
40
|
import { HMSSimulcastLayerDefinition } from './HMSSimulcastLayerDefinition';
|
|
41
41
|
import { HMSQualityLimitationReasons } from './HMSQualityLimitationReasons';
|
|
42
42
|
import { HMSTrackType } from './HMSTrackType';
|
|
43
|
+
import { HMSHLSPlaylistType } from './HMSHLSPlaylistType';
|
|
43
44
|
|
|
44
45
|
interface InitialData {
|
|
45
46
|
roles: Record<string, HMSRole>;
|
|
@@ -520,6 +521,9 @@ export class HMSEncoder {
|
|
|
520
521
|
meetingUrl: item.meetingUrl,
|
|
521
522
|
metadata: item?.metaData ? item?.metadata : undefined,
|
|
522
523
|
startedAt: HMSEncoder.encodeDate(item?.startedAt),
|
|
524
|
+
playlistType: item?.playlistType
|
|
525
|
+
? this.getHLSVariantPlaylistType(item.playlistType.toUpperCase())
|
|
526
|
+
: undefined,
|
|
523
527
|
});
|
|
524
528
|
variants.push(variant);
|
|
525
529
|
});
|
|
@@ -527,6 +531,15 @@ export class HMSEncoder {
|
|
|
527
531
|
return variants;
|
|
528
532
|
}
|
|
529
533
|
|
|
534
|
+
static getHLSVariantPlaylistType(type: String) {
|
|
535
|
+
switch (type) {
|
|
536
|
+
case 'DVR':
|
|
537
|
+
return HMSHLSPlaylistType.DVR;
|
|
538
|
+
default:
|
|
539
|
+
return HMSHLSPlaylistType.noDVR;
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
|
|
530
543
|
static encodeHMSNetworkQuality(data: any) {
|
|
531
544
|
if (data) {
|
|
532
545
|
return new HMSNetworkQuality({
|
|
@@ -1,18 +1,23 @@
|
|
|
1
|
+
import type { HMSHLSPlaylistType } from './HMSHLSPlaylistType';
|
|
2
|
+
|
|
1
3
|
export class HMSHLSVariant {
|
|
2
4
|
hlsStreamUrl?: string;
|
|
3
5
|
meetingUrl?: string;
|
|
4
6
|
metadata?: string;
|
|
5
7
|
startedAt?: Date;
|
|
8
|
+
playlistType?: HMSHLSPlaylistType;
|
|
6
9
|
|
|
7
10
|
constructor(params: {
|
|
8
11
|
hlsStreamUrl?: string;
|
|
9
12
|
meetingUrl?: string;
|
|
10
13
|
metadata?: string;
|
|
11
14
|
startedAt?: Date;
|
|
15
|
+
playlistType?: HMSHLSPlaylistType;
|
|
12
16
|
}) {
|
|
13
17
|
this.hlsStreamUrl = params.hlsStreamUrl;
|
|
14
18
|
this.meetingUrl = params.meetingUrl;
|
|
15
19
|
this.metadata = params.metadata;
|
|
16
20
|
this.startedAt = params.startedAt;
|
|
21
|
+
this.playlistType = params.playlistType;
|
|
17
22
|
}
|
|
18
23
|
}
|
|
@@ -4,6 +4,7 @@ import { logger } from './HMSLogger';
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Class representing an HMS Noise Cancellation Plugin.
|
|
7
|
+
* Checkout {@link https://www.100ms.live/docs/react-native/v2/how-to-guides/extend-capabilities/noise-cancellation} for more info
|
|
7
8
|
*/
|
|
8
9
|
export class HMSNoiseCancellationPlugin {
|
|
9
10
|
modelName: HMSNoiseCancellationModels;
|