@100mslive/hms-video-store 0.2.73 → 0.2.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/hmsSDKStore/HMSPlaylist.d.ts +1 -0
- package/dist/core/hmsSDKStore/adapter.d.ts +2 -0
- package/dist/core/schema/playlist.d.ts +9 -0
- package/dist/core/selectors/selectors.d.ts +1 -1
- package/dist/hms-video-store.cjs.development.js +45 -13
- package/dist/hms-video-store.cjs.development.js.map +1 -1
- package/dist/hms-video-store.cjs.production.min.js +1 -1
- package/dist/hms-video-store.cjs.production.min.js.map +1 -1
- package/dist/hms-video-store.esm.js +45 -13
- package/dist/hms-video-store.esm.js.map +1 -1
- package/dist/test/fixtures.d.ts +2 -2
- package/package.json +44 -9
- package/src/core/hmsSDKStore/HMSNotifications.ts +1 -1
- package/src/core/hmsSDKStore/HMSPlaylist.ts +5 -0
- package/src/core/hmsSDKStore/adapter.ts +1 -0
- package/src/core/schema/playlist.ts +9 -0
- package/src/core/schema/schema.ts +2 -0
- package/src/core/selectors/playlistselectors.ts +7 -1
- package/src/test/fakeStore.ts +2 -0
- package/src/test/unit/selectors.test.ts +4 -0
|
@@ -25,6 +25,7 @@ export declare class SDKToHMS {
|
|
|
25
25
|
progress: number;
|
|
26
26
|
volume: number;
|
|
27
27
|
currentTime: number;
|
|
28
|
+
playbackRate: number;
|
|
28
29
|
};
|
|
29
30
|
video: {
|
|
30
31
|
list: Record<string, HMSPlaylistItem<any>>;
|
|
@@ -36,6 +37,7 @@ export declare class SDKToHMS {
|
|
|
36
37
|
progress: number;
|
|
37
38
|
volume: number;
|
|
38
39
|
currentTime: number;
|
|
40
|
+
playbackRate: number;
|
|
39
41
|
};
|
|
40
42
|
};
|
|
41
43
|
static convertPlaylistItem<T>(playlistManager: sdkTypes.HMSPlaylistManager, playlistItem: sdkTypes.HMSPlaylistItem<T>): HMSPlaylistItem<T>;
|
|
@@ -25,6 +25,7 @@ export interface HMSPlaylist<T> {
|
|
|
25
25
|
progress: number;
|
|
26
26
|
volume: number;
|
|
27
27
|
currentTime: number;
|
|
28
|
+
playbackRate: number;
|
|
28
29
|
};
|
|
29
30
|
video: {
|
|
30
31
|
list: Record<string, HMSPlaylistItem<T>>;
|
|
@@ -32,6 +33,7 @@ export interface HMSPlaylist<T> {
|
|
|
32
33
|
progress: number;
|
|
33
34
|
volume: number;
|
|
34
35
|
currentTime: number;
|
|
36
|
+
playbackRate: number;
|
|
35
37
|
};
|
|
36
38
|
}
|
|
37
39
|
export interface IHMSPlaylistActions {
|
|
@@ -81,6 +83,12 @@ export interface IHMSPlaylistActions {
|
|
|
81
83
|
* @param {boolean} autoplay
|
|
82
84
|
*/
|
|
83
85
|
setIsAutoplayOn(autoplay: boolean): void;
|
|
86
|
+
/**
|
|
87
|
+
* Control the playback speed - 1.0 being normal, less than 1.0 will play it slowly
|
|
88
|
+
* and more than 1.0 will play it faster.
|
|
89
|
+
* @param playbackRate - value from 0.25 and 2.0
|
|
90
|
+
*/
|
|
91
|
+
setPlaybackRate(playbackRate: number): void;
|
|
84
92
|
}
|
|
85
93
|
export interface HMSPlaylistSelector {
|
|
86
94
|
list: <T>(store: HMSStore) => HMSPlaylistItem<T>[];
|
|
@@ -97,4 +105,5 @@ export interface HMSPlaylistSelector {
|
|
|
97
105
|
progress: (store: HMSStore) => number;
|
|
98
106
|
volume: (store: HMSStore) => number;
|
|
99
107
|
currentTime: (store: HMSStore) => number;
|
|
108
|
+
playbackRate: (store: HMSStore) => number;
|
|
100
109
|
}
|
|
@@ -39,7 +39,7 @@ export declare const selectLocalMediaSettings: (store: HMSStore) => import("../s
|
|
|
39
39
|
* }
|
|
40
40
|
* ```
|
|
41
41
|
*/
|
|
42
|
-
export declare const selectDevices: (store: HMSStore) =>
|
|
42
|
+
export declare const selectDevices: (store: HMSStore) => import("@100mslive/hms-video/dist/interfaces/HMSDeviceManager").DeviceMap;
|
|
43
43
|
export declare const selectSpeakers: (store: HMSStore) => Record<string, import("../schema").HMSSpeaker>;
|
|
44
44
|
/**
|
|
45
45
|
* Select a boolean flag denoting whether you've joined a room.
|
|
@@ -9,7 +9,7 @@ var create = _interopDefault(require('zustand/vanilla'));
|
|
|
9
9
|
var shallow = _interopDefault(require('zustand/shallow'));
|
|
10
10
|
var sdkTypes = require('@100mslive/hms-video');
|
|
11
11
|
var reselect = require('reselect');
|
|
12
|
-
var
|
|
12
|
+
var eventemitter2 = require('eventemitter2');
|
|
13
13
|
|
|
14
14
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
15
15
|
try {
|
|
@@ -911,7 +911,8 @@ var createDefaultStoreState = function createDefaultStoreState() {
|
|
|
911
911
|
},
|
|
912
912
|
progress: 0,
|
|
913
913
|
volume: 0,
|
|
914
|
-
currentTime: 0
|
|
914
|
+
currentTime: 0,
|
|
915
|
+
playbackRate: 1.0
|
|
915
916
|
},
|
|
916
917
|
video: {
|
|
917
918
|
list: {},
|
|
@@ -922,7 +923,8 @@ var createDefaultStoreState = function createDefaultStoreState() {
|
|
|
922
923
|
},
|
|
923
924
|
progress: 0,
|
|
924
925
|
volume: 0,
|
|
925
|
-
currentTime: 0
|
|
926
|
+
currentTime: 0,
|
|
927
|
+
playbackRate: 1.0
|
|
926
928
|
}
|
|
927
929
|
},
|
|
928
930
|
messages: {
|
|
@@ -1309,7 +1311,8 @@ var SDKToHMS = /*#__PURE__*/function () {
|
|
|
1309
1311
|
},
|
|
1310
1312
|
progress: progress,
|
|
1311
1313
|
volume: volume,
|
|
1312
|
-
currentTime: playlistManager.getCurrentTime(type)
|
|
1314
|
+
currentTime: playlistManager.getCurrentTime(type),
|
|
1315
|
+
playbackRate: playlistManager.getPlaybackRate(type)
|
|
1313
1316
|
};
|
|
1314
1317
|
};
|
|
1315
1318
|
|
|
@@ -1845,6 +1848,16 @@ var selectPlaylistCurrentTime = function selectPlaylistCurrentTime(type) {
|
|
|
1845
1848
|
};
|
|
1846
1849
|
};
|
|
1847
1850
|
|
|
1851
|
+
var selectPlaylistPlaybackRate = function selectPlaylistPlaybackRate(type) {
|
|
1852
|
+
if (type === void 0) {
|
|
1853
|
+
type = exports.HMSPlaylistType.audio;
|
|
1854
|
+
}
|
|
1855
|
+
|
|
1856
|
+
return function (store) {
|
|
1857
|
+
return store.playlist[type].playbackRate;
|
|
1858
|
+
};
|
|
1859
|
+
};
|
|
1860
|
+
|
|
1848
1861
|
var selectPlaylistVolume = function selectPlaylistVolume(type) {
|
|
1849
1862
|
if (type === void 0) {
|
|
1850
1863
|
type = exports.HMSPlaylistType.audio;
|
|
@@ -1887,6 +1900,7 @@ var selectAudioPlaylist = {
|
|
|
1887
1900
|
selection: /*#__PURE__*/selectPlaylistSelection(exports.HMSPlaylistType.audio),
|
|
1888
1901
|
progress: /*#__PURE__*/selectPlaylistProgress(exports.HMSPlaylistType.audio),
|
|
1889
1902
|
currentTime: /*#__PURE__*/selectPlaylistCurrentTime(exports.HMSPlaylistType.audio),
|
|
1903
|
+
playbackRate: /*#__PURE__*/selectPlaylistPlaybackRate(exports.HMSPlaylistType.audio),
|
|
1890
1904
|
volume: /*#__PURE__*/selectPlaylistVolume(exports.HMSPlaylistType.audio),
|
|
1891
1905
|
list: /*#__PURE__*/selectPlaylist(exports.HMSPlaylistType.audio),
|
|
1892
1906
|
selectedItem: /*#__PURE__*/selectPlaylistSelectedItem(exports.HMSPlaylistType.audio)
|
|
@@ -1894,7 +1908,8 @@ var selectAudioPlaylist = {
|
|
|
1894
1908
|
var selectVideoPlaylist = {
|
|
1895
1909
|
selection: /*#__PURE__*/selectPlaylistSelection(exports.HMSPlaylistType.video),
|
|
1896
1910
|
progress: /*#__PURE__*/selectPlaylistProgress(exports.HMSPlaylistType.video),
|
|
1897
|
-
currentTime: /*#__PURE__*/selectPlaylistCurrentTime(exports.HMSPlaylistType.
|
|
1911
|
+
currentTime: /*#__PURE__*/selectPlaylistCurrentTime(exports.HMSPlaylistType.video),
|
|
1912
|
+
playbackRate: /*#__PURE__*/selectPlaylistPlaybackRate(exports.HMSPlaylistType.video),
|
|
1898
1913
|
volume: /*#__PURE__*/selectPlaylistVolume(exports.HMSPlaylistType.video),
|
|
1899
1914
|
list: /*#__PURE__*/selectPlaylist(exports.HMSPlaylistType.video),
|
|
1900
1915
|
selectedItem: /*#__PURE__*/selectPlaylistSelectedItem(exports.HMSPlaylistType.video)
|
|
@@ -2496,6 +2511,10 @@ function isRemoteTrack(track) {
|
|
|
2496
2511
|
|
|
2497
2512
|
var HMSPlaylist = /*#__PURE__*/function () {
|
|
2498
2513
|
function HMSPlaylist(playlistManager, type, syncPlaylistState, store) {
|
|
2514
|
+
this.playlistManager = void 0;
|
|
2515
|
+
this.syncPlaylistState = void 0;
|
|
2516
|
+
this.store = void 0;
|
|
2517
|
+
this.type = void 0;
|
|
2499
2518
|
this.playlistManager = playlistManager;
|
|
2500
2519
|
this.syncPlaylistState = syncPlaylistState;
|
|
2501
2520
|
this.store = store;
|
|
@@ -2679,6 +2698,11 @@ var HMSPlaylist = /*#__PURE__*/function () {
|
|
|
2679
2698
|
this.playlistManager.setIsAutoplayOn(this.type, autoplay);
|
|
2680
2699
|
};
|
|
2681
2700
|
|
|
2701
|
+
_proto.setPlaybackRate = function setPlaybackRate(playbackRate) {
|
|
2702
|
+
this.playlistManager.setPlaybackRate(this.type, playbackRate);
|
|
2703
|
+
this.syncPlaylistState("set" + this.type + "PlaybackRate");
|
|
2704
|
+
};
|
|
2705
|
+
|
|
2682
2706
|
return HMSPlaylist;
|
|
2683
2707
|
}();
|
|
2684
2708
|
|
|
@@ -2704,12 +2728,18 @@ var HMSPlaylist = /*#__PURE__*/function () {
|
|
|
2704
2728
|
*/
|
|
2705
2729
|
|
|
2706
2730
|
var HMSSDKActions = /*#__PURE__*/function () {
|
|
2731
|
+
// private actionBatcher: ActionBatcher;
|
|
2707
2732
|
function HMSSDKActions(store, sdk, notificationManager) {
|
|
2708
2733
|
var _this = this;
|
|
2709
2734
|
|
|
2710
2735
|
this.hmsSDKTracks = {};
|
|
2711
2736
|
this.hmsSDKPeers = {};
|
|
2737
|
+
this.sdk = void 0;
|
|
2738
|
+
this.store = void 0;
|
|
2712
2739
|
this.isRoomJoinCalled = false;
|
|
2740
|
+
this.hmsNotifications = void 0;
|
|
2741
|
+
this.audioPlaylist = void 0;
|
|
2742
|
+
this.videoPlaylist = void 0;
|
|
2713
2743
|
|
|
2714
2744
|
this.setProgress = function (_ref) {
|
|
2715
2745
|
var type = _ref.type,
|
|
@@ -2747,12 +2777,6 @@ var HMSSDKActions = /*#__PURE__*/function () {
|
|
|
2747
2777
|
|
|
2748
2778
|
_this.hmsNotifications.sendPeerUpdate(type, peer);
|
|
2749
2779
|
};
|
|
2750
|
-
/**
|
|
2751
|
-
* setState is separate so any future changes to how state change can be done from one place.
|
|
2752
|
-
* @param fn
|
|
2753
|
-
* @param name
|
|
2754
|
-
*/
|
|
2755
|
-
|
|
2756
2780
|
|
|
2757
2781
|
this.setState = function (fn, name) {
|
|
2758
2782
|
return _this.store.namedSetState(fn, name);
|
|
@@ -4873,6 +4897,8 @@ var HMSNotifications = /*#__PURE__*/function () {
|
|
|
4873
4897
|
var _this = this;
|
|
4874
4898
|
|
|
4875
4899
|
this.id = 0;
|
|
4900
|
+
this.eventEmitter = void 0;
|
|
4901
|
+
this.store = void 0;
|
|
4876
4902
|
|
|
4877
4903
|
this.onNotification = function (cb) {
|
|
4878
4904
|
_this.eventEmitter.addListener(HMS_NOTIFICATION_EVENT, cb);
|
|
@@ -4883,7 +4909,7 @@ var HMSNotifications = /*#__PURE__*/function () {
|
|
|
4883
4909
|
};
|
|
4884
4910
|
|
|
4885
4911
|
this.store = store;
|
|
4886
|
-
this.eventEmitter = new
|
|
4912
|
+
this.eventEmitter = new eventemitter2.EventEmitter2();
|
|
4887
4913
|
}
|
|
4888
4914
|
|
|
4889
4915
|
var _proto = HMSNotifications.prototype;
|
|
@@ -4984,6 +5010,11 @@ var HMSNotifications = /*#__PURE__*/function () {
|
|
|
4984
5010
|
|
|
4985
5011
|
var HMSReactiveStore = /*#__PURE__*/function () {
|
|
4986
5012
|
function HMSReactiveStore(hmsStore, hmsActions, hmsNotifications) {
|
|
5013
|
+
this.actions = void 0;
|
|
5014
|
+
this.store = void 0;
|
|
5015
|
+
this.notifications = void 0;
|
|
5016
|
+
this.initialTriggerOnSubscribe = void 0;
|
|
5017
|
+
|
|
4987
5018
|
if (hmsStore) {
|
|
4988
5019
|
this.store = hmsStore;
|
|
4989
5020
|
} else {
|
|
@@ -5199,7 +5230,8 @@ var HMSReactiveStore = /*#__PURE__*/function () {
|
|
|
5199
5230
|
HMSReactiveStore.devtoolsOptions = function devtoolsOptions(prefix) {
|
|
5200
5231
|
return {
|
|
5201
5232
|
name: prefix,
|
|
5202
|
-
actionsBlacklist: ['audioLevel', 'playlistProgress']
|
|
5233
|
+
actionsBlacklist: ['audioLevel', 'playlistProgress'] // very high frequency update, pollutes the action history
|
|
5234
|
+
|
|
5203
5235
|
};
|
|
5204
5236
|
}
|
|
5205
5237
|
/**
|