@100mslive/react-native-hms 1.9.0 → 1.9.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/com/reactnativehmssdk/HMSAudioshareActivity.kt +1 -1
- package/android/src/main/java/com/reactnativehmssdk/HMSHLSPlayer.kt +4 -3
- package/android/src/main/java/com/reactnativehmssdk/HMSManager.kt +27 -22
- package/android/src/main/java/com/reactnativehmssdk/HMSRNSDK.kt +226 -249
- package/android/src/main/java/com/reactnativehmssdk/HMSView.kt +24 -4
- package/android/src/main/java/com/reactnativehmssdk/HmsScreenshareActivity.kt +1 -1
- package/ios/HMSHLSPlayerManager.swift +20 -11
- package/ios/HMSManager.m +40 -10
- package/ios/HMSManager.swift +20 -20
- package/ios/HMSRNSDK.swift +86 -85
- package/lib/commonjs/classes/HMSPIPConfig.js +4 -0
- package/lib/commonjs/classes/HMSPIPConfig.js.map +1 -0
- package/lib/commonjs/classes/HMSSDK.js +0 -2
- package/lib/commonjs/classes/HMSSDK.js.map +1 -1
- package/lib/commonjs/classes/HmsView.js +14 -1
- package/lib/commonjs/classes/HmsView.js.map +1 -1
- package/lib/commonjs/components/HMSHLSPlayer/HMSHLSPlayer.js +8 -5
- package/lib/commonjs/components/HMSHLSPlayer/HMSHLSPlayer.js.map +1 -1
- package/lib/commonjs/components/HMSHLSPlayer/hooks.js +6 -1
- package/lib/commonjs/components/HMSHLSPlayer/hooks.js.map +1 -1
- package/lib/commonjs/components/HMSHLSPlayer/index.js +8 -1
- package/lib/commonjs/components/HMSHLSPlayer/index.js.map +1 -1
- package/lib/commonjs/hooks/hmsviews.js +17 -0
- package/lib/commonjs/hooks/hmsviews.js.map +1 -0
- package/lib/commonjs/index.js +9 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/stores/hls-player-playback-slice.js +4 -0
- package/lib/commonjs/stores/hls-player-playback-slice.js.map +1 -1
- package/lib/commonjs/stores/hms-store.js +3 -1
- package/lib/commonjs/stores/hms-store.js.map +1 -1
- package/lib/commonjs/stores/hmsviews-slice.js +19 -0
- package/lib/commonjs/stores/hmsviews-slice.js.map +1 -0
- package/lib/commonjs/stores/types.js +9 -0
- package/lib/commonjs/stores/types.js.map +1 -1
- package/lib/commonjs/types.js +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/module/classes/HMSPIPConfig.js +2 -0
- package/lib/module/classes/HMSPIPConfig.js.map +1 -0
- package/lib/module/classes/HMSSDK.js +0 -3
- package/lib/module/classes/HMSSDK.js.map +1 -1
- package/lib/module/classes/HmsView.js +14 -1
- package/lib/module/classes/HmsView.js.map +1 -1
- package/lib/module/components/HMSHLSPlayer/HMSHLSPlayer.js +9 -6
- package/lib/module/components/HMSHLSPlayer/HMSHLSPlayer.js.map +1 -1
- package/lib/module/components/HMSHLSPlayer/hooks.js +4 -0
- 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/hooks/hmsviews.js +12 -0
- package/lib/module/hooks/hmsviews.js.map +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/stores/hls-player-playback-slice.js +4 -0
- package/lib/module/stores/hls-player-playback-slice.js.map +1 -1
- package/lib/module/stores/hms-store.js +3 -1
- package/lib/module/stores/hms-store.js.map +1 -1
- package/lib/module/stores/hmsviews-slice.js +12 -0
- package/lib/module/stores/hmsviews-slice.js.map +1 -0
- package/lib/module/stores/types.js +9 -0
- package/lib/module/stores/types.js.map +1 -1
- package/lib/module/types.js +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/typescript/classes/HMSPIPConfig.d.ts +7 -0
- package/lib/typescript/classes/HMSSDK.d.ts +3 -9
- package/lib/typescript/components/HMSHLSPlayer/hooks.d.ts +2 -0
- package/lib/typescript/components/HMSHLSPlayer/index.d.ts +1 -1
- package/lib/typescript/hooks/hmsviews.d.ts +3 -0
- package/lib/typescript/index.d.ts +2 -0
- package/lib/typescript/stores/hms-store.d.ts +4 -3
- package/lib/typescript/stores/hmsviews-slice.d.ts +5 -0
- package/lib/typescript/stores/types.d.ts +14 -2
- package/lib/typescript/types.d.ts +9 -5
- package/package.json +3 -1
- package/sdk-versions.json +1 -1
- package/src/classes/HMSPIPConfig.ts +7 -0
- package/src/classes/HMSSDK.tsx +3 -11
- package/src/classes/HmsView.tsx +16 -2
- package/src/components/HMSHLSPlayer/HMSHLSPlayer.tsx +11 -5
- package/src/components/HMSHLSPlayer/hooks.ts +7 -0
- package/src/components/HMSHLSPlayer/index.ts +1 -0
- package/src/hooks/hmsviews.ts +13 -0
- package/src/index.ts +2 -0
- package/src/stores/hls-player-playback-slice.ts +3 -0
- package/src/stores/hms-store.ts +2 -0
- package/src/stores/hmsviews-slice.ts +20 -0
- package/src/stores/types.ts +20 -1
- package/src/types.ts +13 -3
|
@@ -5,7 +5,8 @@ type HMSHLSPlayerEvent<T extends string, U> = {
|
|
|
5
5
|
export declare enum HMSHLSPlayerPlaybackEventTypes {
|
|
6
6
|
ON_PLAYBACK_CUE_EVENT = "ON_PLAYBACK_CUE_EVENT",
|
|
7
7
|
ON_PLAYBACK_FAILURE_EVENT = "ON_PLAYBACK_FAILURE_EVENT",
|
|
8
|
-
ON_PLAYBACK_STATE_CHANGE_EVENT = "ON_PLAYBACK_STATE_CHANGE_EVENT"
|
|
8
|
+
ON_PLAYBACK_STATE_CHANGE_EVENT = "ON_PLAYBACK_STATE_CHANGE_EVENT",
|
|
9
|
+
ON_PLAYBACK_RESOLUTION_CHANGE_EVENT = "ON_PLAYBACK_RESOLUTION_CHANGE_EVENT"
|
|
9
10
|
}
|
|
10
11
|
export type HMSHLSPlayerPlaybackCueEventData = {
|
|
11
12
|
id?: string;
|
|
@@ -26,17 +27,20 @@ export declare enum HMSHLSPlayerPlaybackState {
|
|
|
26
27
|
PAUSED = "paused",
|
|
27
28
|
PLAYING = "playing",
|
|
28
29
|
STOPPED = "stopped",
|
|
29
|
-
UNKNOWN = "unknown"
|
|
30
|
-
onVideoSizeChanged = "onVideoSizeChanged"
|
|
30
|
+
UNKNOWN = "unknown"
|
|
31
31
|
}
|
|
32
32
|
export type HMSHLSPlayerPlaybackStateChangeEventData = {
|
|
33
33
|
state: HMSHLSPlayerPlaybackState;
|
|
34
|
-
|
|
34
|
+
};
|
|
35
|
+
export type HMSHLSPlayerPlaybackResolutionChangeEventData = {
|
|
36
|
+
width: number;
|
|
37
|
+
height: number;
|
|
35
38
|
};
|
|
36
39
|
type HMSHLSPlayerPlaybackCueEvent = HMSHLSPlayerEvent<HMSHLSPlayerPlaybackEventTypes.ON_PLAYBACK_CUE_EVENT, HMSHLSPlayerPlaybackCueEventData>;
|
|
37
40
|
type HMSHLSPlayerPlaybackFailureEvent = HMSHLSPlayerEvent<HMSHLSPlayerPlaybackEventTypes.ON_PLAYBACK_FAILURE_EVENT, HMSHLSPlayerPlaybackFailureEventData>;
|
|
38
41
|
type HMSHLSPlayerPlaybackStateChangeEvent = HMSHLSPlayerEvent<HMSHLSPlayerPlaybackEventTypes.ON_PLAYBACK_STATE_CHANGE_EVENT, HMSHLSPlayerPlaybackStateChangeEventData>;
|
|
39
|
-
|
|
42
|
+
type HMSHLSPLayerPlaybackResolutionChangeEvent = HMSHLSPlayerEvent<HMSHLSPlayerPlaybackEventTypes.ON_PLAYBACK_RESOLUTION_CHANGE_EVENT, HMSHLSPlayerPlaybackResolutionChangeEventData>;
|
|
43
|
+
export type HMSHLSPlayerPlaybackEvent = HMSHLSPlayerPlaybackCueEvent | HMSHLSPlayerPlaybackFailureEvent | HMSHLSPlayerPlaybackStateChangeEvent | HMSHLSPLayerPlaybackResolutionChangeEvent;
|
|
40
44
|
export declare enum HMSHLSPlayerStatsEventTypes {
|
|
41
45
|
ON_STATS_EVENT_ERROR = "ON_STATS_EVENT_ERROR",
|
|
42
46
|
ON_STATS_EVENT_UPDATE = "ON_STATS_EVENT_UPDATE"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@100mslive/react-native-hms",
|
|
3
|
-
"version": "1.9.0",
|
|
3
|
+
"version": "1.9.1-beta.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",
|
|
@@ -17,6 +17,8 @@
|
|
|
17
17
|
"sdk-versions.json",
|
|
18
18
|
"!lib/typescript/example",
|
|
19
19
|
"!android/build",
|
|
20
|
+
"!android/.gradle",
|
|
21
|
+
"!android/.idea",
|
|
20
22
|
"!ios/build",
|
|
21
23
|
"!**/__tests__",
|
|
22
24
|
"!**/__fixtures__",
|
package/sdk-versions.json
CHANGED
package/src/classes/HMSSDK.tsx
CHANGED
|
@@ -45,18 +45,10 @@ import { HMSPeerUpdate, HMSPeerUpdateOrdinals } from './HMSPeerUpdate';
|
|
|
45
45
|
import { HMSSessionStore } from './HMSSessionStore';
|
|
46
46
|
import type { HMSPeerListIteratorOptions } from './HMSPeerListIteratorOptions';
|
|
47
47
|
import { HMSPeerListIterator } from './HMSPeerListIterator';
|
|
48
|
+
import type { HMSPIPConfig } from './HMSPIPConfig';
|
|
48
49
|
|
|
49
50
|
type HmsViewProps = Omit<HmsComponentProps, 'id'>;
|
|
50
51
|
|
|
51
|
-
// TODO: Rename to HMSPIPConfig & to be moved to a separate file
|
|
52
|
-
interface PIPConfig {
|
|
53
|
-
autoEnterPipMode?: boolean;
|
|
54
|
-
aspectRatio?: [number, number];
|
|
55
|
-
endButton?: boolean;
|
|
56
|
-
audioButton?: boolean;
|
|
57
|
-
videoButton?: boolean;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
52
|
const ReactNativeVersion = require('react-native/Libraries/Core/ReactNativeVersion');
|
|
61
53
|
|
|
62
54
|
let HmsSdk: HMSSDK | undefined;
|
|
@@ -2511,14 +2503,14 @@ export class HMSSDK {
|
|
|
2511
2503
|
return HMSManager.handlePipActions('isPipModeSupported', { id: this.id });
|
|
2512
2504
|
}
|
|
2513
2505
|
|
|
2514
|
-
async enterPipMode(data?:
|
|
2506
|
+
async enterPipMode(data?: HMSPIPConfig): Promise<undefined | boolean> {
|
|
2515
2507
|
return HMSManager.handlePipActions('enterPipMode', {
|
|
2516
2508
|
...data,
|
|
2517
2509
|
id: this.id,
|
|
2518
2510
|
});
|
|
2519
2511
|
}
|
|
2520
2512
|
|
|
2521
|
-
async setPipParams(data?:
|
|
2513
|
+
async setPipParams(data?: HMSPIPConfig): Promise<undefined | boolean> {
|
|
2522
2514
|
return HMSManager.handlePipActions('setPictureInPictureParams', {
|
|
2523
2515
|
...data,
|
|
2524
2516
|
id: this.id,
|
package/src/classes/HmsView.tsx
CHANGED
|
@@ -6,9 +6,10 @@ import {
|
|
|
6
6
|
UIManager,
|
|
7
7
|
Platform,
|
|
8
8
|
} from 'react-native';
|
|
9
|
-
import type { ViewStyle } from 'react-native';
|
|
9
|
+
import type { NativeSyntheticEvent, ViewStyle } from 'react-native';
|
|
10
10
|
import { HMSConstants } from './HMSConstants';
|
|
11
11
|
import { HMSVideoViewMode } from './HMSVideoViewMode';
|
|
12
|
+
import { setHmsViewsResolutionsState } from '../hooks/hmsviews';
|
|
12
13
|
|
|
13
14
|
interface HmsViewProps {
|
|
14
15
|
data: {
|
|
@@ -64,7 +65,20 @@ export const HmsViewComponent = React.forwardRef<any, HmsComponentProps>(
|
|
|
64
65
|
* This method is passed to `onChange` prop of `HmsView` Native Component.
|
|
65
66
|
* It is invoked when `HmsView` emits 'topChange' event.
|
|
66
67
|
*/
|
|
67
|
-
const onChange = (
|
|
68
|
+
const onChange = ({
|
|
69
|
+
nativeEvent,
|
|
70
|
+
}: NativeSyntheticEvent<{
|
|
71
|
+
data: { height: number; width: number };
|
|
72
|
+
event: 'ON_RESOLUTION_CHANGE_EVENT';
|
|
73
|
+
}>) => {
|
|
74
|
+
const { event, data } = nativeEvent;
|
|
75
|
+
|
|
76
|
+
setApplyStyles_ANDROID(true);
|
|
77
|
+
|
|
78
|
+
if (event === 'ON_RESOLUTION_CHANGE_EVENT') {
|
|
79
|
+
setHmsViewsResolutionsState(trackId, data);
|
|
80
|
+
}
|
|
81
|
+
};
|
|
68
82
|
|
|
69
83
|
/**
|
|
70
84
|
* This method is passed to `onDataReturned` prop of `HmsView` Native Component.
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
setHMSHLSPlayerCue,
|
|
7
7
|
setHMSHLSPlayerPlaybackError,
|
|
8
8
|
setHMSHLSPlayerPlaybackState,
|
|
9
|
+
setHMSHLSPlayerResolution,
|
|
9
10
|
setHMSHLSPlayerStats,
|
|
10
11
|
setHMSHLSPlayerStatsError,
|
|
11
12
|
} from './hooks';
|
|
@@ -198,13 +199,18 @@ const _HMSHLSPlayer: React.ForwardRefRenderFunction<
|
|
|
198
199
|
event === HMSHLSPlayerPlaybackEventTypes.ON_PLAYBACK_FAILURE_EVENT
|
|
199
200
|
) {
|
|
200
201
|
setHMSHLSPlayerPlaybackError(data.error);
|
|
202
|
+
} else if (
|
|
203
|
+
event === HMSHLSPlayerPlaybackEventTypes.ON_PLAYBACK_RESOLUTION_CHANGE_EVENT
|
|
204
|
+
) {
|
|
205
|
+
setHMSHLSPlayerResolution({...data});
|
|
206
|
+
|
|
207
|
+
const aspectRatio = data.width / data.height;
|
|
208
|
+
|
|
209
|
+
if (typeof aspectRatio === 'number' && !isNaN(aspectRatio)) {
|
|
210
|
+
setAspectRatio(aspectRatio);
|
|
211
|
+
}
|
|
201
212
|
} else {
|
|
202
213
|
setHMSHLSPlayerPlaybackState(data.state);
|
|
203
|
-
if (data.state === 'onVideoSizeChanged') {
|
|
204
|
-
if (typeof data.aspectRatio === 'number') {
|
|
205
|
-
setAspectRatio(data.aspectRatio);
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
214
|
}
|
|
209
215
|
};
|
|
210
216
|
|
|
@@ -17,6 +17,10 @@ export const useHMSHLSPlayerPlaybackState = () => {
|
|
|
17
17
|
return useHMSStore((state) => state.playbackState);
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
+
export const useHMSHLSPlayerResolution = () => {
|
|
21
|
+
return useHMSStore((state) => state.resolution);
|
|
22
|
+
};
|
|
23
|
+
|
|
20
24
|
export const useHMSHLSPlayerStats = () => {
|
|
21
25
|
return useHMSHLSPlayerStatsStore(
|
|
22
26
|
(state) => ({
|
|
@@ -89,6 +93,9 @@ export const useHMSHLSPlayerCue = (
|
|
|
89
93
|
export const setHMSHLSPlayerPlaybackState =
|
|
90
94
|
useHMSStore.getState().setPlaybackState;
|
|
91
95
|
|
|
96
|
+
export const setHMSHLSPlayerResolution =
|
|
97
|
+
useHMSStore.getState().setResolution;
|
|
98
|
+
|
|
92
99
|
export const setHMSHLSPlayerCue = useHMSStore.getState().setCue;
|
|
93
100
|
|
|
94
101
|
export const setHMSHLSPlayerPlaybackError =
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { TrackId } from '../stores/types';
|
|
2
|
+
import { useHMSStore } from '../stores/hms-store';
|
|
3
|
+
|
|
4
|
+
// use latest state (with component rerender)
|
|
5
|
+
|
|
6
|
+
export const useHmsViewsResolutionsState = (trackId?: TrackId) => {
|
|
7
|
+
return useHMSStore((state) => trackId ? state.hmsviewsResolutions[trackId] : undefined);
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
// state setters
|
|
11
|
+
|
|
12
|
+
export const setHmsViewsResolutionsState =
|
|
13
|
+
useHMSStore.getState().setHmsviewsResolutions;
|
package/src/index.ts
CHANGED
|
@@ -88,6 +88,7 @@ export type {
|
|
|
88
88
|
HmsViewComponent as HMSView,
|
|
89
89
|
HmsComponentProps as HMSViewProps,
|
|
90
90
|
} from './classes/HmsView';
|
|
91
|
+
export type { HMSPIPConfig } from './classes/HMSPIPConfig';
|
|
91
92
|
|
|
92
93
|
import { HMSSDK as HmsManager } from './classes/HMSSDK';
|
|
93
94
|
|
|
@@ -99,6 +100,7 @@ export * from './components/HMSHLSPlayer';
|
|
|
99
100
|
|
|
100
101
|
// 100ms Hooks
|
|
101
102
|
export * from './hooks/useHMSPeerUpdates';
|
|
103
|
+
export { useHmsViewsResolutionsState } from './hooks/hmsviews';
|
|
102
104
|
|
|
103
105
|
// 100ms types
|
|
104
106
|
export * from './types';
|
package/src/stores/hms-store.ts
CHANGED
|
@@ -2,10 +2,12 @@ import { create } from 'zustand';
|
|
|
2
2
|
import { subscribeWithSelector } from 'zustand/middleware';
|
|
3
3
|
|
|
4
4
|
import { createHMSHLSPlayerPlaybackSlice } from './hls-player-playback-slice';
|
|
5
|
+
import { createHMSViewsSlice } from './hmsviews-slice';
|
|
5
6
|
import type { HMSStore } from './types';
|
|
6
7
|
|
|
7
8
|
export const useHMSStore = create<HMSStore>()(
|
|
8
9
|
subscribeWithSelector((...a) => ({
|
|
9
10
|
...createHMSHLSPlayerPlaybackSlice(...a),
|
|
11
|
+
...createHMSViewsSlice(...a)
|
|
10
12
|
}))
|
|
11
13
|
);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { StateCreator } from 'zustand';
|
|
2
|
+
|
|
3
|
+
import type { HMSViewsSlice, HMSStore } from './types';
|
|
4
|
+
|
|
5
|
+
export const createHMSViewsSlice: StateCreator<
|
|
6
|
+
HMSStore,
|
|
7
|
+
[],
|
|
8
|
+
[],
|
|
9
|
+
HMSViewsSlice
|
|
10
|
+
> = (set) => ({
|
|
11
|
+
hmsviewsResolutions: {},
|
|
12
|
+
setHmsviewsResolutions: (trackId, resolution) => {
|
|
13
|
+
set((state) => ({
|
|
14
|
+
hmsviewsResolutions: {
|
|
15
|
+
...state.hmsviewsResolutions,
|
|
16
|
+
[trackId]: resolution,
|
|
17
|
+
},
|
|
18
|
+
}));
|
|
19
|
+
},
|
|
20
|
+
});
|
package/src/stores/types.ts
CHANGED
|
@@ -4,13 +4,28 @@ import type {
|
|
|
4
4
|
HMSHLSPlayerPlaybackState,
|
|
5
5
|
HMSHLSPlayerPlaybackCueEventData,
|
|
6
6
|
HMSHLSPlayerPlaybackFailureEventData,
|
|
7
|
+
HMSHLSPlayerPlaybackResolutionChangeEventData,
|
|
7
8
|
HMSHLSPlayerStatsErrorEventData,
|
|
8
9
|
HMSHLSPlayerStatsUpdateEventData,
|
|
9
10
|
} from '../types';
|
|
10
11
|
|
|
11
|
-
export type HMSStore = HMSHLSPlayerPlaybackSlice;
|
|
12
|
+
export type HMSStore = HMSHLSPlayerPlaybackSlice & HMSViewsSlice;
|
|
12
13
|
export type HMSHLSPlayerStatsStore = HMSHLSPlayerStatsSlice;
|
|
13
14
|
|
|
15
|
+
// HMSViews Slice
|
|
16
|
+
|
|
17
|
+
export type TrackId = string;
|
|
18
|
+
|
|
19
|
+
export type Resolution = {
|
|
20
|
+
width: number;
|
|
21
|
+
height: number;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export interface HMSViewsSlice {
|
|
25
|
+
hmsviewsResolutions: Record<TrackId, Resolution | undefined>;
|
|
26
|
+
setHmsviewsResolutions(trackId: TrackId, resolution: Resolution): void;
|
|
27
|
+
};
|
|
28
|
+
|
|
14
29
|
// HLS Player Playback Slice
|
|
15
30
|
|
|
16
31
|
export interface HMSHLSPlayerPlaybackCue
|
|
@@ -25,12 +40,16 @@ export type HMSHLSPlayerPlaybackError =
|
|
|
25
40
|
| HMSHLSPlayerPlaybackFailureEventData['error']
|
|
26
41
|
| undefined;
|
|
27
42
|
|
|
43
|
+
export type HMSHLSPlayerResolution = HMSHLSPlayerPlaybackResolutionChangeEventData | undefined;
|
|
44
|
+
|
|
28
45
|
export interface HMSHLSPlayerPlaybackSlice {
|
|
29
46
|
cue: HMSHLSPlayerCue;
|
|
30
47
|
playbackState: HMSHLSPlayerPlaybackState;
|
|
48
|
+
resolution: HMSHLSPlayerResolution;
|
|
31
49
|
error: HMSHLSPlayerPlaybackError;
|
|
32
50
|
setCue(cue: HMSHLSPlayerPlaybackCue): void;
|
|
33
51
|
setPlaybackState(playbackState: HMSHLSPlayerPlaybackState): void;
|
|
52
|
+
setResolution(resolution: HMSHLSPlayerResolution): void;
|
|
34
53
|
setPlaybackError(error: HMSHLSPlayerPlaybackError): void;
|
|
35
54
|
}
|
|
36
55
|
|
package/src/types.ts
CHANGED
|
@@ -10,6 +10,7 @@ export enum HMSHLSPlayerPlaybackEventTypes {
|
|
|
10
10
|
ON_PLAYBACK_CUE_EVENT = 'ON_PLAYBACK_CUE_EVENT',
|
|
11
11
|
ON_PLAYBACK_FAILURE_EVENT = 'ON_PLAYBACK_FAILURE_EVENT',
|
|
12
12
|
ON_PLAYBACK_STATE_CHANGE_EVENT = 'ON_PLAYBACK_STATE_CHANGE_EVENT',
|
|
13
|
+
ON_PLAYBACK_RESOLUTION_CHANGE_EVENT = 'ON_PLAYBACK_RESOLUTION_CHANGE_EVENT',
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
export type HMSHLSPlayerPlaybackCueEventData = {
|
|
@@ -34,12 +35,15 @@ export enum HMSHLSPlayerPlaybackState {
|
|
|
34
35
|
PLAYING = 'playing',
|
|
35
36
|
STOPPED = 'stopped',
|
|
36
37
|
UNKNOWN = 'unknown',
|
|
37
|
-
onVideoSizeChanged = 'onVideoSizeChanged',
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
export type HMSHLSPlayerPlaybackStateChangeEventData = {
|
|
41
41
|
state: HMSHLSPlayerPlaybackState;
|
|
42
|
-
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export type HMSHLSPlayerPlaybackResolutionChangeEventData = {
|
|
45
|
+
width: number;
|
|
46
|
+
height: number;
|
|
43
47
|
};
|
|
44
48
|
|
|
45
49
|
type HMSHLSPlayerPlaybackCueEvent = HMSHLSPlayerEvent<
|
|
@@ -57,10 +61,16 @@ type HMSHLSPlayerPlaybackStateChangeEvent = HMSHLSPlayerEvent<
|
|
|
57
61
|
HMSHLSPlayerPlaybackStateChangeEventData
|
|
58
62
|
>;
|
|
59
63
|
|
|
64
|
+
type HMSHLSPLayerPlaybackResolutionChangeEvent = HMSHLSPlayerEvent<
|
|
65
|
+
HMSHLSPlayerPlaybackEventTypes.ON_PLAYBACK_RESOLUTION_CHANGE_EVENT,
|
|
66
|
+
HMSHLSPlayerPlaybackResolutionChangeEventData
|
|
67
|
+
>;
|
|
68
|
+
|
|
60
69
|
export type HMSHLSPlayerPlaybackEvent =
|
|
61
70
|
| HMSHLSPlayerPlaybackCueEvent
|
|
62
71
|
| HMSHLSPlayerPlaybackFailureEvent
|
|
63
|
-
| HMSHLSPlayerPlaybackStateChangeEvent
|
|
72
|
+
| HMSHLSPlayerPlaybackStateChangeEvent
|
|
73
|
+
| HMSHLSPLayerPlaybackResolutionChangeEvent;
|
|
64
74
|
|
|
65
75
|
// #endregion HMS HLSPlayer Playback Events
|
|
66
76
|
|