@100mslive/react-native-hms 1.2.0 → 1.3.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/README.md +2 -2
- package/android/src/main/java/com/reactnativehmssdk/HMSDecoder.kt +121 -53
- package/android/src/main/java/com/reactnativehmssdk/HMSManager.kt +14 -0
- package/android/src/main/java/com/reactnativehmssdk/HMSRNSDK.kt +139 -31
- package/ios/HMSDecoder.swift +113 -50
- package/ios/HMSManager.m +4 -0
- package/ios/HMSManager.swift +15 -1
- package/ios/HMSRNSDK.swift +119 -26
- package/ios/HMSView.swift +1 -1
- package/lib/commonjs/classes/HMSAudioCodec.js +4 -4
- package/lib/commonjs/classes/HMSAudioCodec.js.map +1 -1
- package/lib/commonjs/classes/HMSAudioDevice.js +4 -4
- package/lib/commonjs/classes/HMSAudioDevice.js.map +1 -1
- package/lib/commonjs/classes/HMSAudioFilePlayerNode.js.map +1 -1
- package/lib/commonjs/classes/HMSAudioMixerSource.js.map +1 -1
- package/lib/commonjs/classes/HMSAudioMixingMode.js +4 -4
- package/lib/commonjs/classes/HMSAudioMixingMode.js.map +1 -1
- package/lib/commonjs/classes/HMSAudioMode.js +4 -4
- package/lib/commonjs/classes/HMSAudioMode.js.map +1 -1
- package/lib/commonjs/classes/HMSAudioNode.js +2 -1
- package/lib/commonjs/classes/HMSAudioNode.js.map +1 -1
- package/lib/commonjs/classes/HMSAudioSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSAudioTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSAudioTrackSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSBrowserRecordingState.js.map +1 -1
- package/lib/commonjs/classes/HMSCameraFacing.js +4 -4
- package/lib/commonjs/classes/HMSCameraFacing.js.map +1 -1
- package/lib/commonjs/classes/HMSChangeTrackStateRequest.js.map +1 -1
- package/lib/commonjs/classes/HMSConfig.js.map +1 -1
- package/lib/commonjs/classes/HMSConstants.js +11 -0
- package/lib/commonjs/classes/HMSConstants.js.map +1 -0
- package/lib/commonjs/classes/HMSEncoder.js +21 -43
- package/lib/commonjs/classes/HMSEncoder.js.map +1 -1
- package/lib/commonjs/classes/HMSException.js.map +1 -1
- package/lib/commonjs/classes/HMSHLSConfig.js.map +1 -1
- package/lib/commonjs/classes/HMSHLSMeetingURLVariant.js.map +1 -1
- package/lib/commonjs/classes/HMSHLSRecordingConfig.js.map +1 -1
- package/lib/commonjs/classes/HMSHLSRecordingState.js.map +1 -1
- package/lib/commonjs/classes/HMSHLSStreamingState.js.map +1 -1
- package/lib/commonjs/classes/HMSHLSVariant.js.map +1 -1
- package/lib/commonjs/classes/HMSHelper.js.map +1 -1
- package/lib/commonjs/classes/HMSLocalAudioStats.js.map +1 -1
- package/lib/commonjs/classes/HMSLocalAudioTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSLocalPeer.js +0 -1
- package/lib/commonjs/classes/HMSLocalPeer.js.map +1 -1
- package/lib/commonjs/classes/HMSLocalVideoStats.js.map +1 -1
- package/lib/commonjs/classes/HMSLocalVideoTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSLogAlarmManager.js +4 -4
- package/lib/commonjs/classes/HMSLogAlarmManager.js.map +1 -1
- package/lib/commonjs/classes/HMSLogLevel.js +4 -4
- package/lib/commonjs/classes/HMSLogLevel.js.map +1 -1
- package/lib/commonjs/classes/HMSLogSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSLogger.js +17 -25
- package/lib/commonjs/classes/HMSLogger.js.map +1 -1
- package/lib/commonjs/classes/HMSMessage.js.map +1 -1
- package/lib/commonjs/classes/HMSMessageRecipient.js.map +1 -1
- package/lib/commonjs/classes/HMSMessageRecipientType.js +4 -4
- package/lib/commonjs/classes/HMSMessageRecipientType.js.map +1 -1
- package/lib/commonjs/classes/HMSMessageType.js +4 -4
- package/lib/commonjs/classes/HMSMessageType.js.map +1 -1
- package/lib/commonjs/classes/HMSMicNode.js.map +1 -1
- package/lib/commonjs/classes/HMSNativeEventEmitter.js +0 -5
- package/lib/commonjs/classes/HMSNativeEventEmitter.js.map +1 -1
- package/lib/commonjs/classes/HMSNetworkQuality.js.map +1 -1
- package/lib/commonjs/classes/HMSPIPListenerActions.js +4 -4
- package/lib/commonjs/classes/HMSPIPListenerActions.js.map +1 -1
- package/lib/commonjs/classes/HMSPeer.js +66 -19
- package/lib/commonjs/classes/HMSPeer.js.map +1 -1
- package/lib/commonjs/classes/HMSPeerUpdate.js +7 -5
- package/lib/commonjs/classes/HMSPeerUpdate.js.map +1 -1
- package/lib/commonjs/classes/HMSPeersCache.js +229 -0
- package/lib/commonjs/classes/HMSPeersCache.js.map +1 -0
- package/lib/commonjs/classes/HMSPermissions.js.map +1 -1
- package/lib/commonjs/classes/HMSPublishSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSRTCStats.js.map +1 -1
- package/lib/commonjs/classes/HMSRTCStatsReport.js.map +1 -1
- package/lib/commonjs/classes/HMSRTMPConfig.js.map +1 -1
- package/lib/commonjs/classes/HMSRemoteAudioStats.js.map +1 -1
- package/lib/commonjs/classes/HMSRemoteAudioTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSRemotePeer.js +0 -1
- package/lib/commonjs/classes/HMSRemotePeer.js.map +1 -1
- package/lib/commonjs/classes/HMSRemoteVideoStats.js.map +1 -1
- package/lib/commonjs/classes/HMSRemoteVideoTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSRole.js.map +1 -1
- package/lib/commonjs/classes/HMSRoleChangeRequest.js.map +1 -1
- package/lib/commonjs/classes/HMSRoom.js +79 -22
- package/lib/commonjs/classes/HMSRoom.js.map +1 -1
- package/lib/commonjs/classes/HMSRoomCache.js +128 -0
- package/lib/commonjs/classes/HMSRoomCache.js.map +1 -0
- package/lib/commonjs/classes/HMSRoomUpdate.js +4 -4
- package/lib/commonjs/classes/HMSRoomUpdate.js.map +1 -1
- package/lib/commonjs/classes/HMSRtmpStreamingState.js.map +1 -1
- package/lib/commonjs/classes/HMSRtmpVideoResolution.js.map +1 -1
- package/lib/commonjs/classes/HMSSDK.js +468 -21
- package/lib/commonjs/classes/HMSSDK.js.map +1 -1
- package/lib/commonjs/classes/HMSScreenBroadcastAudioReceiverNode.js.map +1 -1
- package/lib/commonjs/classes/HMSServerRecordingState.js.map +1 -1
- package/lib/commonjs/classes/HMSSimulcastLayerSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSSimulcastSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSSpeaker.js.map +1 -1
- package/lib/commonjs/classes/HMSSubscribeSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSTrackSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSTrackSettingsInitState.js +4 -4
- package/lib/commonjs/classes/HMSTrackSettingsInitState.js.map +1 -1
- package/lib/commonjs/classes/HMSTrackSource.js +4 -4
- package/lib/commonjs/classes/HMSTrackSource.js.map +1 -1
- package/lib/commonjs/classes/HMSTrackType.js +4 -4
- package/lib/commonjs/classes/HMSTrackType.js.map +1 -1
- package/lib/commonjs/classes/HMSTrackUpdate.js +4 -4
- package/lib/commonjs/classes/HMSTrackUpdate.js.map +1 -1
- package/lib/commonjs/classes/HMSUpdateListenerActions.js +5 -5
- package/lib/commonjs/classes/HMSUpdateListenerActions.js.map +1 -1
- package/lib/commonjs/classes/HMSVideoCodec.js +4 -4
- package/lib/commonjs/classes/HMSVideoCodec.js.map +1 -1
- package/lib/commonjs/classes/HMSVideoResolution.js.map +1 -1
- package/lib/commonjs/classes/HMSVideoSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSVideoTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSVideoTrackSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSVideoViewMode.js +4 -4
- package/lib/commonjs/classes/HMSVideoViewMode.js.map +1 -1
- package/lib/commonjs/classes/HmsView.js +2 -1
- package/lib/commonjs/classes/HmsView.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/classes/HMSAudioCodec.js +3 -3
- package/lib/module/classes/HMSAudioCodec.js.map +1 -1
- package/lib/module/classes/HMSAudioDevice.js +3 -3
- package/lib/module/classes/HMSAudioDevice.js.map +1 -1
- package/lib/module/classes/HMSAudioFilePlayerNode.js.map +1 -1
- package/lib/module/classes/HMSAudioMixerSource.js.map +1 -1
- package/lib/module/classes/HMSAudioMixingMode.js +3 -3
- package/lib/module/classes/HMSAudioMixingMode.js.map +1 -1
- package/lib/module/classes/HMSAudioMode.js +3 -3
- package/lib/module/classes/HMSAudioMode.js.map +1 -1
- package/lib/module/classes/HMSAudioNode.js +2 -1
- package/lib/module/classes/HMSAudioNode.js.map +1 -1
- package/lib/module/classes/HMSAudioSettings.js.map +1 -1
- package/lib/module/classes/HMSAudioTrack.js.map +1 -1
- package/lib/module/classes/HMSAudioTrackSettings.js.map +1 -1
- package/lib/module/classes/HMSBrowserRecordingState.js.map +1 -1
- package/lib/module/classes/HMSCameraFacing.js +3 -3
- package/lib/module/classes/HMSCameraFacing.js.map +1 -1
- package/lib/module/classes/HMSChangeTrackStateRequest.js.map +1 -1
- package/lib/module/classes/HMSConfig.js.map +1 -1
- package/lib/module/classes/HMSConstants.js +4 -0
- package/lib/module/classes/HMSConstants.js.map +1 -0
- package/lib/module/classes/HMSEncoder.js +21 -43
- package/lib/module/classes/HMSEncoder.js.map +1 -1
- package/lib/module/classes/HMSException.js.map +1 -1
- package/lib/module/classes/HMSHLSConfig.js.map +1 -1
- package/lib/module/classes/HMSHLSMeetingURLVariant.js.map +1 -1
- package/lib/module/classes/HMSHLSRecordingConfig.js.map +1 -1
- package/lib/module/classes/HMSHLSRecordingState.js.map +1 -1
- package/lib/module/classes/HMSHLSStreamingState.js.map +1 -1
- package/lib/module/classes/HMSHLSVariant.js.map +1 -1
- package/lib/module/classes/HMSHelper.js.map +1 -1
- package/lib/module/classes/HMSLocalAudioStats.js.map +1 -1
- package/lib/module/classes/HMSLocalAudioTrack.js.map +1 -1
- package/lib/module/classes/HMSLocalPeer.js +0 -1
- package/lib/module/classes/HMSLocalPeer.js.map +1 -1
- package/lib/module/classes/HMSLocalVideoStats.js.map +1 -1
- package/lib/module/classes/HMSLocalVideoTrack.js.map +1 -1
- package/lib/module/classes/HMSLogAlarmManager.js +3 -3
- package/lib/module/classes/HMSLogAlarmManager.js.map +1 -1
- package/lib/module/classes/HMSLogLevel.js +3 -3
- package/lib/module/classes/HMSLogLevel.js.map +1 -1
- package/lib/module/classes/HMSLogSettings.js.map +1 -1
- package/lib/module/classes/HMSLogger.js +17 -25
- package/lib/module/classes/HMSLogger.js.map +1 -1
- package/lib/module/classes/HMSMessage.js.map +1 -1
- package/lib/module/classes/HMSMessageRecipient.js.map +1 -1
- package/lib/module/classes/HMSMessageRecipientType.js +3 -3
- package/lib/module/classes/HMSMessageRecipientType.js.map +1 -1
- package/lib/module/classes/HMSMessageType.js +3 -3
- package/lib/module/classes/HMSMessageType.js.map +1 -1
- package/lib/module/classes/HMSMicNode.js.map +1 -1
- package/lib/module/classes/HMSNativeEventEmitter.js +1 -6
- package/lib/module/classes/HMSNativeEventEmitter.js.map +1 -1
- package/lib/module/classes/HMSNetworkQuality.js.map +1 -1
- package/lib/module/classes/HMSPIPListenerActions.js +3 -3
- package/lib/module/classes/HMSPIPListenerActions.js.map +1 -1
- package/lib/module/classes/HMSPeer.js +66 -19
- package/lib/module/classes/HMSPeer.js.map +1 -1
- package/lib/module/classes/HMSPeerUpdate.js +4 -3
- package/lib/module/classes/HMSPeerUpdate.js.map +1 -1
- package/lib/module/classes/HMSPeersCache.js +216 -0
- package/lib/module/classes/HMSPeersCache.js.map +1 -0
- package/lib/module/classes/HMSPermissions.js.map +1 -1
- package/lib/module/classes/HMSPublishSettings.js.map +1 -1
- package/lib/module/classes/HMSRTCStats.js.map +1 -1
- package/lib/module/classes/HMSRTCStatsReport.js.map +1 -1
- package/lib/module/classes/HMSRTMPConfig.js.map +1 -1
- package/lib/module/classes/HMSRemoteAudioStats.js.map +1 -1
- package/lib/module/classes/HMSRemoteAudioTrack.js.map +1 -1
- package/lib/module/classes/HMSRemotePeer.js +0 -1
- package/lib/module/classes/HMSRemotePeer.js.map +1 -1
- package/lib/module/classes/HMSRemoteVideoStats.js.map +1 -1
- package/lib/module/classes/HMSRemoteVideoTrack.js.map +1 -1
- package/lib/module/classes/HMSRole.js.map +1 -1
- package/lib/module/classes/HMSRoleChangeRequest.js.map +1 -1
- package/lib/module/classes/HMSRoom.js +79 -22
- package/lib/module/classes/HMSRoom.js.map +1 -1
- package/lib/module/classes/HMSRoomCache.js +115 -0
- package/lib/module/classes/HMSRoomCache.js.map +1 -0
- package/lib/module/classes/HMSRoomUpdate.js +3 -3
- package/lib/module/classes/HMSRoomUpdate.js.map +1 -1
- package/lib/module/classes/HMSRtmpStreamingState.js.map +1 -1
- package/lib/module/classes/HMSRtmpVideoResolution.js.map +1 -1
- package/lib/module/classes/HMSSDK.js +468 -21
- package/lib/module/classes/HMSSDK.js.map +1 -1
- package/lib/module/classes/HMSScreenBroadcastAudioReceiverNode.js.map +1 -1
- package/lib/module/classes/HMSServerRecordingState.js.map +1 -1
- package/lib/module/classes/HMSSimulcastLayerSettings.js.map +1 -1
- package/lib/module/classes/HMSSimulcastSettings.js.map +1 -1
- package/lib/module/classes/HMSSpeaker.js.map +1 -1
- package/lib/module/classes/HMSSubscribeSettings.js.map +1 -1
- package/lib/module/classes/HMSTrack.js.map +1 -1
- package/lib/module/classes/HMSTrackSettings.js.map +1 -1
- package/lib/module/classes/HMSTrackSettingsInitState.js +3 -3
- package/lib/module/classes/HMSTrackSettingsInitState.js.map +1 -1
- package/lib/module/classes/HMSTrackSource.js +3 -3
- package/lib/module/classes/HMSTrackSource.js.map +1 -1
- package/lib/module/classes/HMSTrackType.js +3 -3
- package/lib/module/classes/HMSTrackType.js.map +1 -1
- package/lib/module/classes/HMSTrackUpdate.js +3 -3
- package/lib/module/classes/HMSTrackUpdate.js.map +1 -1
- package/lib/module/classes/HMSUpdateListenerActions.js +4 -4
- package/lib/module/classes/HMSUpdateListenerActions.js.map +1 -1
- package/lib/module/classes/HMSVideoCodec.js +3 -3
- package/lib/module/classes/HMSVideoCodec.js.map +1 -1
- package/lib/module/classes/HMSVideoResolution.js.map +1 -1
- package/lib/module/classes/HMSVideoSettings.js.map +1 -1
- package/lib/module/classes/HMSVideoTrack.js.map +1 -1
- package/lib/module/classes/HMSVideoTrackSettings.js.map +1 -1
- package/lib/module/classes/HMSVideoViewMode.js +3 -3
- package/lib/module/classes/HMSVideoViewMode.js.map +1 -1
- package/lib/module/classes/HmsView.js +2 -1
- package/lib/module/classes/HmsView.js.map +1 -1
- package/lib/typescript/classes/HMSConstants.d.ts +3 -0
- package/lib/typescript/classes/HMSEncoder.d.ts +7 -6
- package/lib/typescript/classes/HMSLocalPeer.d.ts +0 -14
- package/lib/typescript/classes/HMSLogger.d.ts +1 -7
- package/lib/typescript/classes/HMSPeer.d.ts +12 -18
- package/lib/typescript/classes/HMSPeerUpdate.d.ts +1 -0
- package/lib/typescript/classes/HMSPeersCache.d.ts +17 -0
- package/lib/typescript/classes/HMSRemotePeer.d.ts +0 -14
- package/lib/typescript/classes/HMSRoom.d.ts +11 -22
- package/lib/typescript/classes/HMSRoomCache.d.ts +16 -0
- package/lib/typescript/classes/HMSSDK.d.ts +1 -1
- package/lib/typescript/classes/HMSUpdateListenerActions.d.ts +1 -1
- package/package.json +1 -1
- package/sdk-versions.json +3 -3
- package/src/classes/HMSAudioNode.ts +3 -1
- package/src/classes/HMSConstants.ts +3 -0
- package/src/classes/HMSEncoder.ts +24 -69
- package/src/classes/HMSLocalPeer.ts +0 -15
- package/src/classes/HMSLogger.ts +20 -19
- package/src/classes/HMSNativeEventEmitter.ts +35 -12
- package/src/classes/HMSPeer.ts +133 -34
- package/src/classes/HMSPeerUpdate.ts +9 -0
- package/src/classes/HMSPeersCache.ts +252 -0
- package/src/classes/HMSRemotePeer.ts +0 -16
- package/src/classes/HMSRoom.ts +141 -37
- package/src/classes/HMSRoomCache.ts +157 -0
- package/src/classes/HMSSDK.tsx +57 -24
- package/src/classes/HMSUpdateListenerActions.ts +1 -1
- package/src/classes/HmsView.tsx +2 -1
|
@@ -19,6 +19,9 @@ var _HmsView = require("./HmsView");
|
|
|
19
19
|
var _HMSMessageType = require("./HMSMessageType");
|
|
20
20
|
var _HMSPIPListenerActions = require("./HMSPIPListenerActions");
|
|
21
21
|
var _HMSNativeEventEmitter = require("./HMSNativeEventEmitter");
|
|
22
|
+
var _HMSPeersCache = require("./HMSPeersCache");
|
|
23
|
+
var _HMSRoomCache = require("./HMSRoomCache");
|
|
24
|
+
var _HMSPeerUpdate = require("./HMSPeerUpdate");
|
|
22
25
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
26
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
24
27
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
@@ -59,29 +62,61 @@ class HMSSDK {
|
|
|
59
62
|
_defineProperty(this, "onAudioDeviceChangedDelegate", void 0);
|
|
60
63
|
_defineProperty(this, "onPIPRoomLeaveDelegate", void 0);
|
|
61
64
|
_defineProperty(this, "emitterSubscriptions", {});
|
|
65
|
+
/**
|
|
66
|
+
* - Updates the logger for this instance of HMSSDK
|
|
67
|
+
* @param {HMSLogger} hmsLogger
|
|
68
|
+
* @memberof HMSSDK
|
|
69
|
+
*/
|
|
62
70
|
_defineProperty(this, "setLogger", hmsLogger => {
|
|
63
71
|
(0, _HMSLogger.setLogger)(this.id, hmsLogger);
|
|
64
72
|
});
|
|
73
|
+
/**
|
|
74
|
+
* - Calls removeListeners that in turn breaks all connections with native listeners.
|
|
75
|
+
*
|
|
76
|
+
* @memberof HMSSDK
|
|
77
|
+
*/
|
|
65
78
|
_defineProperty(this, "destroy", async () => {
|
|
66
79
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function destroy', {
|
|
67
80
|
id: this.id
|
|
68
81
|
});
|
|
82
|
+
(0, _HMSPeersCache.clearHmsPeersCache)();
|
|
83
|
+
(0, _HMSRoomCache.clearHmsRoomCache)();
|
|
69
84
|
this.removeAllListeners();
|
|
70
85
|
return await HMSManager.destroy({
|
|
71
86
|
id: this.id
|
|
72
87
|
});
|
|
73
88
|
});
|
|
89
|
+
/**
|
|
90
|
+
* takes an instance of [HMSConfig]{@link HMSConfig} and joins the room.
|
|
91
|
+
* after joining the room user will start receiving the events and updates of the room.
|
|
92
|
+
*
|
|
93
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/join} for more info
|
|
94
|
+
*
|
|
95
|
+
* @param {HMSConfig} config
|
|
96
|
+
* @memberof HMSSDK
|
|
97
|
+
*/
|
|
74
98
|
_defineProperty(this, "join", async config => {
|
|
75
99
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function join', {
|
|
76
100
|
config,
|
|
77
101
|
id: this.id
|
|
78
102
|
});
|
|
79
103
|
this.addAppStateListener();
|
|
104
|
+
(0, _HMSPeersCache.setHmsPeersCache)(new _HMSPeersCache.HMSPeersCache(this.id));
|
|
105
|
+
(0, _HMSRoomCache.setHmsRoomCache)(new _HMSRoomCache.HMSRoomCache(this.id));
|
|
80
106
|
await HMSManager.join({
|
|
81
107
|
...config,
|
|
82
108
|
id: this.id
|
|
83
109
|
});
|
|
84
110
|
});
|
|
111
|
+
/**
|
|
112
|
+
* - preview function is used to initiate a preview for the localPeer.
|
|
113
|
+
* - We can call this function and wait for a response in previewListener, the response will contain previewTracks for local peer.
|
|
114
|
+
*
|
|
115
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/preview} for more info
|
|
116
|
+
*
|
|
117
|
+
* @param {HMSConfig} config
|
|
118
|
+
* @memberof HMSSDK
|
|
119
|
+
*/
|
|
85
120
|
_defineProperty(this, "preview", config => {
|
|
86
121
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function preview', {
|
|
87
122
|
config,
|
|
@@ -92,6 +127,17 @@ class HMSSDK {
|
|
|
92
127
|
id: this.id
|
|
93
128
|
});
|
|
94
129
|
});
|
|
130
|
+
/**
|
|
131
|
+
* - previewForRole can be used when there is role change request for current localPeer and we want
|
|
132
|
+
* to show the localPeer how the tracks look before publishing them to room.
|
|
133
|
+
*
|
|
134
|
+
* - It requires a role of type [HMSRole]{@link HMSRole} for which we want to preview the tracks.
|
|
135
|
+
*
|
|
136
|
+
* checkout {@link https://www.100ms.live/docs/react-native} for more info
|
|
137
|
+
*
|
|
138
|
+
* @param {HMSRole}
|
|
139
|
+
* @memberof HMSSDK
|
|
140
|
+
*/
|
|
95
141
|
_defineProperty(this, "previewForRole", async role => {
|
|
96
142
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function previewForRole', {
|
|
97
143
|
role,
|
|
@@ -107,6 +153,17 @@ class HMSSDK {
|
|
|
107
153
|
return 'API currently not available for android';
|
|
108
154
|
}
|
|
109
155
|
});
|
|
156
|
+
/**
|
|
157
|
+
* - HmsView is react component that takes trackId and starts showing that track on a tile.
|
|
158
|
+
* - The appearance of tile is completely customizable with style prop.
|
|
159
|
+
* - Scale type can determine how the incoming video will fit in the canvas check {@link HMSVideoViewMode} for more information.
|
|
160
|
+
* - Mirror to flip the video vertically.
|
|
161
|
+
*
|
|
162
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/render-video} for more info
|
|
163
|
+
*
|
|
164
|
+
* @param {HmsViewProps}
|
|
165
|
+
* @memberof HMSSDK
|
|
166
|
+
*/
|
|
110
167
|
_defineProperty(this, "HmsView", /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
111
168
|
const {
|
|
112
169
|
trackId,
|
|
@@ -129,8 +186,17 @@ class HMSSDK {
|
|
|
129
186
|
var _this$appStateSubscri;
|
|
130
187
|
this.muteStatus = undefined;
|
|
131
188
|
this === null || this === void 0 ? void 0 : (_this$appStateSubscri = this.appStateSubscription) === null || _this$appStateSubscri === void 0 ? void 0 : _this$appStateSubscri.remove();
|
|
189
|
+
(0, _HMSPeersCache.clearHmsPeersCache)();
|
|
190
|
+
(0, _HMSRoomCache.clearHmsRoomCache)();
|
|
132
191
|
_HMSEncoder.HMSEncoder.clearData(); // Clearing cached data in encoder
|
|
133
192
|
});
|
|
193
|
+
/**
|
|
194
|
+
* Calls leave function of native sdk and session of current user is invalidated.
|
|
195
|
+
*
|
|
196
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/leave} for more info
|
|
197
|
+
*
|
|
198
|
+
* @memberof HMSSDK
|
|
199
|
+
*/
|
|
134
200
|
_defineProperty(this, "leave", async () => {
|
|
135
201
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function leave', {
|
|
136
202
|
id: this.id
|
|
@@ -142,6 +208,14 @@ class HMSSDK {
|
|
|
142
208
|
this.roomLeaveCleanup();
|
|
143
209
|
return op;
|
|
144
210
|
});
|
|
211
|
+
/**
|
|
212
|
+
* - This function sends message to all the peers in the room, the get the message in onMessage listener.
|
|
213
|
+
*
|
|
214
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/chat} for more info
|
|
215
|
+
*
|
|
216
|
+
* @param {message: string} and @param {type: string}
|
|
217
|
+
* @memberof HMSSDK
|
|
218
|
+
*/
|
|
145
219
|
_defineProperty(this, "sendBroadcastMessage", async function (message) {
|
|
146
220
|
let type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _HMSMessageType.HMSMessageType.CHAT;
|
|
147
221
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function sendBroadcastMessage', {
|
|
@@ -155,6 +229,14 @@ class HMSSDK {
|
|
|
155
229
|
id: _this.id
|
|
156
230
|
});
|
|
157
231
|
});
|
|
232
|
+
/**
|
|
233
|
+
* - sendGroupMessage sends a message to specific set of roles, whoever has any of those role in room
|
|
234
|
+
* will get the message in onMessage listener.
|
|
235
|
+
*
|
|
236
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/chat} for more info
|
|
237
|
+
*
|
|
238
|
+
* @memberof HMSSDK
|
|
239
|
+
*/
|
|
158
240
|
_defineProperty(this, "sendGroupMessage", async function (message, roles) {
|
|
159
241
|
let type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _HMSMessageType.HMSMessageType.CHAT;
|
|
160
242
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function sendGroupMessage', {
|
|
@@ -170,6 +252,14 @@ class HMSSDK {
|
|
|
170
252
|
type: type || null
|
|
171
253
|
});
|
|
172
254
|
});
|
|
255
|
+
/**
|
|
256
|
+
* - sendDirectMessage sends a private message to a single peer, only that peer will get the message
|
|
257
|
+
* in onMessage Listener.
|
|
258
|
+
*
|
|
259
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/chat} for more info
|
|
260
|
+
*
|
|
261
|
+
* @memberof HMSSDK
|
|
262
|
+
*/
|
|
173
263
|
_defineProperty(this, "sendDirectMessage", async function (message, peer) {
|
|
174
264
|
let type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _HMSMessageType.HMSMessageType.CHAT;
|
|
175
265
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function sendDirectMessage', {
|
|
@@ -185,6 +275,18 @@ class HMSSDK {
|
|
|
185
275
|
type: type || null
|
|
186
276
|
});
|
|
187
277
|
});
|
|
278
|
+
/**
|
|
279
|
+
* - changeMetadata changes a specific field in localPeer which is [metadata] it is a string that can
|
|
280
|
+
* be used for various functionalities like raiseHand, beRightBack and many more that explains the
|
|
281
|
+
* current status of the peer.
|
|
282
|
+
*
|
|
283
|
+
* - it is advised to use a json object in string format to store multiple dataPoints in metadata.
|
|
284
|
+
*
|
|
285
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/advanced-features/change-metadata} for more info
|
|
286
|
+
*
|
|
287
|
+
* @param {string}
|
|
288
|
+
* @memberof HMSSDK
|
|
289
|
+
*/
|
|
188
290
|
_defineProperty(this, "changeMetadata", async metadata => {
|
|
189
291
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function changeMetadata', {
|
|
190
292
|
metadata,
|
|
@@ -195,6 +297,15 @@ class HMSSDK {
|
|
|
195
297
|
id: this.id
|
|
196
298
|
});
|
|
197
299
|
});
|
|
300
|
+
/**
|
|
301
|
+
* - startRTMPOrRecording takes a configuration object {@link HMSRTMPConfig} and stats the RTMP recording
|
|
302
|
+
* - this object of {@link HMSRTMPConfig} sets the urls for streaming and weather to set recording on or not
|
|
303
|
+
* - we get the response of this function in onRoomUpdate as RTMP_STREAMING_STATE_UPDATED.
|
|
304
|
+
*
|
|
305
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/recording} for more info
|
|
306
|
+
*
|
|
307
|
+
* @memberof HMSSDK
|
|
308
|
+
*/
|
|
198
309
|
_defineProperty(this, "startRTMPOrRecording", async data => {
|
|
199
310
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function startRTMPOrRecording', {
|
|
200
311
|
...data,
|
|
@@ -206,6 +317,14 @@ class HMSSDK {
|
|
|
206
317
|
});
|
|
207
318
|
return op;
|
|
208
319
|
});
|
|
320
|
+
/**
|
|
321
|
+
* - this function stops all the ongoing RTMP streaming and recording.
|
|
322
|
+
* - we get the response of this function in onRoomUpdate as RTMP_STREAMING_STATE_UPDATED.
|
|
323
|
+
*
|
|
324
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/recording} for more info
|
|
325
|
+
*
|
|
326
|
+
* @memberof HMSSDK
|
|
327
|
+
*/
|
|
209
328
|
_defineProperty(this, "stopRtmpAndRecording", async () => {
|
|
210
329
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function stopRtmpAndRecording', {});
|
|
211
330
|
const op = await HMSManager.stopRtmpAndRecording({
|
|
@@ -213,6 +332,15 @@ class HMSSDK {
|
|
|
213
332
|
});
|
|
214
333
|
return op;
|
|
215
334
|
});
|
|
335
|
+
/**
|
|
336
|
+
* - This function starts HLSStreaming.
|
|
337
|
+
* - we get the response of this function in onRoomUpdate as HLS_STREAMING_STATE_UPDATED.
|
|
338
|
+
*
|
|
339
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/hls-streaming} for more info
|
|
340
|
+
*
|
|
341
|
+
* @param {HMSHLSConfig}
|
|
342
|
+
* @memberof HMSSDK
|
|
343
|
+
*/
|
|
216
344
|
_defineProperty(this, "startHLSStreaming", async data => {
|
|
217
345
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function startHLSStreaming', {
|
|
218
346
|
...data,
|
|
@@ -223,12 +351,36 @@ class HMSSDK {
|
|
|
223
351
|
id: this.id
|
|
224
352
|
});
|
|
225
353
|
});
|
|
354
|
+
/**
|
|
355
|
+
* - stopHLSStreaming function stops the ongoing HLSStreams.
|
|
356
|
+
* - we get the response of this function in onRoomUpdate as HLS_STREAMING_STATE_UPDATED.
|
|
357
|
+
*
|
|
358
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/hls-streaming} for more info
|
|
359
|
+
*
|
|
360
|
+
* @memberof HMSSDK
|
|
361
|
+
*/
|
|
226
362
|
_defineProperty(this, "stopHLSStreaming", async () => {
|
|
227
363
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function stopHLSStreaming', {});
|
|
228
364
|
return await HMSManager.stopHLSStreaming({
|
|
229
365
|
id: this.id
|
|
230
366
|
});
|
|
231
367
|
});
|
|
368
|
+
/**
|
|
369
|
+
* @deprecated This function has been deprecated in favor of #Function changeRoleOfPeer
|
|
370
|
+
*
|
|
371
|
+
* - This function can be used in a situation when we want to change role hence manipulate their
|
|
372
|
+
* access and rights in the current room, it takes the peer {@link HMSPeer} whom role we want to change,
|
|
373
|
+
* role {@link HMSRole} which will be the new role for that peer and weather to forcefully change
|
|
374
|
+
* the role or ask the to accept the role change request using a boolean force.
|
|
375
|
+
*
|
|
376
|
+
* - if we change the role forcefully the peer's role will be updated without asking the peer
|
|
377
|
+
* otherwise the user will get the roleChangeRequest in roleChangeRequest listener.
|
|
378
|
+
* for more information on this checkout {@link onRoleChangeRequestListener}
|
|
379
|
+
*
|
|
380
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-role} for more info
|
|
381
|
+
*
|
|
382
|
+
* @memberof HMSSDK
|
|
383
|
+
*/
|
|
232
384
|
_defineProperty(this, "changeRole", async function (peer, role) {
|
|
233
385
|
let force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
234
386
|
const data = {
|
|
@@ -240,6 +392,20 @@ class HMSSDK {
|
|
|
240
392
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function changeRole', data);
|
|
241
393
|
return await HMSManager.changeRole(data);
|
|
242
394
|
});
|
|
395
|
+
/**
|
|
396
|
+
* - This function can be used in a situation when we want to change role hence manipulate their
|
|
397
|
+
* access and rights in the current room, it takes the peer {@link HMSPeer} whom role we want to change,
|
|
398
|
+
* role {@link HMSRole} which will be the new role for that peer and weather to forcefully change
|
|
399
|
+
* the role or ask the to accept the role change request using a boolean force.
|
|
400
|
+
*
|
|
401
|
+
* - if we change the role forcefully the peer's role will be updated without asking the peer
|
|
402
|
+
* otherwise the user will get the roleChangeRequest in roleChangeRequest listener.
|
|
403
|
+
* for more information on this checkout {@link onRoleChangeRequestListener}
|
|
404
|
+
*
|
|
405
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-role} for more info
|
|
406
|
+
*
|
|
407
|
+
* @memberof HMSSDK
|
|
408
|
+
*/
|
|
243
409
|
_defineProperty(this, "changeRoleOfPeer", async function (peer, role) {
|
|
244
410
|
let force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
245
411
|
const data = {
|
|
@@ -251,6 +417,19 @@ class HMSSDK {
|
|
|
251
417
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function changeRoleOfPeer', data);
|
|
252
418
|
return HMSManager.changeRoleOfPeer(data);
|
|
253
419
|
});
|
|
420
|
+
/**
|
|
421
|
+
* - This function can be used in a situation when we want to change role of multiple peers by specifying their roles.
|
|
422
|
+
* Hence manipulate their access and rights in the current room.
|
|
423
|
+
* It takes the list of roles {@link HMSRole} whom role we want to change
|
|
424
|
+
* and role {@link HMSRole} which will be the new role for peers.
|
|
425
|
+
*
|
|
426
|
+
* - Note that role will be updated without asking the peers.
|
|
427
|
+
* Meaning, Peers will not get the roleChangeRequest in roleChangeRequest listener.
|
|
428
|
+
*
|
|
429
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-role} for more info
|
|
430
|
+
*
|
|
431
|
+
* @memberof HMSSDK
|
|
432
|
+
*/
|
|
254
433
|
_defineProperty(this, "changeRoleOfPeersWithRoles", async (ofRoles, toRole) => {
|
|
255
434
|
const data = {
|
|
256
435
|
ofRoles: ofRoles.map(ofRole => ofRole.name).filter(Boolean),
|
|
@@ -260,6 +439,15 @@ class HMSSDK {
|
|
|
260
439
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function changeRoleOfPeersWithRoles', data);
|
|
261
440
|
return HMSManager.changeRoleOfPeersWithRoles(data);
|
|
262
441
|
});
|
|
442
|
+
/**
|
|
443
|
+
* - This function can be used to manipulate mute status of any track.
|
|
444
|
+
* - Targeted peer affected by this action will get a callback in onChangeTrackStateRequestListener.
|
|
445
|
+
*
|
|
446
|
+
* * checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-track-state} for more info
|
|
447
|
+
*
|
|
448
|
+
* @param {HMSTrack}
|
|
449
|
+
* @memberof HMSSDK
|
|
450
|
+
*/
|
|
263
451
|
_defineProperty(this, "changeTrackState", async (track, mute) => {
|
|
264
452
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function changeTrackState', {
|
|
265
453
|
track,
|
|
@@ -273,6 +461,14 @@ class HMSSDK {
|
|
|
273
461
|
};
|
|
274
462
|
return await HMSManager.changeTrackState(data);
|
|
275
463
|
});
|
|
464
|
+
/**
|
|
465
|
+
* - changeTrackStateForRoles is an enhancement on the functionality of {@link changeTrackState}.
|
|
466
|
+
* - We can change mute status for all the tracks of peers having a particular role.
|
|
467
|
+
* - @param source determines the source of the track ex. video, audio etc.
|
|
468
|
+
* - The peers affected by this action will get a callback in onChangeTrackStateRequestListener.
|
|
469
|
+
*
|
|
470
|
+
* @memberof HMSSDK
|
|
471
|
+
*/
|
|
276
472
|
_defineProperty(this, "changeTrackStateForRoles", async (mute, type, source, roles) => {
|
|
277
473
|
let roleNames = null;
|
|
278
474
|
if (roles) {
|
|
@@ -294,6 +490,14 @@ class HMSSDK {
|
|
|
294
490
|
};
|
|
295
491
|
return await HMSManager.changeTrackStateForRoles(data);
|
|
296
492
|
});
|
|
493
|
+
/**
|
|
494
|
+
* - removePeer can forcefully disconnect a Peer from the room.
|
|
495
|
+
* - the user who's removed from this action will get a callback in {@link onRemovedFromRoomListener}.
|
|
496
|
+
*
|
|
497
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/remove-peer} for more info
|
|
498
|
+
*
|
|
499
|
+
* @memberof HMSSDK
|
|
500
|
+
*/
|
|
297
501
|
_defineProperty(this, "removePeer", async (peer, reason) => {
|
|
298
502
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function removePeer', {
|
|
299
503
|
peerId: peer.peerID,
|
|
@@ -307,6 +511,15 @@ class HMSSDK {
|
|
|
307
511
|
};
|
|
308
512
|
return await HMSManager.removePeer(data);
|
|
309
513
|
});
|
|
514
|
+
/**
|
|
515
|
+
* - endRoom can be used in a situation where we want to disconnect all the peers from current room
|
|
516
|
+
* and end the call.
|
|
517
|
+
* - everyone in the room will get an update of this action in {@link onRemovedFromRoomListener}.
|
|
518
|
+
*
|
|
519
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/end-room} for more info
|
|
520
|
+
*
|
|
521
|
+
* @memberof HMSSDK
|
|
522
|
+
*/
|
|
310
523
|
_defineProperty(this, "endRoom", async function (reason) {
|
|
311
524
|
let lock = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
312
525
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function endRoom', {
|
|
@@ -321,6 +534,13 @@ class HMSSDK {
|
|
|
321
534
|
};
|
|
322
535
|
return await HMSManager.endRoom(data);
|
|
323
536
|
});
|
|
537
|
+
/**
|
|
538
|
+
* - This function can be used to change name of localPeer.
|
|
539
|
+
*
|
|
540
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-name} for more info
|
|
541
|
+
*
|
|
542
|
+
* @memberof HMSSDK
|
|
543
|
+
*/
|
|
324
544
|
_defineProperty(this, "changeName", async name => {
|
|
325
545
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function changeName', {
|
|
326
546
|
name,
|
|
@@ -332,6 +552,13 @@ class HMSSDK {
|
|
|
332
552
|
};
|
|
333
553
|
return await HMSManager.changeName(data);
|
|
334
554
|
});
|
|
555
|
+
/**
|
|
556
|
+
* - Calling this function will accept the most recent roleChange request made by anyone in the room
|
|
557
|
+
*
|
|
558
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-role} for more info
|
|
559
|
+
*
|
|
560
|
+
* @memberof HMSSDK
|
|
561
|
+
*/
|
|
335
562
|
_defineProperty(this, "acceptRoleChange", async () => {
|
|
336
563
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function acceptRoleChange', {
|
|
337
564
|
id: this.id
|
|
@@ -340,6 +567,14 @@ class HMSSDK {
|
|
|
340
567
|
id: this.id
|
|
341
568
|
});
|
|
342
569
|
});
|
|
570
|
+
/**
|
|
571
|
+
* - setPlaybackForAllAudio is an extension of the abilities of setPlaybackAllowed in
|
|
572
|
+
* HMSRemoteAudioTrack. It sets mute status for all peers in the room only for the local peer.
|
|
573
|
+
*
|
|
574
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/playback-allowed} for more info
|
|
575
|
+
*
|
|
576
|
+
* @memberof HMSSDK
|
|
577
|
+
*/
|
|
343
578
|
_defineProperty(this, "setPlaybackForAllAudio", mute => {
|
|
344
579
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function setPlaybackForAllAudio', {
|
|
345
580
|
mute,
|
|
@@ -351,6 +586,11 @@ class HMSSDK {
|
|
|
351
586
|
id: this.id
|
|
352
587
|
});
|
|
353
588
|
});
|
|
589
|
+
/**
|
|
590
|
+
* - This function mutes audio for all peers in the room.
|
|
591
|
+
*
|
|
592
|
+
* @memberof HMSSDK
|
|
593
|
+
*/
|
|
354
594
|
_defineProperty(this, "remoteMuteAllAudio", async () => {
|
|
355
595
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function remoteMuteAllAudio', {
|
|
356
596
|
id: this.id
|
|
@@ -359,16 +599,34 @@ class HMSSDK {
|
|
|
359
599
|
id: this.id
|
|
360
600
|
});
|
|
361
601
|
});
|
|
602
|
+
/**
|
|
603
|
+
* - getRoom is a wrapper function on an existing native function also known as getRoom the returns
|
|
604
|
+
* current room object which is of type {@link HMSRoom}
|
|
605
|
+
*
|
|
606
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/join#get-room} for more info
|
|
607
|
+
*
|
|
608
|
+
* @memberof HMSSDK
|
|
609
|
+
* @return Promise<HMSRoom>
|
|
610
|
+
*/
|
|
362
611
|
_defineProperty(this, "getRoom", async () => {
|
|
612
|
+
var _getHmsRoomCache;
|
|
363
613
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function getRoom', {
|
|
364
614
|
id: this.id
|
|
365
615
|
});
|
|
366
616
|
const hmsRoom = await HMSManager.getRoom({
|
|
367
617
|
id: this.id
|
|
368
618
|
});
|
|
619
|
+
(_getHmsRoomCache = (0, _HMSRoomCache.getHmsRoomCache)()) === null || _getHmsRoomCache === void 0 ? void 0 : _getHmsRoomCache.updateRoomCache(hmsRoom);
|
|
369
620
|
const encodedHmsRoom = _HMSEncoder.HMSEncoder.encodeHmsRoom(hmsRoom, this.id);
|
|
370
621
|
return encodedHmsRoom;
|
|
371
622
|
});
|
|
623
|
+
/**
|
|
624
|
+
* - getLocalPeer is a wrapper function on an existing native function also known as getLocalPeer the returns
|
|
625
|
+
* current local peer object which is of type {@link HMSLocalPeer}
|
|
626
|
+
*
|
|
627
|
+
* @memberof HMSSDK
|
|
628
|
+
* @return Promise<HMSLocalPeer>
|
|
629
|
+
*/
|
|
372
630
|
_defineProperty(this, "getLocalPeer", async () => {
|
|
373
631
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function getLocalPeer', {
|
|
374
632
|
id: this.id
|
|
@@ -379,6 +637,13 @@ class HMSSDK {
|
|
|
379
637
|
const encodedLocalPeer = _HMSEncoder.HMSEncoder.encodeHmsLocalPeer(localPeer, this.id);
|
|
380
638
|
return encodedLocalPeer;
|
|
381
639
|
});
|
|
640
|
+
/**
|
|
641
|
+
* - getRemotePeers is a wrapper function on an existing native function also known as getRemotePeers the returns
|
|
642
|
+
* remote peers array which is of type {@link HMSRemotePeer}
|
|
643
|
+
*
|
|
644
|
+
* @memberof HMSSDK
|
|
645
|
+
* @return Promise<HMSRemotePeer[]>
|
|
646
|
+
*/
|
|
382
647
|
_defineProperty(this, "getRemotePeers", async () => {
|
|
383
648
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function getRemotePeers', {
|
|
384
649
|
id: this.id
|
|
@@ -389,6 +654,13 @@ class HMSSDK {
|
|
|
389
654
|
const encodedRemotePeers = _HMSEncoder.HMSEncoder.encodeHmsRemotePeers(remotePeers, this.id);
|
|
390
655
|
return encodedRemotePeers;
|
|
391
656
|
});
|
|
657
|
+
/**
|
|
658
|
+
* - getRoles is a wrapper function on an existing native function also known as getRoles the returns
|
|
659
|
+
* array of all present roles which is of type {@link HMSRole}
|
|
660
|
+
*
|
|
661
|
+
* @memberof HMSSDK
|
|
662
|
+
* @return Promise<HMSRole[]>
|
|
663
|
+
*/
|
|
392
664
|
_defineProperty(this, "getRoles", async () => {
|
|
393
665
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function getRoles', {
|
|
394
666
|
id: this.id
|
|
@@ -399,6 +671,13 @@ class HMSSDK {
|
|
|
399
671
|
const encodedRoles = _HMSEncoder.HMSEncoder.encodeHmsRoles(roles);
|
|
400
672
|
return encodedRoles;
|
|
401
673
|
});
|
|
674
|
+
/**
|
|
675
|
+
* - This function sets the volume of any peer in the room
|
|
676
|
+
*
|
|
677
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/advanced-features/set-volume} for more info
|
|
678
|
+
*
|
|
679
|
+
* @memberof HMSSDK
|
|
680
|
+
*/
|
|
402
681
|
_defineProperty(this, "setVolume", (track, volume) => {
|
|
403
682
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function setVolume', {
|
|
404
683
|
track,
|
|
@@ -419,6 +698,13 @@ class HMSSDK {
|
|
|
419
698
|
id: this.id
|
|
420
699
|
});
|
|
421
700
|
});
|
|
701
|
+
/**
|
|
702
|
+
* - This is a temporary solution for the situation when mic access is taken from the app and
|
|
703
|
+
* user returns to the app with no mic access. It will re-acquire the mic by setting the volume
|
|
704
|
+
* from native side
|
|
705
|
+
*
|
|
706
|
+
* @memberof HMSSDK
|
|
707
|
+
*/
|
|
422
708
|
_defineProperty(this, "addAppStateListener", () => {
|
|
423
709
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function addAppStateListener', {
|
|
424
710
|
id: this.id
|
|
@@ -429,6 +715,13 @@ class HMSSDK {
|
|
|
429
715
|
}
|
|
430
716
|
});
|
|
431
717
|
});
|
|
718
|
+
/**
|
|
719
|
+
* - This function is used to start screenshare, currently available only for android
|
|
720
|
+
*
|
|
721
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/screenshare} for more info
|
|
722
|
+
*
|
|
723
|
+
* @memberof HMSSDK
|
|
724
|
+
*/
|
|
432
725
|
_defineProperty(this, "startScreenshare", async () => {
|
|
433
726
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function startScreenshare', {
|
|
434
727
|
id: this.id
|
|
@@ -437,6 +730,13 @@ class HMSSDK {
|
|
|
437
730
|
id: this.id
|
|
438
731
|
});
|
|
439
732
|
});
|
|
733
|
+
/**
|
|
734
|
+
* - Returns a boolean stating if the screen is currently shared or not
|
|
735
|
+
*
|
|
736
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/screenshare} for more info
|
|
737
|
+
*
|
|
738
|
+
* @memberof HMSSDK
|
|
739
|
+
*/
|
|
440
740
|
_defineProperty(this, "isScreenShared", async () => {
|
|
441
741
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function isScreenShared', {
|
|
442
742
|
id: this.id
|
|
@@ -445,6 +745,13 @@ class HMSSDK {
|
|
|
445
745
|
id: this.id
|
|
446
746
|
});
|
|
447
747
|
});
|
|
748
|
+
/**
|
|
749
|
+
* - stops the screenShare, currently available for android only.
|
|
750
|
+
*
|
|
751
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/screenshare} for more info
|
|
752
|
+
*
|
|
753
|
+
* @memberof HMSSDK
|
|
754
|
+
*/
|
|
448
755
|
_defineProperty(this, "stopScreenshare", async () => {
|
|
449
756
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function stopScreenshare', {
|
|
450
757
|
id: this.id
|
|
@@ -453,6 +760,18 @@ class HMSSDK {
|
|
|
453
760
|
id: this.id
|
|
454
761
|
});
|
|
455
762
|
});
|
|
763
|
+
/**
|
|
764
|
+
* - enableRTCStats sets a boolean in native side which in turn allows several events to be passed
|
|
765
|
+
* through the bridge these events are {@link RTCStatsListener}, {@link onRemoteVideoStatsListener},
|
|
766
|
+
* {@link onRemoteAudioStatsListener}, {@link onLocalAudioStatsListener} and {@link onLocalVideoStatsListener}
|
|
767
|
+
*
|
|
768
|
+
* - These listeners get various dataPoints for current peers and their connectivity to the room
|
|
769
|
+
* such as jitter, latency etc.
|
|
770
|
+
*
|
|
771
|
+
* - currently available for iOS only
|
|
772
|
+
*
|
|
773
|
+
* @memberof HMSSDK
|
|
774
|
+
*/
|
|
456
775
|
_defineProperty(this, "enableRTCStats", () => {
|
|
457
776
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function enableRTCStats', {
|
|
458
777
|
id: this.id
|
|
@@ -461,6 +780,14 @@ class HMSSDK {
|
|
|
461
780
|
id: this.id
|
|
462
781
|
});
|
|
463
782
|
});
|
|
783
|
+
/**
|
|
784
|
+
* - disable RTCStats sets the same boolean to false that was set true by enableRTCStats.
|
|
785
|
+
* that activates a check which filters out the events acquired in native listeners and don't
|
|
786
|
+
* let them pass through bridge
|
|
787
|
+
*
|
|
788
|
+
* - currently available for iOS only.
|
|
789
|
+
* @memberof HMSSDK
|
|
790
|
+
*/
|
|
464
791
|
_defineProperty(this, "disableRTCStats", () => {
|
|
465
792
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function disableRTCStats', {
|
|
466
793
|
id: this.id
|
|
@@ -485,6 +812,14 @@ class HMSSDK {
|
|
|
485
812
|
id: this.id
|
|
486
813
|
});
|
|
487
814
|
});
|
|
815
|
+
/**
|
|
816
|
+
* - This wrapper function is used to start streaming device audio, currently available only for android.
|
|
817
|
+
*
|
|
818
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-share#how-to-stream-device-audio-from-the-app} for more info.
|
|
819
|
+
*
|
|
820
|
+
* @param {HMSAudioMixingMode}
|
|
821
|
+
* @memberof HMSSDK
|
|
822
|
+
*/
|
|
488
823
|
_defineProperty(this, "startAudioshare", async audioMixingMode => {
|
|
489
824
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function startAudioshare', {
|
|
490
825
|
id: this.id,
|
|
@@ -500,6 +835,13 @@ class HMSSDK {
|
|
|
500
835
|
return 'API currently not available for iOS';
|
|
501
836
|
}
|
|
502
837
|
});
|
|
838
|
+
/**
|
|
839
|
+
* - This wrapper function returns true if audio is being shared and vice versa, currently available only for android.
|
|
840
|
+
*
|
|
841
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-share#how-to-get-audio-share-status} for more info.
|
|
842
|
+
*
|
|
843
|
+
* @memberof HMSSDK
|
|
844
|
+
*/
|
|
503
845
|
_defineProperty(this, "isAudioShared", async () => {
|
|
504
846
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function isAudioShared', {
|
|
505
847
|
id: this.id
|
|
@@ -513,6 +855,13 @@ class HMSSDK {
|
|
|
513
855
|
return 'API currently not available for iOS';
|
|
514
856
|
}
|
|
515
857
|
});
|
|
858
|
+
/**
|
|
859
|
+
* - This wrapper function is used to stop streaming device audio, currently available only for android.
|
|
860
|
+
*
|
|
861
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-share#how-to-stop-audio-sharing} for more info.
|
|
862
|
+
*
|
|
863
|
+
* @memberof HMSSDK
|
|
864
|
+
*/
|
|
516
865
|
_defineProperty(this, "stopAudioshare", async () => {
|
|
517
866
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function stopAudioshare', {
|
|
518
867
|
id: this.id
|
|
@@ -526,6 +875,12 @@ class HMSSDK {
|
|
|
526
875
|
return 'API currently not available for iOS';
|
|
527
876
|
}
|
|
528
877
|
});
|
|
878
|
+
/**
|
|
879
|
+
* - This wrapper function returns the current audio mixing mode, currently available only for android.
|
|
880
|
+
*
|
|
881
|
+
* @memberof HMSSDK
|
|
882
|
+
* @return HMSAudioMixingMode
|
|
883
|
+
*/
|
|
529
884
|
_defineProperty(this, "getAudioMixingMode", async () => {
|
|
530
885
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function getAudioMixingMode', {
|
|
531
886
|
id: this.id
|
|
@@ -539,6 +894,14 @@ class HMSSDK {
|
|
|
539
894
|
return 'API currently not available for iOS';
|
|
540
895
|
}
|
|
541
896
|
});
|
|
897
|
+
/**
|
|
898
|
+
* - This wrapper function used to change the mode while the user is streaming audio, currently available only for android.
|
|
899
|
+
*
|
|
900
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-share#how-to-change-mode} for more info
|
|
901
|
+
*
|
|
902
|
+
* @param {HMSAudioMixingMode}
|
|
903
|
+
* @memberof HMSSDK
|
|
904
|
+
*/
|
|
542
905
|
_defineProperty(this, "setAudioMixingMode", async audioMixingMode => {
|
|
543
906
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function setAudioMixingMode', {
|
|
544
907
|
id: this.id,
|
|
@@ -554,6 +917,15 @@ class HMSSDK {
|
|
|
554
917
|
return 'API currently not available for iOS';
|
|
555
918
|
}
|
|
556
919
|
});
|
|
920
|
+
/**
|
|
921
|
+
* - This wrapper function returns the array of audio output devices which is of
|
|
922
|
+
* type {@link HMSAudioDevice[]}, currently available only for android.
|
|
923
|
+
*
|
|
924
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-output-routing#get-list-of-audio-device} for more info
|
|
925
|
+
*
|
|
926
|
+
* @memberof HMSSDK
|
|
927
|
+
* @return HMSAudioDevice[]
|
|
928
|
+
*/
|
|
557
929
|
_defineProperty(this, "getAudioDevicesList", async () => {
|
|
558
930
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function getAudioDevicesList', {
|
|
559
931
|
id: this.id
|
|
@@ -567,6 +939,15 @@ class HMSSDK {
|
|
|
567
939
|
return 'API currently not available for iOS';
|
|
568
940
|
}
|
|
569
941
|
});
|
|
942
|
+
/**
|
|
943
|
+
* - This wrapper function returns the current audio output device which is of
|
|
944
|
+
* type {@link HMSAudioDevice}, currently available only for android.
|
|
945
|
+
*
|
|
946
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-output-routing#get-current-focussed-device} for more info
|
|
947
|
+
*
|
|
948
|
+
* @memberof HMSSDK
|
|
949
|
+
* @return HMSAudioDevice
|
|
950
|
+
*/
|
|
570
951
|
_defineProperty(this, "getAudioOutputRouteType", async () => {
|
|
571
952
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function getAudioOutputRouteType', {
|
|
572
953
|
id: this.id
|
|
@@ -580,6 +961,14 @@ class HMSSDK {
|
|
|
580
961
|
return 'API currently not available for iOS';
|
|
581
962
|
}
|
|
582
963
|
});
|
|
964
|
+
/**
|
|
965
|
+
* - This wrapper function used to switch output to device other than the default, currently available only for android.
|
|
966
|
+
*
|
|
967
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-output-routing#switch-audio-focus-to-another-device} for more info
|
|
968
|
+
*
|
|
969
|
+
* @param {HMSAudioDevice}
|
|
970
|
+
* @memberof HMSSDK
|
|
971
|
+
*/
|
|
583
972
|
_defineProperty(this, "switchAudioOutput", audioDevice => {
|
|
584
973
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function switchAudioOutput', {
|
|
585
974
|
id: this.id,
|
|
@@ -595,6 +984,14 @@ class HMSSDK {
|
|
|
595
984
|
return 'API currently not available for iOS';
|
|
596
985
|
}
|
|
597
986
|
});
|
|
987
|
+
/**
|
|
988
|
+
* - This wrapper function used to change Audio Mode manually, currently available only for android.
|
|
989
|
+
*
|
|
990
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-mode-change} for more info
|
|
991
|
+
*
|
|
992
|
+
* @param {HMSAudioMode}
|
|
993
|
+
* @memberof HMSSDK
|
|
994
|
+
*/
|
|
598
995
|
_defineProperty(this, "setAudioMode", audioMode => {
|
|
599
996
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function setAudioMode', {
|
|
600
997
|
id: this.id,
|
|
@@ -610,6 +1007,14 @@ class HMSSDK {
|
|
|
610
1007
|
return 'API currently not available for iOS';
|
|
611
1008
|
}
|
|
612
1009
|
});
|
|
1010
|
+
/**
|
|
1011
|
+
* - This is a wrapper function which adds a listener which is triggered when audio output device is switched, currently available only for android.
|
|
1012
|
+
*
|
|
1013
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-output-routing#adding-a-listener} for more info
|
|
1014
|
+
*
|
|
1015
|
+
* @param {Function}
|
|
1016
|
+
* @memberof HMSSDK
|
|
1017
|
+
*/
|
|
613
1018
|
_defineProperty(this, "setAudioDeviceChangeListener", callback => {
|
|
614
1019
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function setAudioDeviceChangeListener', {
|
|
615
1020
|
id: this.id
|
|
@@ -642,6 +1047,13 @@ class HMSSDK {
|
|
|
642
1047
|
id: this.id
|
|
643
1048
|
});
|
|
644
1049
|
});
|
|
1050
|
+
/**
|
|
1051
|
+
* - This is a prototype event listener that takes action and listens for updates related to that particular action
|
|
1052
|
+
*
|
|
1053
|
+
* @param {string} action
|
|
1054
|
+
* @param {*} callback
|
|
1055
|
+
* @memberof HMSSDK
|
|
1056
|
+
*/
|
|
645
1057
|
_defineProperty(this, "addEventListener", (action, callback) => {
|
|
646
1058
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function addEventListener', {
|
|
647
1059
|
action,
|
|
@@ -893,6 +1305,13 @@ class HMSSDK {
|
|
|
893
1305
|
default:
|
|
894
1306
|
}
|
|
895
1307
|
});
|
|
1308
|
+
/**
|
|
1309
|
+
* - This is a prototype event listener that takes action and listens for updates related to that particular action
|
|
1310
|
+
*
|
|
1311
|
+
* @param {string} action
|
|
1312
|
+
* @param {*} callback
|
|
1313
|
+
* @memberof HMSSDK
|
|
1314
|
+
*/
|
|
896
1315
|
_defineProperty(this, "removeEventListener", action => {
|
|
897
1316
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function removeEventListener', {
|
|
898
1317
|
action,
|
|
@@ -1144,6 +1563,11 @@ class HMSSDK {
|
|
|
1144
1563
|
default:
|
|
1145
1564
|
}
|
|
1146
1565
|
});
|
|
1566
|
+
/**
|
|
1567
|
+
* removes all the listeners
|
|
1568
|
+
*
|
|
1569
|
+
* @memberof HMSSDK
|
|
1570
|
+
*/
|
|
1147
1571
|
_defineProperty(this, "removeAllListeners", () => {
|
|
1148
1572
|
this.onPreviewDelegate = null;
|
|
1149
1573
|
this.onJoinDelegate = null;
|
|
@@ -1171,6 +1595,20 @@ class HMSSDK {
|
|
|
1171
1595
|
id: this.id
|
|
1172
1596
|
});
|
|
1173
1597
|
});
|
|
1598
|
+
/**
|
|
1599
|
+
* - Below are all the listeners that are connected to native side.
|
|
1600
|
+
*
|
|
1601
|
+
* - All of the are connected when build function is called, we can connect them to the app by
|
|
1602
|
+
* calling {@link addEventListener} with corresponding event type.
|
|
1603
|
+
*
|
|
1604
|
+
* - Before passing the data to the eventListener of the app these listeners encode the data in
|
|
1605
|
+
* ts classes for a proper structuring of the data.
|
|
1606
|
+
*
|
|
1607
|
+
* - Even When event listeners of the app are disconnected using {@link removeEventListener} or
|
|
1608
|
+
* {@link removeAllListeners} or not even connected in first place, these functions still run to
|
|
1609
|
+
* maintain the current state of the instance of {@link HMSSDK}.
|
|
1610
|
+
*
|
|
1611
|
+
*/
|
|
1174
1612
|
_defineProperty(this, "onPreviewListener", data => {
|
|
1175
1613
|
if (data.id !== this.id) {
|
|
1176
1614
|
return;
|
|
@@ -1203,11 +1641,13 @@ class HMSSDK {
|
|
|
1203
1641
|
}
|
|
1204
1642
|
});
|
|
1205
1643
|
_defineProperty(this, "onRoomListener", data => {
|
|
1644
|
+
var _getHmsRoomCache2;
|
|
1206
1645
|
if (data.id !== this.id) {
|
|
1207
1646
|
return;
|
|
1208
1647
|
}
|
|
1209
1648
|
const room = _HMSEncoder.HMSEncoder.encodeHmsRoom(data.room, this.id);
|
|
1210
1649
|
const type = data.type;
|
|
1650
|
+
(_getHmsRoomCache2 = (0, _HMSRoomCache.getHmsRoomCache)()) === null || _getHmsRoomCache2 === void 0 ? void 0 : _getHmsRoomCache2.updateRoomCache(data.room, data.type);
|
|
1211
1651
|
if (this.onRoomDelegate) {
|
|
1212
1652
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Listener ON_ROOM_LISTENER_CALL', {
|
|
1213
1653
|
room,
|
|
@@ -1219,12 +1659,22 @@ class HMSSDK {
|
|
|
1219
1659
|
});
|
|
1220
1660
|
}
|
|
1221
1661
|
});
|
|
1222
|
-
_defineProperty(this, "onPeerListener",
|
|
1223
|
-
|
|
1224
|
-
|
|
1662
|
+
_defineProperty(this, "onPeerListener", peerData => {
|
|
1663
|
+
var _getHmsPeersCache;
|
|
1664
|
+
const data = {
|
|
1665
|
+
peer: peerData,
|
|
1666
|
+
type: null
|
|
1667
|
+
};
|
|
1668
|
+
for (const ordinal of _HMSPeerUpdate.HMSPeerUpdateOrdinals.keys()) {
|
|
1669
|
+
if (ordinal in peerData) {
|
|
1670
|
+
data.peer.peerID = peerData[ordinal];
|
|
1671
|
+
data.type = ordinal;
|
|
1672
|
+
break;
|
|
1673
|
+
}
|
|
1225
1674
|
}
|
|
1226
|
-
const peer = _HMSEncoder.HMSEncoder.encodeHmsPeer(data.peer
|
|
1227
|
-
const type = data.type;
|
|
1675
|
+
const peer = _HMSEncoder.HMSEncoder.encodeHmsPeer(data.peer);
|
|
1676
|
+
const type = _HMSEncoder.HMSEncoder.encodeHmsPeerUpdate(data.type) || data.type;
|
|
1677
|
+
(_getHmsPeersCache = (0, _HMSPeersCache.getHmsPeersCache)()) === null || _getHmsPeersCache === void 0 ? void 0 : _getHmsPeersCache.updatePeerCache(data.peer.peerID, data.peer, type);
|
|
1228
1678
|
if (this.onPeerDelegate) {
|
|
1229
1679
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Listener ON_PEER_LISTENER_CALL', {
|
|
1230
1680
|
peer,
|
|
@@ -1237,12 +1687,16 @@ class HMSSDK {
|
|
|
1237
1687
|
}
|
|
1238
1688
|
});
|
|
1239
1689
|
_defineProperty(this, "onTrackListener", data => {
|
|
1690
|
+
var _getHmsPeersCache2;
|
|
1240
1691
|
if (data.id !== this.id) {
|
|
1241
1692
|
return;
|
|
1242
1693
|
}
|
|
1243
1694
|
const track = _HMSEncoder.HMSEncoder.encodeHmsTrack(data.track, this.id);
|
|
1244
|
-
const peer = _HMSEncoder.HMSEncoder.encodeHmsPeer(data.peer
|
|
1695
|
+
const peer = _HMSEncoder.HMSEncoder.encodeHmsPeer(data.peer);
|
|
1245
1696
|
const type = data.type;
|
|
1697
|
+
(_getHmsPeersCache2 = (0, _HMSPeersCache.getHmsPeersCache)()) === null || _getHmsPeersCache2 === void 0 ? void 0 : _getHmsPeersCache2.updatePeerCache(data.peer.peerID, {
|
|
1698
|
+
track
|
|
1699
|
+
}, data.type);
|
|
1246
1700
|
if (this.muteStatus && (data === null || data === void 0 ? void 0 : data.type) === 'TRACK_ADDED' && track.type === _HMSTrackType.HMSTrackType.AUDIO) {
|
|
1247
1701
|
this.setPlaybackForAllAudio(this.muteStatus);
|
|
1248
1702
|
}
|
|
@@ -1263,7 +1717,7 @@ class HMSSDK {
|
|
|
1263
1717
|
if (data.id !== this.id) {
|
|
1264
1718
|
return;
|
|
1265
1719
|
}
|
|
1266
|
-
const message = _HMSEncoder.HMSEncoder.encodeHMSMessage(data
|
|
1720
|
+
const message = _HMSEncoder.HMSEncoder.encodeHMSMessage(data);
|
|
1267
1721
|
if (this.onMessageDelegate) {
|
|
1268
1722
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Listener ON_MESSAGE_LISTENER_CALL', message);
|
|
1269
1723
|
this.onMessageDelegate(message);
|
|
@@ -1293,7 +1747,7 @@ class HMSSDK {
|
|
|
1293
1747
|
return;
|
|
1294
1748
|
}
|
|
1295
1749
|
if (this.onRoleChangeRequestDelegate) {
|
|
1296
|
-
const encodedRoleChangeRequest = _HMSEncoder.HMSEncoder.encodeHmsRoleChangeRequest(data
|
|
1750
|
+
const encodedRoleChangeRequest = _HMSEncoder.HMSEncoder.encodeHmsRoleChangeRequest(data);
|
|
1297
1751
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Listener ON_ROLE_CHANGE_LISTENER_CALL', encodedRoleChangeRequest);
|
|
1298
1752
|
this.onRoleChangeRequestDelegate(encodedRoleChangeRequest);
|
|
1299
1753
|
}
|
|
@@ -1303,7 +1757,7 @@ class HMSSDK {
|
|
|
1303
1757
|
return;
|
|
1304
1758
|
}
|
|
1305
1759
|
if (this.onChangeTrackStateRequestDelegate) {
|
|
1306
|
-
const encodedRoleChangeRequest = _HMSEncoder.HMSEncoder.encodeHmsChangeTrackStateRequest(data
|
|
1760
|
+
const encodedRoleChangeRequest = _HMSEncoder.HMSEncoder.encodeHmsChangeTrackStateRequest(data);
|
|
1307
1761
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Listener ON_CHANGE_TRACK_STATE_REQUEST_LISTENER_CALL', encodedRoleChangeRequest);
|
|
1308
1762
|
this.onChangeTrackStateRequestDelegate(encodedRoleChangeRequest);
|
|
1309
1763
|
}
|
|
@@ -1316,7 +1770,7 @@ class HMSSDK {
|
|
|
1316
1770
|
if (this.onRemovedFromRoomDelegate) {
|
|
1317
1771
|
let requestedBy = null;
|
|
1318
1772
|
if (data.requestedBy) {
|
|
1319
|
-
requestedBy = _HMSEncoder.HMSEncoder.encodeHmsPeer(data.requestedBy
|
|
1773
|
+
requestedBy = _HMSEncoder.HMSEncoder.encodeHmsPeer(data.requestedBy);
|
|
1320
1774
|
}
|
|
1321
1775
|
const reason = data.reason;
|
|
1322
1776
|
const roomEnded = data.roomEnded;
|
|
@@ -1370,7 +1824,7 @@ class HMSSDK {
|
|
|
1370
1824
|
return;
|
|
1371
1825
|
}
|
|
1372
1826
|
let localAudioStats = new _HMSLocalAudioStats.HMSLocalAudioStats(data.localAudioStats);
|
|
1373
|
-
let peer = _HMSEncoder.HMSEncoder.encodeHmsPeer(data.peer
|
|
1827
|
+
let peer = _HMSEncoder.HMSEncoder.encodeHmsPeer(data.peer);
|
|
1374
1828
|
let track = _HMSEncoder.HMSEncoder.encodeHmsLocalAudioTrack(data.track, this.id);
|
|
1375
1829
|
if (this.onLocalAudioStatsDelegate) {
|
|
1376
1830
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Listener onLocalAudioStatsListener_CALL', {
|
|
@@ -1392,7 +1846,7 @@ class HMSSDK {
|
|
|
1392
1846
|
return;
|
|
1393
1847
|
}
|
|
1394
1848
|
let localVideoStats = new _HMSLocalVideoStats.HMSLocalVideoStats(data.localVideoStats);
|
|
1395
|
-
let peer = _HMSEncoder.HMSEncoder.encodeHmsPeer(data.peer
|
|
1849
|
+
let peer = _HMSEncoder.HMSEncoder.encodeHmsPeer(data.peer);
|
|
1396
1850
|
let track = _HMSEncoder.HMSEncoder.encodeHmsLocalVideoTrack(data.track, this.id);
|
|
1397
1851
|
if (this.onLocalVideoStatsDelegate) {
|
|
1398
1852
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Listener onLocalVideoStatsListener_CALL', {
|
|
@@ -1414,7 +1868,7 @@ class HMSSDK {
|
|
|
1414
1868
|
return;
|
|
1415
1869
|
}
|
|
1416
1870
|
let remoteAudioStats = new _HMSRemoteAudioStats.HMSRemoteAudioStats(data.remoteAudioStats);
|
|
1417
|
-
let peer = _HMSEncoder.HMSEncoder.encodeHmsPeer(data.peer
|
|
1871
|
+
let peer = _HMSEncoder.HMSEncoder.encodeHmsPeer(data.peer);
|
|
1418
1872
|
let track = _HMSEncoder.HMSEncoder.encodeHmsRemoteAudioTrack(data.track, this.id);
|
|
1419
1873
|
if (this.onRemoteAudioStatsDelegate) {
|
|
1420
1874
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Listener onRemoteAudioStatsListener_CALL', {
|
|
@@ -1436,7 +1890,7 @@ class HMSSDK {
|
|
|
1436
1890
|
return;
|
|
1437
1891
|
}
|
|
1438
1892
|
let remoteVideoStats = new _HMSRemoteVideoStats.HMSRemoteVideoStats(data.remoteVideoStats);
|
|
1439
|
-
let peer = _HMSEncoder.HMSEncoder.encodeHmsPeer(data.peer
|
|
1893
|
+
let peer = _HMSEncoder.HMSEncoder.encodeHmsPeer(data.peer);
|
|
1440
1894
|
let track = _HMSEncoder.HMSEncoder.encodeHmsRemoteVideoTrack(data.track, this.id);
|
|
1441
1895
|
if (this.onRemoteVideoStatsDelegate) {
|
|
1442
1896
|
_HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Listener onRemoteVideoStatsListener_CALL', {
|
|
@@ -1529,13 +1983,6 @@ class HMSSDK {
|
|
|
1529
1983
|
static getLogger() {
|
|
1530
1984
|
return (0, _HMSLogger.getLogger)();
|
|
1531
1985
|
}
|
|
1532
|
-
|
|
1533
|
-
/**
|
|
1534
|
-
* - Updates the logger for this instance of HMSSDK
|
|
1535
|
-
* @param {HMSLogger} hmsLogger
|
|
1536
|
-
* @memberof HMSSDK
|
|
1537
|
-
*/
|
|
1538
|
-
|
|
1539
1986
|
async isPipModeSupported() {
|
|
1540
1987
|
return HMSManager.handlePipActions('isPipModeSupported', {
|
|
1541
1988
|
id: this.id
|