@100mslive/react-native-hms 1.10.4 → 1.10.6-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/build.gradle +9 -2
- package/android/local.properties +1 -8
- package/android/src/main/java/com/reactnativehmssdk/HMSDecoder.kt +8 -0
- package/android/src/main/java/com/reactnativehmssdk/HMSManager.kt +52 -0
- package/android/src/main/java/com/reactnativehmssdk/HMSRNSDK.kt +6 -4
- package/android/src/main/java/com/reactnativehmssdk/Interactivity/HMSInteractivityDecoder.kt +50 -25
- package/android/src/main/java/com/reactnativehmssdk/Interactivity/HMSRNInteractivityCenter.kt +69 -1
- package/ios/HMSConstants.swift +1 -0
- package/ios/HMSDecoder.swift +9 -1
- package/ios/HMSHLSPlayerManager.swift +4 -1
- package/ios/HMSHelper.swift +28 -2
- package/ios/HMSInteractivityDecoder.swift +41 -0
- package/ios/HMSManager.m +34 -0
- package/ios/HMSManager.swift +66 -1
- package/ios/HMSRNInteractivityCenter.swift +41 -0
- package/ios/HMSRNSDK.swift +201 -3
- package/lib/commonjs/classes/HMSInteractivityCenter.js +58 -4
- package/lib/commonjs/classes/HMSInteractivityCenter.js.map +1 -1
- package/lib/commonjs/classes/HMSInteractivityEncoder.js +6 -0
- package/lib/commonjs/classes/HMSInteractivityEncoder.js.map +1 -1
- package/lib/commonjs/classes/HMSPermissions.js +2 -0
- package/lib/commonjs/classes/HMSPermissions.js.map +1 -1
- package/lib/commonjs/classes/HMSSessionStore.js +1 -1
- package/lib/commonjs/classes/HMSSessionStore.js.map +1 -1
- package/lib/commonjs/classes/HMSVideoTrackSettings.js +3 -2
- package/lib/commonjs/classes/HMSVideoTrackSettings.js.map +1 -1
- package/lib/commonjs/classes/whiteboard/HMSWhiteboard.js +6 -0
- package/lib/commonjs/classes/whiteboard/HMSWhiteboard.js.map +1 -0
- package/lib/commonjs/classes/whiteboard/HMSWhiteboardListenerActions.js +11 -0
- package/lib/commonjs/classes/whiteboard/HMSWhiteboardListenerActions.js.map +1 -0
- package/lib/commonjs/classes/whiteboard/HMSWhiteboardState.js +12 -0
- package/lib/commonjs/classes/whiteboard/HMSWhiteboardState.js.map +1 -0
- package/lib/commonjs/classes/whiteboard/HMSWhiteboardUpdateType.js +12 -0
- package/lib/commonjs/classes/whiteboard/HMSWhiteboardUpdateType.js.map +1 -0
- package/lib/commonjs/classes/whiteboard/index.js +39 -0
- package/lib/commonjs/classes/whiteboard/index.js.map +1 -0
- package/lib/commonjs/classes/whiteboard/registerCallbacks.js +26 -0
- package/lib/commonjs/classes/whiteboard/registerCallbacks.js.map +1 -0
- package/lib/commonjs/index.js +12 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/classes/HMSInteractivityCenter.js +58 -4
- package/lib/module/classes/HMSInteractivityCenter.js.map +1 -1
- package/lib/module/classes/HMSInteractivityEncoder.js +6 -0
- package/lib/module/classes/HMSInteractivityEncoder.js.map +1 -1
- package/lib/module/classes/HMSPermissions.js +2 -0
- package/lib/module/classes/HMSPermissions.js.map +1 -1
- package/lib/module/classes/HMSSessionStore.js +1 -1
- package/lib/module/classes/HMSSessionStore.js.map +1 -1
- package/lib/module/classes/HMSVideoTrackSettings.js +3 -2
- package/lib/module/classes/HMSVideoTrackSettings.js.map +1 -1
- package/lib/module/classes/whiteboard/HMSWhiteboard.js +2 -0
- package/lib/module/classes/whiteboard/HMSWhiteboard.js.map +1 -0
- package/lib/module/classes/whiteboard/HMSWhiteboardListenerActions.js +5 -0
- package/lib/module/classes/whiteboard/HMSWhiteboardListenerActions.js.map +1 -0
- package/lib/module/classes/whiteboard/HMSWhiteboardState.js +6 -0
- package/lib/module/classes/whiteboard/HMSWhiteboardState.js.map +1 -0
- package/lib/module/classes/whiteboard/HMSWhiteboardUpdateType.js +6 -0
- package/lib/module/classes/whiteboard/HMSWhiteboardUpdateType.js.map +1 -0
- package/lib/module/classes/whiteboard/index.js +4 -0
- package/lib/module/classes/whiteboard/index.js.map +1 -0
- package/lib/module/classes/whiteboard/registerCallbacks.js +18 -0
- package/lib/module/classes/whiteboard/registerCallbacks.js.map +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/classes/HMSInteractivityCenter.d.ts +19 -2
- package/lib/typescript/classes/HMSInteractivityEncoder.d.ts +2 -0
- package/lib/typescript/classes/HMSPermissions.d.ts +7 -0
- package/lib/typescript/classes/HMSVideoTrackSettings.d.ts +11 -0
- package/lib/typescript/classes/whiteboard/HMSWhiteboard.d.ts +10 -0
- package/lib/typescript/classes/whiteboard/HMSWhiteboardListenerActions.d.ts +3 -0
- package/lib/typescript/classes/whiteboard/HMSWhiteboardState.d.ts +4 -0
- package/lib/typescript/classes/whiteboard/HMSWhiteboardUpdateType.d.ts +4 -0
- package/lib/typescript/classes/whiteboard/index.d.ts +3 -0
- package/lib/typescript/classes/whiteboard/registerCallbacks.d.ts +8 -0
- package/lib/typescript/index.d.ts +1 -0
- package/package.json +1 -1
- package/sdk-versions.json +2 -2
- package/src/classes/HMSInteractivityCenter.ts +89 -10
- package/src/classes/HMSInteractivityEncoder.ts +8 -0
- package/src/classes/HMSPermissions.ts +9 -0
- package/src/classes/HMSSessionStore.ts +0 -3
- package/src/classes/HMSVideoTrackSettings.ts +15 -0
- package/src/classes/whiteboard/HMSWhiteboard.tsx +16 -0
- package/src/classes/whiteboard/HMSWhiteboardListenerActions.ts +3 -0
- package/src/classes/whiteboard/HMSWhiteboardState.tsx +4 -0
- package/src/classes/whiteboard/HMSWhiteboardUpdateType.tsx +4 -0
- package/src/classes/whiteboard/index.ts +3 -0
- package/src/classes/whiteboard/registerCallbacks.ts +34 -0
- package/src/index.ts +1 -0
- package/ios/Hmssdk.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- package/ios/Hmssdk.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/ios/Hmssdk.xcodeproj/project.xcworkspace/xcuserdata/jatinnagar.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/Hmssdk.xcodeproj/xcuserdata/jatinnagar.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DeviceEventEmitter","HMSManager","HMSConstants","getLogger","HMSUpdateListenerActions","EventEmitter","HMSSessionStore","constructor","_defineProperty","set","value","key","data","setSessionMetadataForKey","id","DEFAULT_SDK_ID","get","getSessionMetadataForKey","addKeyChangeListener","forKeys","callback","_deviceEventEmitterSubscription","addListener","ON_SESSION_STORE_CHANGED","_deviceEventEmitterListener","bind","_eventEmitter","uniqueId","join","Date","now","toString","eventEmitter","subscriptions","map","cleanupHandler","_cleanup","keys","catch","err","_addedKeyChangeListenerCount","remove","subscriptionsToRemove","length","context","forEach","subscription","removeKeyChangeListener","error","logger","verbose","Object","getOwnPropertyNames","includes","removeListener","undefined","_getLogger","_this$_eventEmitter","emit"],"sources":["HMSSessionStore.ts"],"sourcesContent":["import { DeviceEventEmitter } from 'react-native';\nimport type { EmitterSubscription as RNEmitterSubscription } from 'react-native';\n\nimport HMSManager from '../modules/HMSManagerModule';\n\nimport { HMSConstants } from './HMSConstants';\nimport { getLogger } from './HMSLogger';\nimport { HMSUpdateListenerActions } from './HMSUpdateListenerActions';\nimport { EventEmitter } from '../utils';\nimport type { EmitterSubscription } from '../utils';\n\nexport type JsonPrimitive = string | number | boolean | null;\nexport type JsonMap = {\n [key: string]: JsonPrimitive | JsonMap | JsonArray;\n};\nexport type JsonArray = Array<JsonPrimitive | JsonMap | JsonArray>;\nexport type JsonValue = JsonPrimitive | JsonMap | JsonArray;\n\n/**\n * Session store is a shared realtime key-value store that is accessible by everyone in the room.\n * It can be utilized to implement features such as pinned text, spotlight (which brings a particular\n * peer to the center stage for everyone in the room) and more.\n *\n * To get an instance of `HMSSessionStore` class, You can add an event listener for `ON_SESSION_STORE_AVAILABLE`\n * event on the `HMSSDK` instance\n *\n * For example:\n * ```\n * hmsInstance.addEventListener(HMSUpdateListenerActions.ON_SESSION_STORE_AVAILABLE, <your callback function>);\n * ```\n *\n * Checkout Session Store docs fore more details ${@link https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/room/session-store}\n */\nexport class HMSSessionStore {\n private _deviceEventEmitterSubscription?: RNEmitterSubscription;\n private _eventEmitter?: EventEmitter;\n private _addedKeyChangeListenerCount = 0;\n\n /**\n * This method sets a value for a specific key on session store.\n * Once a value is assigned, it will be available for other peers in the room\n * who are listening for changes in value for that specific key.\n *\n * @param {JsonValue} value\n * @param {string} key\n * @returns {Promise}\n */\n async set(value: JsonValue, key: string) {\n const data: { success: true } = await HMSManager.setSessionMetadataForKey({\n id: HMSConstants.DEFAULT_SDK_ID,\n key,\n value,\n });\n return data;\n }\n\n /**\n * This method returns the value of any specified key on session store.\n * Note that you will not get updates for any change in value of the specified key,\n * It returns the latest value at the time it was called.\n *\n * To listen to value change updates use `addKeyChangeListener` method instead.\n *\n * @param {string} key\n * @returns {Promise}\n */\n async get(key: string) {\n const data: JsonValue = await HMSManager.getSessionMetadataForKey({\n id: HMSConstants.DEFAULT_SDK_ID,\n key,\n });\n return data;\n }\n\n /**\n * This method registers a callback function for listening to value changes of a particular key.\n * Registered Callback function will be called initially with latest value and whenever the value updates\n *\n * @param {string[]} forKeys\n * @param {Function} callback\n * @returns {Object} subscription object\n */\n addKeyChangeListener<T extends string[]>(\n forKeys: T,\n callback: (\n error: string | null,\n data: { key: T[number]; value: JsonValue } | null\n ) => void\n ) {\n // Add Native Device Event Emitter if it is not already added\n if (!this._deviceEventEmitterSubscription) {\n this._deviceEventEmitterSubscription = DeviceEventEmitter.addListener(\n HMSUpdateListenerActions.ON_SESSION_STORE_CHANGED,\n this._deviceEventEmitterListener.bind(this)\n );\n }\n\n // Create JS side EventEmitter\n if (!this._eventEmitter) {\n this._eventEmitter = new EventEmitter();\n }\n\n // Unique Identifier for adding native event listener\n const uniqueId = forKeys.join('') + '_' + Date.now().toString();\n\n const eventEmitter = this._eventEmitter;\n\n // Add listeners on eventEmitter for each key\n const subscriptions = forKeys.map((key) =>\n eventEmitter.addListener(key, callback, { uniqueId })\n );\n\n //\n let cleanupHandler: (() => void) | null = () => {\n this._cleanup(subscriptions);\n };\n\n // Adding 'KeyChangeListener' on native side\n HMSManager.addKeyChangeListener({\n id: HMSConstants.DEFAULT_SDK_ID,\n keys: forKeys,\n uniqueId,\n })\n // Adding 'KeyChangeListener' fails on native side\n .catch((err: any) => {\n if (typeof cleanupHandler === 'function') {\n callback(err, null);\n cleanupHandler();\n cleanupHandler = null;\n }\n });\n\n this._addedKeyChangeListenerCount += 1;\n\n return {\n remove: () => {\n if (typeof cleanupHandler === 'function') {\n cleanupHandler();\n cleanupHandler = null;\n }\n },\n };\n }\n\n private _cleanup(subscriptionsToRemove: EmitterSubscription[]) {\n // Extracting `uniqueId` from first subscription (all subscriptions have same uniqueId)\n // this `uniqueId` will be used to remove 'KeyChangeListener' from native side\n const uniqueId =\n subscriptionsToRemove.length > 0\n ? (subscriptionsToRemove[0]!.context as { uniqueId: string }).uniqueId\n : null;\n\n // Removing required subscriptions from 'eventEmitter'\n subscriptionsToRemove.forEach((subscription) => subscription.remove());\n\n // Removing 'KeyChangeListener' from native side\n HMSManager.removeKeyChangeListener({\n id: HMSConstants.DEFAULT_SDK_ID,\n uniqueId,\n }).catch((error: any) => {\n const logger = getLogger();\n logger?.verbose(\n \"Error while removing key change listener, Listener didn't get registerred at first place or was already removed\",\n error\n );\n });\n\n this._addedKeyChangeListenerCount -= 1;\n\n if (this._addedKeyChangeListenerCount <= 0) {\n this._addedKeyChangeListenerCount = 0;\n if (\n this._deviceEventEmitterSubscription &&\n Object.getOwnPropertyNames(\n this._deviceEventEmitterSubscription\n ).includes('remove') &&\n typeof this._deviceEventEmitterSubscription.remove === 'function'\n ) {\n this._deviceEventEmitterSubscription.remove();\n } else {\n DeviceEventEmitter.removeListener(\n HMSUpdateListenerActions.ON_SESSION_STORE_CHANGED,\n this._deviceEventEmitterListener\n );\n }\n\n this._deviceEventEmitterSubscription = undefined;\n\n this._eventEmitter = undefined;\n }\n }\n\n private _deviceEventEmitterListener(data: {\n id: string;\n key: string;\n value: JsonValue;\n }) {\n // if id is different from default sdk_id, return early\n if (data.id !== HMSConstants.DEFAULT_SDK_ID) {\n return;\n }\n\n // emit event for the key\n getLogger()?.verbose('#Listener ON_SESSION_STORE_CHANGED event: ', data);\n\n this._eventEmitter?.emit(data.key, null, data);\n }\n}\n"],"mappings":";;;AAAA,SAASA,kBAAkB,QAAQ,cAAc;AAGjD,OAAOC,UAAU,MAAM,6BAA6B;AAEpD,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,SAAS,QAAQ,aAAa;AACvC,SAASC,wBAAwB,QAAQ,4BAA4B;AACrE,SAASC,YAAY,QAAQ,UAAU;AAUvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,eAAe,CAAC;EAAAC,YAAA;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA,uCAGY,CAAC;EAAA;EAExC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,MAAMC,GAAGA,CAACC,KAAgB,EAAEC,GAAW,EAAE;IACvC,MAAMC,IAAuB,GAAG,MAAMX,UAAU,CAACY,wBAAwB,CAAC;MACxEC,EAAE,EAAEZ,YAAY,CAACa,cAAc;MAC/BJ,GAAG;MACHD;IACF,CAAC,CAAC;IACF,OAAOE,IAAI;EACb;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,MAAMI,GAAGA,CAACL,GAAW,EAAE;IACrB,MAAMC,IAAe,GAAG,MAAMX,UAAU,CAACgB,wBAAwB,CAAC;MAChEH,EAAE,EAAEZ,YAAY,CAACa,cAAc;MAC/BJ;IACF,CAAC,CAAC;IACF,OAAOC,IAAI;EACb;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEM,oBAAoBA,CAClB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;IAChC;EACF;EAEQ/B,2BAA2BA,CAACZ,IAInC,EAAE;IAAA,IAAA4C,UAAA,EAAAC,mBAAA;IACD;IACA,IAAI7C,IAAI,CAACE,EAAE,KAAKZ,YAAY,CAACa,cAAc,EAAE;MAC3C;IACF;;IAEA;IACA,CAAAyC,UAAA,GAAArD,SAAS,CAAC,CAAC,cAAAqD,UAAA,eAAXA,UAAA,CAAaN,OAAO,CAAC,4CAA4C,EAAEtC,IAAI,CAAC;IAExE,CAAA6C,mBAAA,OAAI,CAAC/B,aAAa,cAAA+B,mBAAA,eAAlBA,mBAAA,CAAoBC,IAAI,CAAC9C,IAAI,CAACD,GAAG,EAAE,IAAI,EAAEC,IAAI,CAAC;EAChD;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["DeviceEventEmitter","HMSManager","HMSConstants","getLogger","HMSUpdateListenerActions","EventEmitter","HMSSessionStore","constructor","_defineProperty","set","value","key","data","setSessionMetadataForKey","id","DEFAULT_SDK_ID","get","getSessionMetadataForKey","addKeyChangeListener","forKeys","callback","_deviceEventEmitterSubscription","addListener","ON_SESSION_STORE_CHANGED","_deviceEventEmitterListener","bind","_eventEmitter","uniqueId","join","Date","now","toString","eventEmitter","subscriptions","map","cleanupHandler","_cleanup","keys","catch","err","_addedKeyChangeListenerCount","remove","subscriptionsToRemove","length","context","forEach","subscription","removeKeyChangeListener","error","logger","verbose","removeListener","undefined","_getLogger","_this$_eventEmitter","emit"],"sources":["HMSSessionStore.ts"],"sourcesContent":["import { DeviceEventEmitter } from 'react-native';\nimport type { EmitterSubscription as RNEmitterSubscription } from 'react-native';\n\nimport HMSManager from '../modules/HMSManagerModule';\n\nimport { HMSConstants } from './HMSConstants';\nimport { getLogger } from './HMSLogger';\nimport { HMSUpdateListenerActions } from './HMSUpdateListenerActions';\nimport { EventEmitter } from '../utils';\nimport type { EmitterSubscription } from '../utils';\n\nexport type JsonPrimitive = string | number | boolean | null;\nexport type JsonMap = {\n [key: string]: JsonPrimitive | JsonMap | JsonArray;\n};\nexport type JsonArray = Array<JsonPrimitive | JsonMap | JsonArray>;\nexport type JsonValue = JsonPrimitive | JsonMap | JsonArray;\n\n/**\n * Session store is a shared realtime key-value store that is accessible by everyone in the room.\n * It can be utilized to implement features such as pinned text, spotlight (which brings a particular\n * peer to the center stage for everyone in the room) and more.\n *\n * To get an instance of `HMSSessionStore` class, You can add an event listener for `ON_SESSION_STORE_AVAILABLE`\n * event on the `HMSSDK` instance\n *\n * For example:\n * ```\n * hmsInstance.addEventListener(HMSUpdateListenerActions.ON_SESSION_STORE_AVAILABLE, <your callback function>);\n * ```\n *\n * Checkout Session Store docs fore more details ${@link https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/room/session-store}\n */\nexport class HMSSessionStore {\n private _deviceEventEmitterSubscription?: RNEmitterSubscription;\n private _eventEmitter?: EventEmitter;\n private _addedKeyChangeListenerCount = 0;\n\n /**\n * This method sets a value for a specific key on session store.\n * Once a value is assigned, it will be available for other peers in the room\n * who are listening for changes in value for that specific key.\n *\n * @param {JsonValue} value\n * @param {string} key\n * @returns {Promise}\n */\n async set(value: JsonValue, key: string) {\n const data: { success: true } = await HMSManager.setSessionMetadataForKey({\n id: HMSConstants.DEFAULT_SDK_ID,\n key,\n value,\n });\n return data;\n }\n\n /**\n * This method returns the value of any specified key on session store.\n * Note that you will not get updates for any change in value of the specified key,\n * It returns the latest value at the time it was called.\n *\n * To listen to value change updates use `addKeyChangeListener` method instead.\n *\n * @param {string} key\n * @returns {Promise}\n */\n async get(key: string) {\n const data: JsonValue = await HMSManager.getSessionMetadataForKey({\n id: HMSConstants.DEFAULT_SDK_ID,\n key,\n });\n return data;\n }\n\n /**\n * This method registers a callback function for listening to value changes of a particular key.\n * Registered Callback function will be called initially with latest value and whenever the value updates\n *\n * @param {string[]} forKeys\n * @param {Function} callback\n * @returns {Object} subscription object\n */\n addKeyChangeListener<T extends string[]>(\n forKeys: T,\n callback: (\n error: string | null,\n data: { key: T[number]; value: JsonValue } | null\n ) => void\n ) {\n // Add Native Device Event Emitter if it is not already added\n if (!this._deviceEventEmitterSubscription) {\n this._deviceEventEmitterSubscription = DeviceEventEmitter.addListener(\n HMSUpdateListenerActions.ON_SESSION_STORE_CHANGED,\n this._deviceEventEmitterListener.bind(this)\n );\n }\n\n // Create JS side EventEmitter\n if (!this._eventEmitter) {\n this._eventEmitter = new EventEmitter();\n }\n\n // Unique Identifier for adding native event listener\n const uniqueId = forKeys.join('') + '_' + Date.now().toString();\n\n const eventEmitter = this._eventEmitter;\n\n // Add listeners on eventEmitter for each key\n const subscriptions = forKeys.map((key) =>\n eventEmitter.addListener(key, callback, { uniqueId })\n );\n\n //\n let cleanupHandler: (() => void) | null = () => {\n this._cleanup(subscriptions);\n };\n\n // Adding 'KeyChangeListener' on native side\n HMSManager.addKeyChangeListener({\n id: HMSConstants.DEFAULT_SDK_ID,\n keys: forKeys,\n uniqueId,\n })\n // Adding 'KeyChangeListener' fails on native side\n .catch((err: any) => {\n if (typeof cleanupHandler === 'function') {\n callback(err, null);\n cleanupHandler();\n cleanupHandler = null;\n }\n });\n\n this._addedKeyChangeListenerCount += 1;\n\n return {\n remove: () => {\n if (typeof cleanupHandler === 'function') {\n cleanupHandler();\n cleanupHandler = null;\n }\n },\n };\n }\n\n private _cleanup(subscriptionsToRemove: EmitterSubscription[]) {\n // Extracting `uniqueId` from first subscription (all subscriptions have same uniqueId)\n // this `uniqueId` will be used to remove 'KeyChangeListener' from native side\n const uniqueId =\n subscriptionsToRemove.length > 0\n ? (subscriptionsToRemove[0]!.context as { uniqueId: string }).uniqueId\n : null;\n\n // Removing required subscriptions from 'eventEmitter'\n subscriptionsToRemove.forEach((subscription) => subscription.remove());\n\n // Removing 'KeyChangeListener' from native side\n HMSManager.removeKeyChangeListener({\n id: HMSConstants.DEFAULT_SDK_ID,\n uniqueId,\n }).catch((error: any) => {\n const logger = getLogger();\n logger?.verbose(\n \"Error while removing key change listener, Listener didn't get registerred at first place or was already removed\",\n error\n );\n });\n\n this._addedKeyChangeListenerCount -= 1;\n\n if (this._addedKeyChangeListenerCount <= 0) {\n this._addedKeyChangeListenerCount = 0;\n if (\n this._deviceEventEmitterSubscription &&\n typeof this._deviceEventEmitterSubscription.remove === 'function'\n ) {\n this._deviceEventEmitterSubscription.remove();\n } else {\n DeviceEventEmitter.removeListener(\n HMSUpdateListenerActions.ON_SESSION_STORE_CHANGED,\n this._deviceEventEmitterListener\n );\n }\n\n this._deviceEventEmitterSubscription = undefined;\n\n this._eventEmitter = undefined;\n }\n }\n\n private _deviceEventEmitterListener(data: {\n id: string;\n key: string;\n value: JsonValue;\n }) {\n // if id is different from default sdk_id, return early\n if (data.id !== HMSConstants.DEFAULT_SDK_ID) {\n return;\n }\n\n // emit event for the key\n getLogger()?.verbose('#Listener ON_SESSION_STORE_CHANGED event: ', data);\n\n this._eventEmitter?.emit(data.key, null, data);\n }\n}\n"],"mappings":";;;AAAA,SAASA,kBAAkB,QAAQ,cAAc;AAGjD,OAAOC,UAAU,MAAM,6BAA6B;AAEpD,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,SAAS,QAAQ,aAAa;AACvC,SAASC,wBAAwB,QAAQ,4BAA4B;AACrE,SAASC,YAAY,QAAQ,UAAU;AAUvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,eAAe,CAAC;EAAAC,YAAA;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA,uCAGY,CAAC;EAAA;EAExC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,MAAMC,GAAGA,CAACC,KAAgB,EAAEC,GAAW,EAAE;IACvC,MAAMC,IAAuB,GAAG,MAAMX,UAAU,CAACY,wBAAwB,CAAC;MACxEC,EAAE,EAAEZ,YAAY,CAACa,cAAc;MAC/BJ,GAAG;MACHD;IACF,CAAC,CAAC;IACF,OAAOE,IAAI;EACb;;EAEA;AACF;AACA;AACA;AACA;AAC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,kBAAkB,CAACmD,cAAc,CAC/B/C,wBAAwB,CAACmB,wBAAwB,EACjD,IAAI,CAACC,2BACP,CAAC;MACH;MAEA,IAAI,CAACH,+BAA+B,GAAG+B,SAAS;MAEhD,IAAI,CAAC1B,aAAa,GAAG0B,SAAS;IAChC;EACF;EAEQ5B,2BAA2BA,CAACZ,IAInC,EAAE;IAAA,IAAAyC,UAAA,EAAAC,mBAAA;IACD;IACA,IAAI1C,IAAI,CAACE,EAAE,KAAKZ,YAAY,CAACa,cAAc,EAAE;MAC3C;IACF;;IAEA;IACA,CAAAsC,UAAA,GAAAlD,SAAS,CAAC,CAAC,cAAAkD,UAAA,eAAXA,UAAA,CAAaH,OAAO,CAAC,4CAA4C,EAAEtC,IAAI,CAAC;IAExE,CAAA0C,mBAAA,OAAI,CAAC5B,aAAa,cAAA4B,mBAAA,eAAlBA,mBAAA,CAAoBC,IAAI,CAAC3C,IAAI,CAACD,GAAG,EAAE,IAAI,EAAEC,IAAI,CAAC;EAChD;AACF","ignoreList":[]}
|
|
@@ -7,8 +7,6 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
|
7
7
|
* Checkout Track Settings docs for more details {@link https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/track/track-settings}
|
|
8
8
|
*/
|
|
9
9
|
export class HMSVideoTrackSettings {
|
|
10
|
-
// android only
|
|
11
|
-
|
|
12
10
|
constructor(params) {
|
|
13
11
|
_defineProperty(this, "simulcastSettings", void 0);
|
|
14
12
|
_defineProperty(this, "initialState", void 0);
|
|
@@ -16,11 +14,14 @@ export class HMSVideoTrackSettings {
|
|
|
16
14
|
_defineProperty(this, "forceSoftwareDecoder", void 0);
|
|
17
15
|
// android only
|
|
18
16
|
_defineProperty(this, "disableAutoResize", void 0);
|
|
17
|
+
// android only
|
|
18
|
+
_defineProperty(this, "videoPlugin", void 0);
|
|
19
19
|
this.simulcastSettings = params.simulcastSettings;
|
|
20
20
|
this.initialState = params.initialState;
|
|
21
21
|
this.cameraFacing = params.cameraFacing;
|
|
22
22
|
this.forceSoftwareDecoder = params.forceSoftwareDecoder;
|
|
23
23
|
this.disableAutoResize = params.disableAutoResize;
|
|
24
|
+
this.videoPlugin = params.videoPlugin;
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
27
|
//# sourceMappingURL=HMSVideoTrackSettings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["HMSVideoTrackSettings","constructor","params","_defineProperty","simulcastSettings","initialState","cameraFacing","forceSoftwareDecoder","disableAutoResize"],"sources":["HMSVideoTrackSettings.ts"],"sourcesContent":["import type { HMSSimulcastLayerSettings } from './HMSSimulcastLayerSettings';\nimport type { HMSCameraFacing } from './HMSCameraFacing';\nimport type { HMSTrackSettingsInitState } from './HMSTrackSettingsInitState';\n\n/**\n * Customize local peer's Video track settings before Joining the Room.\n *\n * Checkout Track Settings docs for more details {@link https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/track/track-settings}\n */\nexport class HMSVideoTrackSettings {\n readonly simulcastSettings?: HMSSimulcastLayerSettings[];\n initialState?: HMSTrackSettingsInitState;\n cameraFacing?: HMSCameraFacing;\n forceSoftwareDecoder?: boolean; // android only\n disableAutoResize?: boolean; // android only\n\n constructor(params: {\n simulcastSettings?: HMSSimulcastLayerSettings[];\n initialState?: HMSTrackSettingsInitState;\n cameraFacing?: HMSCameraFacing;\n forceSoftwareDecoder?: boolean;\n disableAutoResize?: boolean;\n }) {\n this.simulcastSettings = params.simulcastSettings;\n this.initialState = params.initialState;\n this.cameraFacing = params.cameraFacing;\n this.forceSoftwareDecoder = params.forceSoftwareDecoder;\n this.disableAutoResize = params.disableAutoResize;\n }\n}\n"],"mappings":";;;
|
|
1
|
+
{"version":3,"names":["HMSVideoTrackSettings","constructor","params","_defineProperty","simulcastSettings","initialState","cameraFacing","forceSoftwareDecoder","disableAutoResize","videoPlugin"],"sources":["HMSVideoTrackSettings.ts"],"sourcesContent":["import type { ImageURISource, ImageRequireSource } from 'react-native';\nimport type { HMSSimulcastLayerSettings } from './HMSSimulcastLayerSettings';\nimport type { HMSCameraFacing } from './HMSCameraFacing';\nimport type { HMSTrackSettingsInitState } from './HMSTrackSettingsInitState';\n\nexport declare class HMSVirtualBackgroundPlugin {\n static NAME: string;\n constructor();\n enable(): Promise<boolean>;\n disable(): Promise<boolean>;\n setBlur(blurRadius: number): Promise<boolean>;\n setBackground(\n backgroundImage: ImageURISource | ImageRequireSource\n ): Promise<boolean>;\n}\n\n/**\n * Customize local peer's Video track settings before Joining the Room.\n *\n * Checkout Track Settings docs for more details {@link https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/track/track-settings}\n */\nexport class HMSVideoTrackSettings {\n readonly simulcastSettings?: HMSSimulcastLayerSettings[];\n initialState?: HMSTrackSettingsInitState;\n cameraFacing?: HMSCameraFacing;\n forceSoftwareDecoder?: boolean; // android only\n disableAutoResize?: boolean; // android only\n videoPlugin?: HMSVirtualBackgroundPlugin;\n\n constructor(params: {\n simulcastSettings?: HMSSimulcastLayerSettings[];\n initialState?: HMSTrackSettingsInitState;\n cameraFacing?: HMSCameraFacing;\n forceSoftwareDecoder?: boolean;\n disableAutoResize?: boolean;\n videoPlugin?: HMSVirtualBackgroundPlugin;\n }) {\n this.simulcastSettings = params.simulcastSettings;\n this.initialState = params.initialState;\n this.cameraFacing = params.cameraFacing;\n this.forceSoftwareDecoder = params.forceSoftwareDecoder;\n this.disableAutoResize = params.disableAutoResize;\n this.videoPlugin = params.videoPlugin;\n }\n}\n"],"mappings":";;;AAgBA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,qBAAqB,CAAC;EAQjCC,WAAWA,CAACC,MAOX,EAAE;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAX6B;IAAAA,eAAA;IACH;IAAAA,eAAA;IAW3B,IAAI,CAACC,iBAAiB,GAAGF,MAAM,CAACE,iBAAiB;IACjD,IAAI,CAACC,YAAY,GAAGH,MAAM,CAACG,YAAY;IACvC,IAAI,CAACC,YAAY,GAAGJ,MAAM,CAACI,YAAY;IACvC,IAAI,CAACC,oBAAoB,GAAGL,MAAM,CAACK,oBAAoB;IACvD,IAAI,CAACC,iBAAiB,GAAGN,MAAM,CAACM,iBAAiB;IACjD,IAAI,CAACC,WAAW,GAAGP,MAAM,CAACO,WAAW;EACvC;AACF","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["HMSWhiteboard.tsx"],"sourcesContent":["import type { HMSPeer } from '../HMSPeer';\nimport type { HMSWhiteboardState } from './HMSWhiteboardState';\n\nexport interface HMSWhiteboard {\n id: string;\n\n title?: string;\n\n state: HMSWhiteboardState;\n\n isOwner: boolean;\n\n owner?: HMSPeer;\n\n url?: string;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export let HMSWhiteboardListenerActions = /*#__PURE__*/function (HMSWhiteboardListenerActions) {
|
|
2
|
+
HMSWhiteboardListenerActions["ON_WHITEBOARD_UPDATE"] = "ON_WHITEBOARD_UPDATE";
|
|
3
|
+
return HMSWhiteboardListenerActions;
|
|
4
|
+
}({});
|
|
5
|
+
//# sourceMappingURL=HMSWhiteboardListenerActions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["HMSWhiteboardListenerActions"],"sources":["HMSWhiteboardListenerActions.ts"],"sourcesContent":["export enum HMSWhiteboardListenerActions {\n ON_WHITEBOARD_UPDATE = 'ON_WHITEBOARD_UPDATE',\n}\n"],"mappings":"AAAA,WAAYA,4BAA4B,0BAA5BA,4BAA4B;EAA5BA,4BAA4B;EAAA,OAA5BA,4BAA4B;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["HMSWhiteboardState"],"sources":["HMSWhiteboardState.tsx"],"sourcesContent":["export enum HMSWhiteboardState {\n STARTED = 'STARTED',\n STOPPED = 'STOPPED',\n}\n"],"mappings":"AAAA,WAAYA,kBAAkB,0BAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAA,OAAlBA,kBAAkB;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export let HMSWhiteboardUpdateType = /*#__PURE__*/function (HMSWhiteboardUpdateType) {
|
|
2
|
+
HMSWhiteboardUpdateType["STARTED"] = "STARTED";
|
|
3
|
+
HMSWhiteboardUpdateType["STOPPED"] = "STOPPED";
|
|
4
|
+
return HMSWhiteboardUpdateType;
|
|
5
|
+
}({});
|
|
6
|
+
//# sourceMappingURL=HMSWhiteboardUpdateType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["HMSWhiteboardUpdateType"],"sources":["HMSWhiteboardUpdateType.tsx"],"sourcesContent":["export enum HMSWhiteboardUpdateType {\n STARTED = 'STARTED',\n STOPPED = 'STOPPED',\n}\n"],"mappings":"AAAA,WAAYA,uBAAuB,0BAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAA,OAAvBA,uBAAuB;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './HMSWhiteboard';\nexport * from './HMSWhiteboardUpdateType';\nexport * from './HMSWhiteboardListenerActions';\n"],"mappings":"AAAA,cAAc,iBAAiB;AAC/B,cAAc,2BAA2B;AACzC,cAAc,gCAAgC","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HMSConstants } from '../HMSConstants';
|
|
2
|
+
import HMSNativeEventListener from '../HMSNativeEventListener';
|
|
3
|
+
import { HMSWhiteboardListenerActions } from './HMSWhiteboardListenerActions';
|
|
4
|
+
let whiteboardUpdateSubscription = null;
|
|
5
|
+
export function registerWhiteboardUpdateListener(listener) {
|
|
6
|
+
if (whiteboardUpdateSubscription !== null) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
whiteboardUpdateSubscription = HMSNativeEventListener.addListener(HMSConstants.DEFAULT_SDK_ID, HMSWhiteboardListenerActions.ON_WHITEBOARD_UPDATE, listener);
|
|
10
|
+
}
|
|
11
|
+
export function unregisterWhiteboardUpdateListener() {
|
|
12
|
+
if (whiteboardUpdateSubscription === null) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
whiteboardUpdateSubscription.remove();
|
|
16
|
+
whiteboardUpdateSubscription = null;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=registerCallbacks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["HMSConstants","HMSNativeEventListener","HMSWhiteboardListenerActions","whiteboardUpdateSubscription","registerWhiteboardUpdateListener","listener","addListener","DEFAULT_SDK_ID","ON_WHITEBOARD_UPDATE","unregisterWhiteboardUpdateListener","remove"],"sources":["registerCallbacks.ts"],"sourcesContent":["import { HMSConstants } from '../HMSConstants';\nimport type { HMSEventSubscription } from '../HMSNativeEventEmitter';\nimport HMSNativeEventListener from '../HMSNativeEventListener';\nimport type { HMSWhiteboard } from './HMSWhiteboard';\nimport { HMSWhiteboardListenerActions } from './HMSWhiteboardListenerActions';\nimport type { HMSWhiteboardUpdateType } from './HMSWhiteboardUpdateType';\n\nexport type WhiteboardUpdateListener = (data: {\n hmsWhiteboard: HMSWhiteboard;\n updateType: HMSWhiteboardUpdateType;\n}) => void;\n\nlet whiteboardUpdateSubscription: null | HMSEventSubscription = null;\n\nexport function registerWhiteboardUpdateListener(\n listener: WhiteboardUpdateListener\n) {\n if (whiteboardUpdateSubscription !== null) {\n return;\n }\n whiteboardUpdateSubscription = HMSNativeEventListener.addListener(\n HMSConstants.DEFAULT_SDK_ID,\n HMSWhiteboardListenerActions.ON_WHITEBOARD_UPDATE,\n listener\n );\n}\n\nexport function unregisterWhiteboardUpdateListener() {\n if (whiteboardUpdateSubscription === null) {\n return;\n }\n whiteboardUpdateSubscription.remove();\n whiteboardUpdateSubscription = null;\n}\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,iBAAiB;AAE9C,OAAOC,sBAAsB,MAAM,2BAA2B;AAE9D,SAASC,4BAA4B,QAAQ,gCAAgC;AAQ7E,IAAIC,4BAAyD,GAAG,IAAI;AAEpE,OAAO,SAASC,gCAAgCA,CAC9CC,QAAkC,EAClC;EACA,IAAIF,4BAA4B,KAAK,IAAI,EAAE;IACzC;EACF;EACAA,4BAA4B,GAAGF,sBAAsB,CAACK,WAAW,CAC/DN,YAAY,CAACO,cAAc,EAC3BL,4BAA4B,CAACM,oBAAoB,EACjDH,QACF,CAAC;AACH;AAEA,OAAO,SAASI,kCAAkCA,CAAA,EAAG;EACnD,IAAIN,4BAA4B,KAAK,IAAI,EAAE;IACzC;EACF;EACAA,4BAA4B,CAACO,MAAM,CAAC,CAAC;EACrCP,4BAA4B,GAAG,IAAI;AACrC","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -86,6 +86,7 @@ export * from './classes/HMSStreamingState';
|
|
|
86
86
|
export * from './classes/HMSHLSPlaylistType';
|
|
87
87
|
export { HMSRecordingState } from './classes/HMSRecordingState';
|
|
88
88
|
export * from './classes/HMSNoiseCancellationPlugin';
|
|
89
|
+
export * from './classes/whiteboard';
|
|
89
90
|
export { HMSPollQuestionType } from './classes/polls/HMSPollQuestionType';
|
|
90
91
|
export { HMSPollType } from './classes/polls/HMSPollType';
|
|
91
92
|
export { HMSPollUserTrackingMode } from './classes/polls/HMSPollUserTrackingMode';
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["HMSRecordingState","HMSPollQuestionType","HMSPollType","HMSPollUserTrackingMode","HMSPollUpdateType","HMSPollState","HMSPollQuestion","HMSPollQuestionOption","HMSPollQuestionAnswer","HMSPollQuestionResponse","PollLeaderboardResponse","HMSPollLeaderboardEntry","HMSPollLeaderboardSummary","HMSSDK","HmsManager","default","HMSManagerModule","useHmsViewsResolutionsState","checkNotifications"],"sources":["index.ts"],"sourcesContent":["export * from './classes/HMSConfig';\nexport * from './classes/HMSUpdateListenerActions';\nexport * from './classes/HMSMessage';\nexport * from './classes/HMSVideoTrackSettings';\nexport * from './classes/HMSVideoTrack';\nexport * from './classes/HMSVideoSettings';\nexport * from './classes/HMSVideoCodec';\nexport * from './classes/HMSTrackSettings';\nexport * from './classes/HMSTrack';\nexport * from './classes/HMSTrackType';\nexport * from './classes/HMSTrackSource';\nexport * from './classes/HMSSubscribeSettings';\nexport * from './classes/HMSSimulcastSettings';\nexport * from './classes/HMSSimulcastLayerSettings';\nexport * from './classes/HMSSDK';\nexport * from './classes/HMSRoom';\nexport * from './classes/HMSRoleChangeRequest';\nexport * from './classes/HMSRole';\nexport * from './classes/HMSRemoteVideoTrack';\nexport * from './classes/HMSRemotePeer';\nexport * from './classes/HMSRemoteAudioTrack';\nexport * from './classes/HMSPublishSettings';\nexport * from './classes/HMSPermissions';\nexport * from './classes/HMSPeer';\nexport * from './classes/HMSPeerType';\nexport * from './classes/HMSLocalVideoTrack';\nexport * from './classes/HMSLocalPeer';\nexport * from './classes/HMSLocalAudioTrack';\nexport * from './classes/HMSHelper';\nexport * from './classes/HMSEncoder';\nexport * from './classes/HMSAudioTrackSettings';\nexport * from './classes/HMSAudioTrack';\nexport * from './classes/HMSAudioSettings';\nexport * from './classes/HMSAudioCodec';\nexport * from './classes/HMSPeerUpdate';\nexport * from './classes/HMSRoomUpdate';\nexport * from './classes/HMSTrackUpdate';\nexport * from './classes/HMSLogger';\nexport * from './classes/HMSLogLevel';\nexport * from './classes/HMSVideoViewMode';\nexport * from './classes/HMSChangeTrackStateRequest';\nexport * from './classes/HMSSpeaker';\nexport * from './classes/HMSCameraFacing';\nexport * from './classes/HMSException';\nexport * from './classes/HMSRtmpStreamingState';\nexport * from './classes/HMSServerRecordingState';\nexport * from './classes/HMSBrowserRecordingState';\nexport * from './classes/HMSRTMPConfig';\nexport * from './classes/HMSHLSConfig';\nexport * from './classes/HMSHLSMeetingURLVariant';\nexport * from './classes/HMSHLSVariant';\nexport * from './classes/HMSHLSStreamingState';\nexport * from './classes/HMSVideoResolution';\nexport * from './classes/HMSLocalAudioStats';\nexport * from './classes/HMSLocalVideoStats';\nexport * from './classes/HMSRTCStats';\nexport * from './classes/HMSRTCStatsReport';\nexport * from './classes/HMSRemoteAudioStats';\nexport * from './classes/HMSRemoteVideoStats';\nexport * from './classes/HMSHLSRecordingConfig';\nexport * from './classes/HMSHLSRecordingState';\nexport * from './classes/HMSMessageRecipient';\nexport * from './classes/HMSMessageRecipientType';\nexport * from './classes/HMSNetworkQuality';\nexport * from './classes/HMSRtmpVideoResolution';\nexport * from './classes/HMSAudioDevice';\nexport * from './classes/HMSAudioMode';\nexport * from './classes/HMSAudioMixingMode';\nexport * from './classes/HMSAudioNode';\nexport * from './classes/HMSMicNode';\nexport * from './classes/HMSScreenBroadcastAudioReceiverNode';\nexport * from './classes/HMSAudioFilePlayerNode';\nexport * from './classes/HMSAudioMixerSource';\nexport * from './classes/HMSTrackSettingsInitState';\nexport * from './classes/HMSLogSettings';\nexport * from './classes/HMSLogAlarmManager';\nexport * from './classes/HMSPIPListenerActions';\nexport * from './classes/HMSLayer';\nexport * from './classes/HMSSimulcastLayerDefinition';\nexport * from './classes/HMSQualityLimitationReasons';\nexport * from './classes/HMSQualityLimitationReason';\nexport * from './classes/HMSCameraControl';\nexport * from './classes/HMSIOSAudioMode';\nexport * from './classes/HMSRecordingState';\nexport * from './classes/HMSStreamingState';\nexport * from './classes/HMSHLSPlaylistType';\nexport type {\n HMSSessionStore,\n JsonArray,\n JsonMap,\n JsonPrimitive,\n JsonValue,\n} from './classes/HMSSessionStore';\nexport type {\n HmsViewComponent as HMSView,\n HmsComponentProps as HMSViewProps,\n} from './classes/HmsView';\nexport type { HMSPIPConfig } from './classes/HMSPIPConfig';\nexport { HMSRecordingState } from './classes/HMSRecordingState';\nexport type { HMSPoll } from './classes/polls/HMSPoll';\nexport * from './classes/HMSNoiseCancellationPlugin';\n\nexport { HMSPollQuestionType } from './classes/polls/HMSPollQuestionType';\nexport { HMSPollType } from './classes/polls/HMSPollType';\nexport { HMSPollUserTrackingMode } from './classes/polls/HMSPollUserTrackingMode';\nexport { HMSPollUpdateType } from './classes/polls/HMSPollUpdateType';\nexport { HMSPollState } from './classes/polls/HMSPollState';\nexport { HMSPollQuestion } from './classes/polls/HMSPollQuestion';\nexport { HMSPollQuestionOption } from './classes/polls/HMSPollQuestionOption';\nexport { HMSPollQuestionAnswer } from './classes/polls/HMSPollQuestionAnswer';\nexport { HMSPollQuestionResponse } from './classes/polls/HMSPollQuestionResponse';\nexport { PollLeaderboardResponse } from './classes/polls/PollLeaderboardResponse';\nexport { HMSPollLeaderboardEntry } from './classes/polls/HMSPollLeaderboardEntry';\nexport { HMSPollLeaderboardSummary } from './classes/polls/HMSPollLeaderboardSummary';\n\nimport { HMSSDK as HmsManager } from './classes/HMSSDK';\n\n// 100ms React Native Module\nexport { default as HMSManagerModule } from './modules/HMSManagerModule';\n\n// 100ms Components\nexport * from './components/HMSHLSPlayer';\n\n// 100ms Hooks\nexport * from './hooks/useHMSPeerUpdates';\nexport { useHmsViewsResolutionsState } from './hooks/hmsviews';\n\n// 100ms Utilities\nexport type { NotificationResult } from './utils/notification';\nexport { checkNotifications } from './utils/notification';\n\nexport * from './utils/windowController';\nexport * from './utils/keyboard';\n\n// 100ms types\nexport * from './types';\nexport * from './stores/types';\n\nexport default HmsManager;\n"],"mappings":"AAAA,cAAc,qBAAqB;AACnC,cAAc,oCAAoC;AAClD,cAAc,sBAAsB;AACpC,cAAc,iCAAiC;AAC/C,cAAc,yBAAyB;AACvC,cAAc,4BAA4B;AAC1C,cAAc,yBAAyB;AACvC,cAAc,4BAA4B;AAC1C,cAAc,oBAAoB;AAClC,cAAc,wBAAwB;AACtC,cAAc,0BAA0B;AACxC,cAAc,gCAAgC;AAC9C,cAAc,gCAAgC;AAC9C,cAAc,qCAAq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A+B;AAC7C,cAAc,qCAAqC;AACnD,cAAc,0BAA0B;AACxC,cAAc,8BAA8B;AAC5C,cAAc,iCAAiC;AAC/C,cAAc,oBAAoB;AAClC,cAAc,uCAAuC;AACrD,cAAc,uCAAuC;AACrD,cAAc,sCAAsC;AACpD,cAAc,4BAA4B;AAC1C,cAAc,2BAA2B;AACzC,cAAc,6BAA6B;AAC3C,cAAc,6BAA6B;AAC3C,cAAc,8BAA8B;AAa5C,SAASA,iBAAiB,QAAQ,6BAA6B;AAE/D,cAAc,sCAAsC;
|
|
1
|
+
{"version":3,"names":["HMSRecordingState","HMSPollQuestionType","HMSPollType","HMSPollUserTrackingMode","HMSPollUpdateType","HMSPollState","HMSPollQuestion","HMSPollQuestionOption","HMSPollQuestionAnswer","HMSPollQuestionResponse","PollLeaderboardResponse","HMSPollLeaderboardEntry","HMSPollLeaderboardSummary","HMSSDK","HmsManager","default","HMSManagerModule","useHmsViewsResolutionsState","checkNotifications"],"sources":["index.ts"],"sourcesContent":["export * from './classes/HMSConfig';\nexport * from './classes/HMSUpdateListenerActions';\nexport * from './classes/HMSMessage';\nexport * from './classes/HMSVideoTrackSettings';\nexport * from './classes/HMSVideoTrack';\nexport * from './classes/HMSVideoSettings';\nexport * from './classes/HMSVideoCodec';\nexport * from './classes/HMSTrackSettings';\nexport * from './classes/HMSTrack';\nexport * from './classes/HMSTrackType';\nexport * from './classes/HMSTrackSource';\nexport * from './classes/HMSSubscribeSettings';\nexport * from './classes/HMSSimulcastSettings';\nexport * from './classes/HMSSimulcastLayerSettings';\nexport * from './classes/HMSSDK';\nexport * from './classes/HMSRoom';\nexport * from './classes/HMSRoleChangeRequest';\nexport * from './classes/HMSRole';\nexport * from './classes/HMSRemoteVideoTrack';\nexport * from './classes/HMSRemotePeer';\nexport * from './classes/HMSRemoteAudioTrack';\nexport * from './classes/HMSPublishSettings';\nexport * from './classes/HMSPermissions';\nexport * from './classes/HMSPeer';\nexport * from './classes/HMSPeerType';\nexport * from './classes/HMSLocalVideoTrack';\nexport * from './classes/HMSLocalPeer';\nexport * from './classes/HMSLocalAudioTrack';\nexport * from './classes/HMSHelper';\nexport * from './classes/HMSEncoder';\nexport * from './classes/HMSAudioTrackSettings';\nexport * from './classes/HMSAudioTrack';\nexport * from './classes/HMSAudioSettings';\nexport * from './classes/HMSAudioCodec';\nexport * from './classes/HMSPeerUpdate';\nexport * from './classes/HMSRoomUpdate';\nexport * from './classes/HMSTrackUpdate';\nexport * from './classes/HMSLogger';\nexport * from './classes/HMSLogLevel';\nexport * from './classes/HMSVideoViewMode';\nexport * from './classes/HMSChangeTrackStateRequest';\nexport * from './classes/HMSSpeaker';\nexport * from './classes/HMSCameraFacing';\nexport * from './classes/HMSException';\nexport * from './classes/HMSRtmpStreamingState';\nexport * from './classes/HMSServerRecordingState';\nexport * from './classes/HMSBrowserRecordingState';\nexport * from './classes/HMSRTMPConfig';\nexport * from './classes/HMSHLSConfig';\nexport * from './classes/HMSHLSMeetingURLVariant';\nexport * from './classes/HMSHLSVariant';\nexport * from './classes/HMSHLSStreamingState';\nexport * from './classes/HMSVideoResolution';\nexport * from './classes/HMSLocalAudioStats';\nexport * from './classes/HMSLocalVideoStats';\nexport * from './classes/HMSRTCStats';\nexport * from './classes/HMSRTCStatsReport';\nexport * from './classes/HMSRemoteAudioStats';\nexport * from './classes/HMSRemoteVideoStats';\nexport * from './classes/HMSHLSRecordingConfig';\nexport * from './classes/HMSHLSRecordingState';\nexport * from './classes/HMSMessageRecipient';\nexport * from './classes/HMSMessageRecipientType';\nexport * from './classes/HMSNetworkQuality';\nexport * from './classes/HMSRtmpVideoResolution';\nexport * from './classes/HMSAudioDevice';\nexport * from './classes/HMSAudioMode';\nexport * from './classes/HMSAudioMixingMode';\nexport * from './classes/HMSAudioNode';\nexport * from './classes/HMSMicNode';\nexport * from './classes/HMSScreenBroadcastAudioReceiverNode';\nexport * from './classes/HMSAudioFilePlayerNode';\nexport * from './classes/HMSAudioMixerSource';\nexport * from './classes/HMSTrackSettingsInitState';\nexport * from './classes/HMSLogSettings';\nexport * from './classes/HMSLogAlarmManager';\nexport * from './classes/HMSPIPListenerActions';\nexport * from './classes/HMSLayer';\nexport * from './classes/HMSSimulcastLayerDefinition';\nexport * from './classes/HMSQualityLimitationReasons';\nexport * from './classes/HMSQualityLimitationReason';\nexport * from './classes/HMSCameraControl';\nexport * from './classes/HMSIOSAudioMode';\nexport * from './classes/HMSRecordingState';\nexport * from './classes/HMSStreamingState';\nexport * from './classes/HMSHLSPlaylistType';\nexport type {\n HMSSessionStore,\n JsonArray,\n JsonMap,\n JsonPrimitive,\n JsonValue,\n} from './classes/HMSSessionStore';\nexport type {\n HmsViewComponent as HMSView,\n HmsComponentProps as HMSViewProps,\n} from './classes/HmsView';\nexport type { HMSPIPConfig } from './classes/HMSPIPConfig';\nexport { HMSRecordingState } from './classes/HMSRecordingState';\nexport type { HMSPoll } from './classes/polls/HMSPoll';\nexport * from './classes/HMSNoiseCancellationPlugin';\nexport * from './classes/whiteboard';\n\nexport { HMSPollQuestionType } from './classes/polls/HMSPollQuestionType';\nexport { HMSPollType } from './classes/polls/HMSPollType';\nexport { HMSPollUserTrackingMode } from './classes/polls/HMSPollUserTrackingMode';\nexport { HMSPollUpdateType } from './classes/polls/HMSPollUpdateType';\nexport { HMSPollState } from './classes/polls/HMSPollState';\nexport { HMSPollQuestion } from './classes/polls/HMSPollQuestion';\nexport { HMSPollQuestionOption } from './classes/polls/HMSPollQuestionOption';\nexport { HMSPollQuestionAnswer } from './classes/polls/HMSPollQuestionAnswer';\nexport { HMSPollQuestionResponse } from './classes/polls/HMSPollQuestionResponse';\nexport { PollLeaderboardResponse } from './classes/polls/PollLeaderboardResponse';\nexport { HMSPollLeaderboardEntry } from './classes/polls/HMSPollLeaderboardEntry';\nexport { HMSPollLeaderboardSummary } from './classes/polls/HMSPollLeaderboardSummary';\n\nimport { HMSSDK as HmsManager } from './classes/HMSSDK';\n\n// 100ms React Native Module\nexport { default as HMSManagerModule } from './modules/HMSManagerModule';\n\n// 100ms Components\nexport * from './components/HMSHLSPlayer';\n\n// 100ms Hooks\nexport * from './hooks/useHMSPeerUpdates';\nexport { useHmsViewsResolutionsState } from './hooks/hmsviews';\n\n// 100ms Utilities\nexport type { NotificationResult } from './utils/notification';\nexport { checkNotifications } from './utils/notification';\n\nexport * from './utils/windowController';\nexport * from './utils/keyboard';\n\n// 100ms types\nexport * from './types';\nexport * from './stores/types';\n\nexport default HmsManager;\n"],"mappings":"AAAA,cAAc,qBAAqB;AACnC,cAAc,oCAAoC;AAClD,cAAc,sBAAsB;AACpC,cAAc,iCAAiC;AAC/C,cAAc,yBAAyB;AACvC,cAAc,4BAA4B;AAC1C,cAAc,yBAAyB;AACvC,cAAc,4BAA4B;AAC1C,cAAc,oBAAoB;AAClC,cAAc,wBAAwB;AACtC,cAAc,0BAA0B;AACxC,cAAc,gCAAgC;AAC9C,cAAc,gCAAgC;AAC9C,cAAc,qCAAqC;AACnD,cAAc,kBAAkB;AAChC,cAAc,mBAAmB;AACjC,cAAc,gCAAgC;AAC9C,cAAc,mBAAmB;AACjC,cAAc,+BAA+B;AAC7C,cAAc,yBAAyB;AACvC,cAAc,+BAA+B;AAC7C,cAAc,8BAA8B;AAC5C,cAAc,0BAA0B;AACxC,cAAc,mBAAmB;AACjC,cAAc,uBAAuB;AACrC,cAAc,8BAA8B;AAC5C,cAAc,wBAAwB;AACtC,cAAc,8BAA8B;AAC5C,cAAc,qBAAqB;AACnC,cAAc,sBAAsB;AACpC,cAAc,iCAAiC;AAC/C,cAAc,yBAAyB;AACvC,cAAc,4BAA4B;AAC1C,cAAc,yBAAyB;AACvC,cAAc,yBAAyB;AACvC,cAAc,yBAAyB;AACvC,cAAc,0BAA0B;AACxC,cAAc,qBAAqB;AACnC,cAAc,uBAAuB;AACrC,cAAc,4BAA4B;AAC1C,cAAc,sCAAsC;AACpD,cAAc,sBAAsB;AACpC,cAAc,2BAA2B;AACzC,cAAc,wBAAwB;AACtC,cAAc,iCAAiC;AA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SAASC,uBAAuB,QAAQ,yCAAyC;AACjF,SAASC,uBAAuB,QAAQ,yCAAyC;AACjF,SAASC,uBAAuB,QAAQ,yCAAyC;AACjF,SAASC,yBAAyB,QAAQ,2CAA2C;AAErF,SAASC,MAAM,IAAIC,UAAU,QAAQ,kBAAkB;;AAEvD;AACA,SAASC,OAAO,IAAIC,gBAAgB,QAAQ,4BAA4B;;AAExE;AACA,cAAc,2BAA2B;;AAEzC;AACA,cAAc,2BAA2B;AACzC,SAASC,2BAA2B,QAAQ,kBAAkB;;AAE9D;;AAEA,SAASC,kBAAkB,QAAQ,sBAAsB;AAEzD,cAAc,0BAA0B;AACxC,cAAc,kBAAkB;;AAEhC;AACA,cAAc,SAAS;AACvB,cAAc,gBAAgB;AAE9B,eAAeJ,UAAU","ignoreList":[]}
|
|
@@ -2,6 +2,8 @@ import type { HMSPoll } from './polls/HMSPoll';
|
|
|
2
2
|
import type { HMSPollCreateParams } from './polls/HMSPollCreateParams';
|
|
3
3
|
import type { HMSPollUpdateType } from './polls/HMSPollUpdateType';
|
|
4
4
|
import type { PollLeaderboardResponse } from './polls/PollLeaderboardResponse';
|
|
5
|
+
import type { HMSWhiteboardUpdateType } from './whiteboard/HMSWhiteboardUpdateType';
|
|
6
|
+
import type { HMSWhiteboard } from './whiteboard/HMSWhiteboard';
|
|
5
7
|
type PollQuestionResponseCreateParams = {
|
|
6
8
|
pollId: string;
|
|
7
9
|
pollQuestionIndex: number;
|
|
@@ -15,9 +17,9 @@ type PollQuestionResponseCreateParams = {
|
|
|
15
17
|
};
|
|
16
18
|
export declare class HMSInteractivityCenter {
|
|
17
19
|
private _eventEmitter;
|
|
18
|
-
private
|
|
19
|
-
private _onAllPollUpdateListenerRemoved;
|
|
20
|
+
private onUpdateListenerRemoved;
|
|
20
21
|
constructor();
|
|
22
|
+
private _pollUpdateListener;
|
|
21
23
|
/**
|
|
22
24
|
* Adds a listener for poll updates
|
|
23
25
|
* @param listener - Callback to be called when a poll is updated
|
|
@@ -41,5 +43,20 @@ export declare class HMSInteractivityCenter {
|
|
|
41
43
|
* @returns Promise<PollLeaderboardResponse>
|
|
42
44
|
*/
|
|
43
45
|
fetchLeaderboard(pollId: string, count: number, startIndex: number, includeCurrentPeer: boolean): Promise<PollLeaderboardResponse>;
|
|
46
|
+
private _whiteboardUpdateListener;
|
|
47
|
+
/**
|
|
48
|
+
* Adds a listener for Whiteboard updates
|
|
49
|
+
* @param listener - Callback to be called when whiteboard is updated
|
|
50
|
+
* @returns HMSEventSubscription
|
|
51
|
+
*/
|
|
52
|
+
addWhiteboardUpdateListener(listener: (hmsWhiteboard: HMSWhiteboard, updateType: HMSWhiteboardUpdateType) => void): import("../utils").EmitterSubscription;
|
|
53
|
+
/**
|
|
54
|
+
* Starts Whiteboard
|
|
55
|
+
*/
|
|
56
|
+
startWhiteboard(title: string): Promise<any>;
|
|
57
|
+
/**
|
|
58
|
+
* Stops Whiteboard
|
|
59
|
+
*/
|
|
60
|
+
stopWhiteboard(): Promise<any>;
|
|
44
61
|
}
|
|
45
62
|
export {};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { DecodedPollLeaderboardResponse } from './polls/DecodedPollLeaderboardResponse';
|
|
2
2
|
import type { HMSPoll } from './polls/HMSPoll';
|
|
3
3
|
import type { PollLeaderboardResponse } from './polls/PollLeaderboardResponse';
|
|
4
|
+
import type { HMSWhiteboard } from './whiteboard/HMSWhiteboard';
|
|
4
5
|
export declare class HMSInteractivityEncoder {
|
|
5
6
|
static transformPoll(poll: HMSPoll): HMSPoll;
|
|
6
7
|
static transformPollLeaderboardResponse(decodedPollLeaderboardResponse: DecodedPollLeaderboardResponse): PollLeaderboardResponse;
|
|
8
|
+
static transformHMSWhiteboard(hmsWhiteboard: HMSWhiteboard): HMSWhiteboard;
|
|
7
9
|
}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
export interface HMSWhiteboardPermission {
|
|
2
|
+
admin?: boolean;
|
|
3
|
+
write?: boolean;
|
|
4
|
+
read?: boolean;
|
|
5
|
+
}
|
|
1
6
|
export declare class HMSPermissions {
|
|
2
7
|
endRoom?: boolean;
|
|
3
8
|
removeOthers?: boolean;
|
|
@@ -9,6 +14,7 @@ export declare class HMSPermissions {
|
|
|
9
14
|
rtmpStreaming?: boolean;
|
|
10
15
|
pollRead?: boolean;
|
|
11
16
|
pollWrite?: boolean;
|
|
17
|
+
whiteboard?: HMSWhiteboardPermission;
|
|
12
18
|
constructor(params?: {
|
|
13
19
|
endRoom?: boolean;
|
|
14
20
|
removeOthers?: boolean;
|
|
@@ -20,5 +26,6 @@ export declare class HMSPermissions {
|
|
|
20
26
|
rtmpStreaming?: boolean;
|
|
21
27
|
pollRead?: boolean;
|
|
22
28
|
pollWrite?: boolean;
|
|
29
|
+
whiteboard?: HMSWhiteboardPermission;
|
|
23
30
|
});
|
|
24
31
|
}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
+
import type { ImageURISource, ImageRequireSource } from 'react-native';
|
|
1
2
|
import type { HMSSimulcastLayerSettings } from './HMSSimulcastLayerSettings';
|
|
2
3
|
import type { HMSCameraFacing } from './HMSCameraFacing';
|
|
3
4
|
import type { HMSTrackSettingsInitState } from './HMSTrackSettingsInitState';
|
|
5
|
+
export declare class HMSVirtualBackgroundPlugin {
|
|
6
|
+
static NAME: string;
|
|
7
|
+
constructor();
|
|
8
|
+
enable(): Promise<boolean>;
|
|
9
|
+
disable(): Promise<boolean>;
|
|
10
|
+
setBlur(blurRadius: number): Promise<boolean>;
|
|
11
|
+
setBackground(backgroundImage: ImageURISource | ImageRequireSource): Promise<boolean>;
|
|
12
|
+
}
|
|
4
13
|
/**
|
|
5
14
|
* Customize local peer's Video track settings before Joining the Room.
|
|
6
15
|
*
|
|
@@ -12,11 +21,13 @@ export declare class HMSVideoTrackSettings {
|
|
|
12
21
|
cameraFacing?: HMSCameraFacing;
|
|
13
22
|
forceSoftwareDecoder?: boolean;
|
|
14
23
|
disableAutoResize?: boolean;
|
|
24
|
+
videoPlugin?: HMSVirtualBackgroundPlugin;
|
|
15
25
|
constructor(params: {
|
|
16
26
|
simulcastSettings?: HMSSimulcastLayerSettings[];
|
|
17
27
|
initialState?: HMSTrackSettingsInitState;
|
|
18
28
|
cameraFacing?: HMSCameraFacing;
|
|
19
29
|
forceSoftwareDecoder?: boolean;
|
|
20
30
|
disableAutoResize?: boolean;
|
|
31
|
+
videoPlugin?: HMSVirtualBackgroundPlugin;
|
|
21
32
|
});
|
|
22
33
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HMSPeer } from '../HMSPeer';
|
|
2
|
+
import type { HMSWhiteboardState } from './HMSWhiteboardState';
|
|
3
|
+
export interface HMSWhiteboard {
|
|
4
|
+
id: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
state: HMSWhiteboardState;
|
|
7
|
+
isOwner: boolean;
|
|
8
|
+
owner?: HMSPeer;
|
|
9
|
+
url?: string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { HMSWhiteboard } from './HMSWhiteboard';
|
|
2
|
+
import type { HMSWhiteboardUpdateType } from './HMSWhiteboardUpdateType';
|
|
3
|
+
export type WhiteboardUpdateListener = (data: {
|
|
4
|
+
hmsWhiteboard: HMSWhiteboard;
|
|
5
|
+
updateType: HMSWhiteboardUpdateType;
|
|
6
|
+
}) => void;
|
|
7
|
+
export declare function registerWhiteboardUpdateListener(listener: WhiteboardUpdateListener): void;
|
|
8
|
+
export declare function unregisterWhiteboardUpdateListener(): void;
|
|
@@ -90,6 +90,7 @@ export type { HMSPIPConfig } from './classes/HMSPIPConfig';
|
|
|
90
90
|
export { HMSRecordingState } from './classes/HMSRecordingState';
|
|
91
91
|
export type { HMSPoll } from './classes/polls/HMSPoll';
|
|
92
92
|
export * from './classes/HMSNoiseCancellationPlugin';
|
|
93
|
+
export * from './classes/whiteboard';
|
|
93
94
|
export { HMSPollQuestionType } from './classes/polls/HMSPollQuestionType';
|
|
94
95
|
export { HMSPollType } from './classes/polls/HMSPollType';
|
|
95
96
|
export { HMSPollUserTrackingMode } from './classes/polls/HMSPollUserTrackingMode';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@100mslive/react-native-hms",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.6-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",
|
package/sdk-versions.json
CHANGED
|
@@ -12,6 +12,14 @@ import { HMSInteractivityEncoder } from './HMSInteractivityEncoder';
|
|
|
12
12
|
import { HMSHelper } from './HMSHelper';
|
|
13
13
|
import type { PollLeaderboardResponse } from './polls/PollLeaderboardResponse';
|
|
14
14
|
import type { DecodedPollLeaderboardResponse } from './polls/DecodedPollLeaderboardResponse';
|
|
15
|
+
import type { HMSWhiteboardUpdateType } from './whiteboard/HMSWhiteboardUpdateType';
|
|
16
|
+
import type { HMSWhiteboard } from './whiteboard/HMSWhiteboard';
|
|
17
|
+
import { HMSWhiteboardListenerActions } from './whiteboard/HMSWhiteboardListenerActions';
|
|
18
|
+
import {
|
|
19
|
+
WhiteboardUpdateListener,
|
|
20
|
+
registerWhiteboardUpdateListener,
|
|
21
|
+
unregisterWhiteboardUpdateListener,
|
|
22
|
+
} from './whiteboard/registerCallbacks';
|
|
15
23
|
|
|
16
24
|
type PollUpdateListener = (data: {
|
|
17
25
|
updatedPoll: HMSPoll;
|
|
@@ -56,6 +64,26 @@ function unregisterPollUpdateListener() {
|
|
|
56
64
|
export class HMSInteractivityCenter {
|
|
57
65
|
private _eventEmitter = new EventEmitter();
|
|
58
66
|
|
|
67
|
+
private onUpdateListenerRemoved(eventType: string) {
|
|
68
|
+
if (eventType === HMSPollsListenerActions.ON_POLL_UPDATE) {
|
|
69
|
+
unregisterPollUpdateListener();
|
|
70
|
+
} else if (
|
|
71
|
+
eventType === HMSWhiteboardListenerActions.ON_WHITEBOARD_UPDATE
|
|
72
|
+
) {
|
|
73
|
+
unregisterWhiteboardUpdateListener();
|
|
74
|
+
} else {
|
|
75
|
+
console.warn('Unknown update listener removed: ', eventType);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
constructor() {
|
|
80
|
+
this._eventEmitter.registerOnAllListenersRemoved(
|
|
81
|
+
this.onUpdateListenerRemoved
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
//#region Poll Methods & Listeners
|
|
86
|
+
|
|
59
87
|
private _pollUpdateListener = (...args: Parameters<PollUpdateListener>) => {
|
|
60
88
|
const { updatedPoll, update } = args[0];
|
|
61
89
|
logger?.verbose('#Listener ON_POLL_UPDATE', {
|
|
@@ -69,16 +97,6 @@ export class HMSInteractivityCenter {
|
|
|
69
97
|
);
|
|
70
98
|
};
|
|
71
99
|
|
|
72
|
-
private _onAllPollUpdateListenerRemoved = () => {
|
|
73
|
-
unregisterPollUpdateListener();
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
constructor() {
|
|
77
|
-
this._eventEmitter.registerOnAllListenersRemoved(
|
|
78
|
-
this._onAllPollUpdateListenerRemoved
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
100
|
/**
|
|
83
101
|
* Adds a listener for poll updates
|
|
84
102
|
* @param listener - Callback to be called when a poll is updated
|
|
@@ -164,4 +182,65 @@ export class HMSInteractivityCenter {
|
|
|
164
182
|
await HMSManager.fetchLeaderboard(data);
|
|
165
183
|
return HMSInteractivityEncoder.transformPollLeaderboardResponse(response);
|
|
166
184
|
}
|
|
185
|
+
//#endregion Poll Methods & Listeners
|
|
186
|
+
|
|
187
|
+
//#region Whiteboard Methods & Listeners
|
|
188
|
+
|
|
189
|
+
private _whiteboardUpdateListener = (
|
|
190
|
+
...args: Parameters<WhiteboardUpdateListener>
|
|
191
|
+
) => {
|
|
192
|
+
const { hmsWhiteboard, updateType } = args[0];
|
|
193
|
+
logger?.verbose('#Listener ON_WHITEBOARD_UPDATE', {
|
|
194
|
+
updateType,
|
|
195
|
+
hmsWhiteboard,
|
|
196
|
+
});
|
|
197
|
+
this._eventEmitter.emit(
|
|
198
|
+
HMSWhiteboardListenerActions.ON_WHITEBOARD_UPDATE,
|
|
199
|
+
HMSInteractivityEncoder.transformHMSWhiteboard(hmsWhiteboard),
|
|
200
|
+
updateType
|
|
201
|
+
);
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Adds a listener for Whiteboard updates
|
|
206
|
+
* @param listener - Callback to be called when whiteboard is updated
|
|
207
|
+
* @returns HMSEventSubscription
|
|
208
|
+
*/
|
|
209
|
+
addWhiteboardUpdateListener(
|
|
210
|
+
listener: (
|
|
211
|
+
hmsWhiteboard: HMSWhiteboard,
|
|
212
|
+
updateType: HMSWhiteboardUpdateType
|
|
213
|
+
) => void
|
|
214
|
+
) {
|
|
215
|
+
registerWhiteboardUpdateListener(this._whiteboardUpdateListener);
|
|
216
|
+
return this._eventEmitter.addListener(
|
|
217
|
+
HMSWhiteboardListenerActions.ON_WHITEBOARD_UPDATE,
|
|
218
|
+
listener,
|
|
219
|
+
null
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Starts Whiteboard
|
|
225
|
+
*/
|
|
226
|
+
async startWhiteboard(title: string) {
|
|
227
|
+
const data = {
|
|
228
|
+
id: HMSConstants.DEFAULT_SDK_ID,
|
|
229
|
+
title,
|
|
230
|
+
};
|
|
231
|
+
logger?.verbose('#Function startWhiteboard', data);
|
|
232
|
+
return HMSManager.startWhiteboard(data);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Stops Whiteboard
|
|
237
|
+
*/
|
|
238
|
+
async stopWhiteboard() {
|
|
239
|
+
const data = {
|
|
240
|
+
id: HMSConstants.DEFAULT_SDK_ID,
|
|
241
|
+
};
|
|
242
|
+
logger?.verbose('#Function stopWhiteboard', data);
|
|
243
|
+
return HMSManager.stopWhiteboard(data);
|
|
244
|
+
}
|
|
245
|
+
//#endregion Whiteboard Methods & Listeners
|
|
167
246
|
}
|
|
@@ -2,6 +2,7 @@ import { HMSEncoder } from './HMSEncoder';
|
|
|
2
2
|
import type { DecodedPollLeaderboardResponse } from './polls/DecodedPollLeaderboardResponse';
|
|
3
3
|
import type { HMSPoll } from './polls/HMSPoll';
|
|
4
4
|
import type { PollLeaderboardResponse } from './polls/PollLeaderboardResponse';
|
|
5
|
+
import type { HMSWhiteboard } from './whiteboard/HMSWhiteboard';
|
|
5
6
|
|
|
6
7
|
export class HMSInteractivityEncoder {
|
|
7
8
|
static transformPoll(poll: HMSPoll): HMSPoll {
|
|
@@ -81,4 +82,11 @@ export class HMSInteractivityEncoder {
|
|
|
81
82
|
|
|
82
83
|
return decodedPollLeaderboardResponse as PollLeaderboardResponse;
|
|
83
84
|
}
|
|
85
|
+
|
|
86
|
+
static transformHMSWhiteboard(hmsWhiteboard: HMSWhiteboard): HMSWhiteboard {
|
|
87
|
+
if (hmsWhiteboard.owner) {
|
|
88
|
+
hmsWhiteboard.owner = HMSEncoder.encodeHmsPeer(hmsWhiteboard.owner);
|
|
89
|
+
}
|
|
90
|
+
return hmsWhiteboard;
|
|
91
|
+
}
|
|
84
92
|
}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
export interface HMSWhiteboardPermission {
|
|
2
|
+
admin?: boolean;
|
|
3
|
+
write?: boolean;
|
|
4
|
+
read?: boolean;
|
|
5
|
+
}
|
|
6
|
+
|
|
1
7
|
export class HMSPermissions {
|
|
2
8
|
endRoom?: boolean;
|
|
3
9
|
removeOthers?: boolean;
|
|
@@ -9,6 +15,7 @@ export class HMSPermissions {
|
|
|
9
15
|
rtmpStreaming?: boolean;
|
|
10
16
|
pollRead?: boolean;
|
|
11
17
|
pollWrite?: boolean;
|
|
18
|
+
whiteboard?: HMSWhiteboardPermission;
|
|
12
19
|
|
|
13
20
|
constructor(params?: {
|
|
14
21
|
endRoom?: boolean;
|
|
@@ -21,6 +28,7 @@ export class HMSPermissions {
|
|
|
21
28
|
rtmpStreaming?: boolean;
|
|
22
29
|
pollRead?: boolean;
|
|
23
30
|
pollWrite?: boolean;
|
|
31
|
+
whiteboard?: HMSWhiteboardPermission;
|
|
24
32
|
}) {
|
|
25
33
|
if (params) {
|
|
26
34
|
this.endRoom = params.endRoom;
|
|
@@ -33,6 +41,7 @@ export class HMSPermissions {
|
|
|
33
41
|
this.rtmpStreaming = params.rtmpStreaming;
|
|
34
42
|
this.pollRead = params.pollRead;
|
|
35
43
|
this.pollWrite = params.pollWrite;
|
|
44
|
+
this.whiteboard = params.whiteboard;
|
|
36
45
|
}
|
|
37
46
|
}
|
|
38
47
|
}
|
|
@@ -171,9 +171,6 @@ export class HMSSessionStore {
|
|
|
171
171
|
this._addedKeyChangeListenerCount = 0;
|
|
172
172
|
if (
|
|
173
173
|
this._deviceEventEmitterSubscription &&
|
|
174
|
-
Object.getOwnPropertyNames(
|
|
175
|
-
this._deviceEventEmitterSubscription
|
|
176
|
-
).includes('remove') &&
|
|
177
174
|
typeof this._deviceEventEmitterSubscription.remove === 'function'
|
|
178
175
|
) {
|
|
179
176
|
this._deviceEventEmitterSubscription.remove();
|