@fishjam-cloud/react-native-client 0.6.0 → 0.8.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 +6 -6
- package/android/build.gradle +6 -2
- package/android/src/main/java/io/fishjam/reactnative/EmitableEvents.kt +4 -2
- package/android/src/main/java/io/fishjam/reactnative/RNFishjamClient.kt +60 -39
- package/android/src/main/java/io/fishjam/reactnative/RNFishjamClientModule.kt +11 -19
- package/build/RNFishjamClientModule.d.ts +24 -8
- package/build/RNFishjamClientModule.d.ts.map +1 -1
- package/build/RNFishjamClientModule.js +0 -1
- package/build/RNFishjamClientModule.js.map +1 -1
- package/build/common/client.d.ts +4 -4
- package/build/common/client.d.ts.map +1 -1
- package/build/common/client.js +4 -4
- package/build/common/client.js.map +1 -1
- package/build/common/metadata.d.ts +1 -0
- package/build/common/metadata.d.ts.map +1 -1
- package/build/common/metadata.js +1 -0
- package/build/common/metadata.js.map +1 -1
- package/build/components/FishjamRoom/index.d.ts +21 -0
- package/build/components/FishjamRoom/index.d.ts.map +1 -1
- package/build/components/FishjamRoom/index.js +29 -9
- package/build/components/FishjamRoom/index.js.map +1 -1
- package/build/components/VideoPreviewView.d.ts +7 -3
- package/build/components/VideoPreviewView.d.ts.map +1 -1
- package/build/components/VideoPreviewView.js +5 -1
- package/build/components/VideoPreviewView.js.map +1 -1
- package/build/components/VideoRendererView.d.ts +13 -0
- package/build/components/VideoRendererView.d.ts.map +1 -1
- package/build/components/VideoRendererView.js +13 -0
- package/build/components/VideoRendererView.js.map +1 -1
- package/build/hooks/internal/useFishjamEvent.d.ts +3 -2
- package/build/hooks/internal/useFishjamEvent.d.ts.map +1 -1
- package/build/hooks/internal/useFishjamEvent.js +25 -1
- package/build/hooks/internal/useFishjamEvent.js.map +1 -1
- package/build/hooks/internal/useFishjamEventState.d.ts +2 -2
- package/build/hooks/internal/useFishjamEventState.d.ts.map +1 -1
- package/build/hooks/internal/useFishjamEventState.js.map +1 -1
- package/build/hooks/useAppScreenShare.d.ts +10 -1
- package/build/hooks/useAppScreenShare.d.ts.map +1 -1
- package/build/hooks/useAppScreenShare.js +9 -7
- package/build/hooks/useAppScreenShare.js.map +1 -1
- package/build/hooks/useAudioSettings.d.ts +4 -0
- package/build/hooks/useAudioSettings.d.ts.map +1 -1
- package/build/hooks/useAudioSettings.js.map +1 -1
- package/build/hooks/useBandwidthEstimation.d.ts +3 -0
- package/build/hooks/useBandwidthEstimation.d.ts.map +1 -1
- package/build/hooks/useBandwidthEstimation.js +6 -1
- package/build/hooks/useBandwidthEstimation.js.map +1 -1
- package/build/hooks/useCamera.d.ts +12 -35
- package/build/hooks/useCamera.d.ts.map +1 -1
- package/build/hooks/useCamera.js +11 -60
- package/build/hooks/useCamera.js.map +1 -1
- package/build/hooks/useConnection.d.ts +29 -13
- package/build/hooks/useConnection.d.ts.map +1 -1
- package/build/hooks/useConnection.js +11 -5
- package/build/hooks/useConnection.js.map +1 -1
- package/build/hooks/useForegroundService.d.ts +20 -11
- package/build/hooks/useForegroundService.d.ts.map +1 -1
- package/build/hooks/useForegroundService.js +2 -3
- package/build/hooks/useForegroundService.js.map +1 -1
- package/build/hooks/useMicrophone.js.map +1 -1
- package/build/hooks/usePeerStatus.d.ts +2 -10
- package/build/hooks/usePeerStatus.d.ts.map +1 -1
- package/build/hooks/usePeerStatus.js +1 -0
- package/build/hooks/usePeerStatus.js.map +1 -1
- package/build/hooks/usePeers.d.ts +19 -22
- package/build/hooks/usePeers.d.ts.map +1 -1
- package/build/hooks/usePeers.js +17 -5
- package/build/hooks/usePeers.js.map +1 -1
- package/build/hooks/useReconnection.d.ts +2 -2
- package/build/hooks/useReconnection.d.ts.map +1 -1
- package/build/hooks/useReconnection.js +1 -0
- package/build/hooks/useReconnection.js.map +1 -1
- package/build/hooks/useScreenShare.d.ts +2 -23
- package/build/hooks/useScreenShare.d.ts.map +1 -1
- package/build/hooks/useScreenShare.js +1 -36
- package/build/hooks/useScreenShare.js.map +1 -1
- package/build/index.d.ts +6 -7
- package/build/index.d.ts.map +1 -1
- package/build/index.js +0 -2
- package/build/index.js.map +1 -1
- package/build/types.d.ts +3 -19
- package/build/types.d.ts.map +1 -1
- package/build/types.js.map +1 -1
- package/build/utils/eventPayloadValidator.d.ts +3 -0
- package/build/utils/eventPayloadValidator.d.ts.map +1 -0
- package/build/utils/eventPayloadValidator.js +85 -0
- package/build/utils/eventPayloadValidator.js.map +1 -0
- package/ios/Events.swift +4 -1
- package/ios/RNFishjamClient.podspec +1 -1
- package/ios/RNFishjamClient.swift +60 -48
- package/ios/RNFishjamClientModule.swift +5 -10
- package/ios/VideoPreviewView.swift +5 -0
- package/ios/VideoRendererView.swift +5 -0
- package/package.json +21 -14
- package/plugin/build/withFishjamAndroid.js +1 -0
- package/plugin/build/withFishjamIos.js +17 -7
- package/build/common/webRTC.d.ts +0 -14
- package/build/common/webRTC.d.ts.map +0 -1
- package/build/common/webRTC.js +0 -15
- package/build/common/webRTC.js.map +0 -1
- /package/{LICENSE → LICENSE.txt} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCamera.js","sourceRoot":"","sources":["../../src/hooks/useCamera.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAUxC,OAAO,qBAAqB,EAAE,EAC5B,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AA4FvE,MAAM,sBAAsB,GAAG,GAAG,EAAE,CAAC,CAAC;IACpC,OAAO,EAAE,KAAK;IACd,eAAe,EAAE,EAAE;CACpB,CAAC,CAAC;AAEH,SAAS,kBAAkB,CAAC,YAA6C;IACvE,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,EAAE,CAAC;QAC9B,IAAI,OAAO,YAAY,KAAK,QAAQ,E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G,WAAW,CACxC,KAAK,EAAE,SAAyB,EAAE,EAAE;QAClC,MAAM,qBAAqB,CAAC,sBAAsB,CAAC,SAAS,CAAC,CAAC;IAChE,CAAC,EACD,EAAE,CACH,CAAC;IAEF,MAAM,wBAAwB,GAAG,WAAW,CAC1C,KAAK,EAAE,QAAuB,EAAE,EAAE;QAChC,MAAM,qBAAqB,CAAC,wBAAwB,CAAC,QAAQ,CAAC,CAAC;IACjE,CAAC,EACD,EAAE,CACH,CAAC;IAEF,MAAM,8BAA8B,GAAG,WAAW,CAChD,KAAK,EAAE,QAAuB,EAAE,SAAyB,EAAE,EAAE;QAC3D,MAAM,qBAAqB,CAAC,8BAA8B,CACxD,QAAQ,EACR,SAAS,CACV,CAAC;IACJ,CAAC,EACD,EAAE,CACH,CAAC;IAEF,OAAO;QACL;;WAEG;QACH,UAAU;QACV;;WAEG;QACH,aAAa;QACb;;WAEG;QACH,eAAe;QACf;;;WAGG;QACH,OAAO;QAEP,oCAAoC;QACpC,YAAY;QACZ;;;;WAIG;QACH,aAAa;QACb;;;;WAIG,CAAC,YAAY;QAEhB;;;;WAIG;QACH,wBAAwB;QACxB;;;;;WAKG;QACH,8BAA8B;QAC9B;;;;;;;WAOG;QACH,sBAAsB;KACvB,CAAC;AACJ,CAAC","sourcesContent":["import { useCallback, useMemo } from 'react';\nimport { Platform } from 'react-native';\n\nimport {\n BandwidthLimit,\n Brand,\n SimulcastBandwidthLimit,\n SimulcastConfig,\n TrackBandwidthLimit,\n TrackEncoding,\n} from '../types';\nimport RNFishjamClientModule, {\n ReceivableEvents,\n} from '../RNFishjamClientModule';\nimport { useFishjamEventState } from './internal/useFishjamEventState';\n\nexport type CameraId = Brand<string, 'CameraId'>;\n\nexport type CameraFacingDirection = 'front' | 'back' | 'unspecified';\n\nexport type Camera = {\n id: CameraId;\n name: string;\n facingDirection: CameraFacingDirection;\n};\n\nexport type CurrentCameraChangedType = {\n currentCamera: Camera | null;\n isCameraOn: boolean;\n};\n\nexport type VideoQuality =\n | 'QVGA169'\n | 'VGA169'\n | 'QHD169'\n | 'HD169'\n | 'FHD169'\n | 'QVGA43'\n | 'VGA43'\n | 'QHD43'\n | 'HD43'\n | 'FHD43';\n\ntype CameraConfigBase = {\n /**\n * resolution + aspect ratio of local video track, one of: `QVGA_169`, `VGA_169`, `QHD_169`, `HD_169`,\n * `FHD_169`, `QVGA_43`, `VGA_43`, `QHD_43`, `HD_43`, `FHD_43`. Note that quality might be worse than\n * specified due to device capabilities, internet connection etc.\n * @default `VGA_169`\n */\n quality?: VideoQuality;\n /**\n * whether to flip the dimensions of the video, that is whether to film in vertical orientation.\n * This basically switches width with height and is only used to select closes capture format.\n *\n * To record horizontal video your phone orientation must be in landscape and your app must support this orientation.\n *\n * Platform specific capture formats:\n * @see iOS: https://developer.apple.com/documentation/avfoundation/avcapturedevice/format\n * @see Android: https://github.com/webrtc-sdk/webrtc/blob/cdc3bba5aa38910a55428b919ba45aceac1ad9ad/sdk/android/api/org/webrtc/CameraEnumerationAndroid.java#L50\n *\n * WebRTC device orientation handling:\n * @see iOS: https://github.com/webrtc-sdk/webrtc/blob/cdc3bba5aa38910a55428b919ba45aceac1ad9ad/sdk/objc/components/capturer/RTCCameraVideoCapturer.m#L285\n * @see Android: https://github.com/pristineio/webrtc-mirror/blob/7a5bcdffaab90a05bc1146b2b1ea71c004e54d71/webrtc/sdk/android/src/java/org/webrtc/Camera2Session.java#L347\n *\n * @default `true`\n */\n flipDimensions?: boolean;\n /**\n * whether the camera track is initially enabled, you can toggle it on/off later with toggleCamera method\n * @default `true`\n */\n cameraEnabled?: boolean;\n /**\n * id of the camera to start capture with. Get available cameras with `cameras`.\n * You can switch the cameras later with `switchCamera` functions.\n * @default the first front camera\n */\n cameraId?: CameraId;\n};\n\nexport type CameraConfig = CameraConfigBase & {\n /**\n * whether video track uses simulcast. By default simulcast is disabled.\n */\n simulcastEnabled?: boolean;\n /**\n * bandwidth limit of a video track. By default there is no bandwidth limit.\n */\n};\n\nexport type CameraConfigInternal = CameraConfigBase & {\n videoTrackMetadata?: { active: boolean; type: 'camera' };\n /**\n * SimulcastConfig of a video track. By default simulcast is disabled.\n */\n simulcastConfig?: SimulcastConfig;\n /**\n * bandwidth limit of a video track. By default there is no bandwidth limit.\n */\n maxBandwidth?: TrackBandwidthLimit;\n} & (\n | { maxBandwidthInt?: BandwidthLimit }\n | { maxBandwidthMap?: SimulcastBandwidthLimit }\n );\n\nconst defaultSimulcastConfig = () => ({\n enabled: false,\n activeEncodings: [],\n});\n\nfunction maxBandwidthConfig(maxBandwidth: TrackBandwidthLimit | undefined) {\n if (Platform.OS === 'android') {\n if (typeof maxBandwidth === 'object') {\n return {\n maxBandwidth: undefined,\n maxBandwidthMap: maxBandwidth,\n };\n } else {\n return {\n maxBandwidth: undefined,\n maxBandwidthInt: maxBandwidth,\n };\n }\n }\n return { maxBandwidth };\n}\n\nfunction getSimulcastConfig(\n simulcastEnabled: boolean | undefined,\n): SimulcastConfig | undefined {\n // iOS has a limit of 3 hardware encoders\n // 3 simulcast layers + 1 screen share layer = 4, which is too much\n // so we limit simulcast layers to 2\n if (simulcastEnabled) {\n return Platform.select<SimulcastConfig>({\n ios: { enabled: true, activeEncodings: ['l', 'h'] },\n android: { enabled: true, activeEncodings: ['l', 'm', 'h'] },\n });\n }\n return undefined;\n}\n\nexport function updateCameraConfig(\n config: Readonly<CameraConfig>,\n): CameraConfigInternal {\n return {\n ...config,\n ...maxBandwidthConfig({ l: 150, m: 500, h: 1500 }),\n videoTrackMetadata: { active: true, type: 'camera' },\n simulcastConfig: getSimulcastConfig(config.simulcastEnabled),\n };\n}\n\n/**\n * This hook can toggle camera on/off and provides current camera state.\n * @category Devices\n * @group Hooks\n */\nexport function useCamera() {\n const simulcastConfig = useFishjamEventState<SimulcastConfig>(\n ReceivableEvents.SimulcastConfigUpdate,\n defaultSimulcastConfig(), // TODO: Fetch from native\n );\n\n const { currentCamera: currentCameraState, isCameraOn } =\n useFishjamEventState<CurrentCameraChangedType>(\n ReceivableEvents.CurrentCameraChanged,\n {\n currentCamera: RNFishjamClientModule.currentCamera,\n isCameraOn: RNFishjamClientModule.isCameraOn,\n },\n );\n\n // For Android Expo converts null to undefined ¯\\_(ツ)_/¯\n const currentCamera = currentCameraState ?? null;\n\n const cameras = useMemo(() => RNFishjamClientModule.cameras, []);\n\n const prepareCamera = useCallback(\n async (config: Readonly<CameraConfig> = {}) => {\n const camera = RNFishjamClientModule.cameras.find((cam) =>\n config.cameraId\n ? cam.id === config.cameraId\n : cam.facingDirection === 'front',\n );\n\n const updatedConfig = updateCameraConfig({\n ...config,\n cameraId: camera?.id,\n });\n return RNFishjamClientModule.startCamera(updatedConfig);\n },\n [],\n );\n\n const toggleCamera = useCallback(async () => {\n const state = await RNFishjamClientModule.toggleCamera();\n await RNFishjamClientModule.updateVideoTrackMetadata({\n active: state,\n type: 'camera',\n });\n }, []);\n\n const switchCamera = useCallback(async (cameraId: CameraId) => {\n await RNFishjamClientModule.switchCamera(cameraId);\n }, []);\n\n const setVideoTrackBandwidth = useCallback(\n async (bandwidth: BandwidthLimit) => {\n await RNFishjamClientModule.setVideoTrackBandwidth(bandwidth);\n },\n [],\n );\n\n const toggleVideoTrackEncoding = useCallback(\n async (encoding: TrackEncoding) => {\n await RNFishjamClientModule.toggleVideoTrackEncoding(encoding);\n },\n [],\n );\n\n const setVideoTrackEncodingBandwidth = useCallback(\n async (encoding: TrackEncoding, bandwidth: BandwidthLimit) => {\n await RNFishjamClientModule.setVideoTrackEncodingBandwidth(\n encoding,\n bandwidth,\n );\n },\n [],\n );\n\n return {\n /**\n * Informs if user camera is streaming video\n */\n isCameraOn,\n /**\n * Which camera is now used for streaming (or will be used as default when camera will be enabled)\n */\n currentCamera,\n /**\n * Simulcast configuration\n */\n simulcastConfig,\n /**\n * Property that lists cameras available on device.\n * @returns A promise that resolves to the list of available cameras.\n */\n cameras,\n\n /** Enable/disable current camera */\n toggleCamera,\n /**\n * Prepares camera and starts local video track\n * @param config configuration of the camera capture\n * @returns A promise that resolves when camera is started.\n */\n prepareCamera,\n /**\n * Switches to the specified camera.\n * List of available devices can be retrieved from `cameras` variable\n * @returns A promise that resolves when camera is switched.\n */ switchCamera,\n\n /**\n * @deprecated\n * toggles encoding of a video track on/off\n * @param encoding encoding to toggle\n */\n toggleVideoTrackEncoding,\n /**\n * updates maximum bandwidth for the given simulcast encoding of the video track\n * @param encoding encoding to update\n * @param bandwidth BandwidthLimit to set\n * @deprecated\n */\n setVideoTrackEncodingBandwidth,\n /**\n * updates maximum bandwidth for the video track. This value directly translates\n * to quality of the stream and the amount of RTP packets being sent. In case simulcast\n * is enabled bandwidth is split between all of the variant streams proportionally to\n * their resolution.\n * @param BandwidthLimit to set\n * @deprecated\n */\n setVideoTrackBandwidth,\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"useCamera.js","sourceRoot":"","sources":["../../src/hooks/useCamera.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAE7C,OAAO,qBAAqB,EAAE,EAC5B,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAsFvE,MAAM,sBAAsB,GAAG,GAAG,EAAE,CAClC,CAAC;IACC,OAAO,EAAE,KAAK;CACf,CAA2B,CAAC;AAE/B,SAAS,kBAAkB,CACzB,gBAAqC;IAErC,IAAI,gBAAgB,EAAE,CAAC;QACrB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,kBAAkB,CAChC,MAA8B;IAE9B,OAAO;QACL,GAAG,MAAM;QACT,kBAAkB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE;QACpD,eAAe,EAAE,kBAAkB,CAAC,MAAM,CAAC,gBAAgB,CAAC;KAC7D,CAAC;AACJ,CAA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ACnD,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,QAAQ;SACf,CAAC,CAAC;IACL,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,YAAY,GAAG,WAAW,CAAC,KAAK,EAAE,QAAkB,EAAE,EAAE;QAC5D,MAAM,qBAAqB,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IACrD,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO;QACL;;WAEG;QACH,UAAU;QACV;;WAEG;QACH,aAAa;QACb;;WAEG;QACH,eAAe;QACf;;;WAGG;QACH,OAAO;QACP;;WAEG;QACH,aAAa,EAAE,mBAAmB;QAClC;;WAEG;QACH,YAAY;QACZ;;;;WAIG;QACH,aAAa;QACb;;;;WAIG;QACH,YAAY;KACb,CAAC;AACJ,CAAC","sourcesContent":["import { useCallback, useMemo } from 'react';\nimport { Brand, SimulcastConfig } from '../types';\nimport RNFishjamClientModule, {\n ReceivableEvents,\n} from '../RNFishjamClientModule';\nimport { useFishjamEventState } from './internal/useFishjamEventState';\n\nexport type CameraId = Brand<string, 'CameraId'>;\n\nexport type CameraFacingDirection = 'front' | 'back' | 'unspecified';\n\nexport type Camera = {\n id: CameraId;\n name: string;\n facingDirection: CameraFacingDirection;\n};\n\nexport type CurrentCameraChangedType = {\n currentCamera: Camera | null;\n isCameraOn: boolean;\n isCameraInitialized: boolean;\n};\n\nexport type VideoQuality =\n | 'QVGA169'\n | 'VGA169'\n | 'QHD169'\n | 'HD169'\n | 'FHD169'\n | 'QVGA43'\n | 'VGA43'\n | 'QHD43'\n | 'HD43'\n | 'FHD43';\n\nexport type CameraConfigBase = {\n /**\n * resolution + aspect ratio of local video track, one of: `QVGA_169`, `VGA_169`, `QHD_169`, `HD_169`,\n * `FHD_169`, `QVGA_43`, `VGA_43`, `QHD_43`, `HD_43`, `FHD_43`. Note that quality might be worse than\n * specified due to device capabilities, internet connection etc.\n * @default `VGA_169`\n */\n quality?: VideoQuality;\n /**\n * whether to flip the dimensions of the video, that is whether to film in vertical orientation.\n * This basically switches width with height and is only used to select closes capture format.\n *\n * To record horizontal video your phone orientation must be in landscape and your app must support this orientation.\n *\n * Platform specific capture formats:\n * @see iOS: https://developer.apple.com/documentation/avfoundation/avcapturedevice/format\n * @see Android: https://github.com/webrtc-sdk/webrtc/blob/cdc3bba5aa38910a55428b919ba45aceac1ad9ad/sdk/android/api/org/webrtc/CameraEnumerationAndroid.java#L50\n *\n * WebRTC device orientation handling:\n * @see iOS: https://github.com/webrtc-sdk/webrtc/blob/cdc3bba5aa38910a55428b919ba45aceac1ad9ad/sdk/objc/components/capturer/RTCCameraVideoCapturer.m#L285\n * @see Android: https://github.com/pristineio/webrtc-mirror/blob/7a5bcdffaab90a05bc1146b2b1ea71c004e54d71/webrtc/sdk/android/src/java/org/webrtc/Camera2Session.java#L347\n *\n * @default `true`\n */\n flipDimensions?: boolean;\n /**\n * whether the camera track is initially enabled, you can toggle it on/off later with toggleCamera method\n * @default `true`\n */\n cameraEnabled?: boolean;\n /**\n * id of the camera to start capture with. Get available cameras with `cameras`.\n * You can switch the cameras later with `switchCamera` functions.\n * @default the first front camera\n */\n cameraId?: CameraId;\n};\n\nexport type CameraConfig = CameraConfigBase & {\n /**\n * whether video track uses simulcast. By default simulcast is disabled.\n */\n simulcastEnabled?: boolean;\n /**\n * bandwidth limit of a video track. By default there is no bandwidth limit.\n */\n};\n\nexport type CameraConfigInternal = CameraConfigBase & {\n videoTrackMetadata?: { active: boolean; type: 'camera' };\n /**\n * SimulcastConfig of a video track. By default simulcast is disabled.\n */\n simulcastConfig?: SimulcastConfig;\n};\n\nconst defaultSimulcastConfig = () =>\n ({\n enabled: false,\n }) satisfies SimulcastConfig;\n\nfunction getSimulcastConfig(\n simulcastEnabled: boolean | undefined,\n): SimulcastConfig | undefined {\n if (simulcastEnabled) {\n return { enabled: true };\n }\n return undefined;\n}\n\nexport function updateCameraConfig(\n config: Readonly<CameraConfig>,\n): CameraConfigInternal {\n return {\n ...config,\n videoTrackMetadata: { active: true, type: 'camera' },\n simulcastConfig: getSimulcastConfig(config.simulcastEnabled),\n };\n}\n\n/**\n * This hook can toggle camera on/off and provides current camera state.\n * @category Devices\n * @group Hooks\n */\nexport function useCamera() {\n const simulcastConfig = useFishjamEventState(\n ReceivableEvents.SimulcastConfigUpdate,\n defaultSimulcastConfig(), // TODO: Fetch from native\n );\n\n const {\n currentCamera: currentCameraState,\n isCameraOn,\n isCameraInitialized,\n } = useFishjamEventState(ReceivableEvents.CurrentCameraChanged, {\n currentCamera: RNFishjamClientModule.currentCamera,\n isCameraOn: RNFishjamClientModule.isCameraOn,\n isCameraInitialized: RNFishjamClientModule.isCameraInitialized,\n });\n\n // For Android Expo converts null to undefined ¯\\_(ツ)_/¯\n const currentCamera = currentCameraState ?? null;\n\n const cameras = useMemo(() => RNFishjamClientModule.cameras, []);\n\n const prepareCamera = useCallback(\n async (config: Readonly<CameraConfig> = {}) => {\n const camera = RNFishjamClientModule.cameras.find((cam) =>\n config.cameraId\n ? cam.id === config.cameraId\n : cam.facingDirection === 'front',\n );\n\n const updatedConfig = updateCameraConfig({\n ...config,\n cameraId: camera?.id,\n });\n return RNFishjamClientModule.startCamera(updatedConfig);\n },\n [],\n );\n\n const toggleCamera = useCallback(async () => {\n const state = await RNFishjamClientModule.toggleCamera();\n await RNFishjamClientModule.updateVideoTrackMetadata({\n active: state,\n type: 'camera',\n });\n }, []);\n\n const switchCamera = useCallback(async (cameraId: CameraId) => {\n await RNFishjamClientModule.switchCamera(cameraId);\n }, []);\n\n return {\n /**\n * Informs if user camera is streaming video\n */\n isCameraOn,\n /**\n * Which camera is now used for streaming (or will be used as default when camera will be enabled)\n */\n currentCamera,\n /**\n * Simulcast configuration\n */\n simulcastConfig,\n /**\n * Property that lists cameras available on device.\n * @returns A promise that resolves to the list of available cameras.\n */\n cameras,\n /**\n * A value indicating if camera was already initialized (if `prepareCamera` was called).\n */\n isInitialized: isCameraInitialized,\n /**\n * Enable/disable current camera\n */\n toggleCamera,\n /**\n * Prepares camera and starts local video track\n * @param config configuration of the camera capture\n * @returns A promise that resolves when camera is started.\n */\n prepareCamera,\n /**\n * Switches to the specified camera.\n * List of available devices can be retrieved from `cameras` variable\n * @returns A promise that resolves when camera is switched.\n */\n switchCamera,\n };\n}\n"]}
|
|
@@ -1,26 +1,40 @@
|
|
|
1
|
-
import { ConnectionConfig
|
|
1
|
+
import { ConnectionConfig } from '../common/client';
|
|
2
2
|
import { GenericMetadata } from '../types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Represents the possible statuses of a peer while reconnecting to room
|
|
5
|
+
*
|
|
6
|
+
* - `idle` - No reconnection in progress. See {@link PeerStatus} for more details
|
|
7
|
+
* - `reconnecting` - Peer is in the process of reconnecting.
|
|
8
|
+
* - `error` - There was an error in the reconnection process.
|
|
9
|
+
*/
|
|
10
|
+
export type ReconnectionStatus = 'idle' | 'reconnecting' | 'error';
|
|
11
|
+
/**
|
|
12
|
+
* Represents the possible statuses of a peer connection to a room (websocket state).
|
|
13
|
+
*
|
|
14
|
+
* - `idle` - Peer is not connected, either never connected or successfully disconnected.
|
|
15
|
+
* - `connecting` - Peer is in the process of connecting.
|
|
16
|
+
* - `connected` - Peer has successfully connected.
|
|
17
|
+
* - `error` - There was an error in the connection process.
|
|
18
|
+
*/
|
|
19
|
+
export type PeerStatus = 'connecting' | 'connected' | 'error' | 'idle';
|
|
20
|
+
export type JoinRoomConfig<PeerMetadata extends GenericMetadata = GenericMetadata> = {
|
|
7
21
|
/**
|
|
8
|
-
*
|
|
22
|
+
* Fishjam URL
|
|
9
23
|
*/
|
|
10
24
|
url: string;
|
|
11
25
|
/**
|
|
12
|
-
*
|
|
26
|
+
* Token received from server (or Room Manager)
|
|
13
27
|
*/
|
|
14
28
|
peerToken: string;
|
|
15
29
|
/**
|
|
16
|
-
*
|
|
30
|
+
* String indexed record with metadata, that will be available to all other peers
|
|
17
31
|
*/
|
|
18
32
|
peerMetadata?: PeerMetadata;
|
|
19
33
|
/**
|
|
20
|
-
*
|
|
34
|
+
* Additional connection configuration
|
|
21
35
|
*/
|
|
22
36
|
config?: ConnectionConfig;
|
|
23
|
-
}
|
|
37
|
+
};
|
|
24
38
|
/**
|
|
25
39
|
* Connect/leave room. And get connection status.
|
|
26
40
|
* @group Hooks
|
|
@@ -28,15 +42,17 @@ export interface JoinRoomConfig<PeerMetadata extends GenericMetadata = GenericMe
|
|
|
28
42
|
*/
|
|
29
43
|
export declare function useConnection(): {
|
|
30
44
|
/**
|
|
31
|
-
*
|
|
45
|
+
* Join room and start streaming camera and microphone
|
|
46
|
+
*
|
|
47
|
+
* See {@link JoinRoomConfig} for parameter list
|
|
32
48
|
*/
|
|
33
49
|
joinRoom: <PeerMetadata extends GenericMetadata = GenericMetadata>({ url, peerToken, peerMetadata, config, }: JoinRoomConfig<PeerMetadata>) => Promise<void>;
|
|
34
50
|
/**
|
|
35
51
|
* Leave room and stop streaming
|
|
52
|
+
* @type function
|
|
36
53
|
*/
|
|
37
|
-
leaveRoom:
|
|
54
|
+
leaveRoom: () => void;
|
|
38
55
|
peerStatus: PeerStatus;
|
|
39
56
|
reconnectionStatus: ReconnectionStatus;
|
|
40
57
|
};
|
|
41
|
-
export {};
|
|
42
58
|
//# sourceMappingURL=useConnection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConnection.d.ts","sourceRoot":"","sources":["../../src/hooks/useConnection.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"useConnection.d.ts","sourceRoot":"","sources":["../../src/hooks/useConnection.ts"],"names":[],"mappings":"AACA,OAAO,EACL,gBAAgB,EAGjB,MAAM,kBAAkB,CAAC;AAM1B,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,cAAc,GAAG,OAAO,CAAC;AAEnE;;;;;;;GAOG;AACH,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,WAAW,GAAG,OAAO,GAAG,MAAM,CAAC;AAevE,MAAM,MAAM,cAAc,CACxB,YAAY,SAAS,eAAe,GAAG,eAAe,IACpD;IACF;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B;;OAEG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,aAAa;IAoBzB;;;;OAIG;eApBI,YAAY,SAAS,eAAe,+DAKxC,cAAc,CAAC,YAAY,CAAC;IAiB/B;;;OAGG;;;;EAKN"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCallback } from 'react';
|
|
2
|
-
import { joinRoom, leaveRoom } from '../common/client';
|
|
2
|
+
import { joinRoom as joinRoomClient, leaveRoom as leaveRoomClient, } from '../common/client';
|
|
3
3
|
import RNFishjamClientModule, { ReceivableEvents, } from '../RNFishjamClientModule';
|
|
4
4
|
import { useFishjamEventState } from './internal/useFishjamEventState';
|
|
5
5
|
function useConnectionStatus() {
|
|
@@ -14,16 +14,22 @@ function useConnectionStatus() {
|
|
|
14
14
|
*/
|
|
15
15
|
export function useConnection() {
|
|
16
16
|
const { peerStatus, reconnectionStatus } = useConnectionStatus();
|
|
17
|
-
const
|
|
18
|
-
await
|
|
17
|
+
const joinRoom = useCallback(async ({ url, peerToken, peerMetadata, config, }) => {
|
|
18
|
+
await joinRoomClient(url, peerToken, peerMetadata, config);
|
|
19
|
+
}, []);
|
|
20
|
+
const leaveRoom = useCallback(() => {
|
|
21
|
+
leaveRoomClient();
|
|
19
22
|
}, []);
|
|
20
23
|
return {
|
|
21
24
|
/**
|
|
22
|
-
*
|
|
25
|
+
* Join room and start streaming camera and microphone
|
|
26
|
+
*
|
|
27
|
+
* See {@link JoinRoomConfig} for parameter list
|
|
23
28
|
*/
|
|
24
|
-
joinRoom
|
|
29
|
+
joinRoom,
|
|
25
30
|
/**
|
|
26
31
|
* Leave room and stop streaming
|
|
32
|
+
* @type function
|
|
27
33
|
*/
|
|
28
34
|
leaveRoom,
|
|
29
35
|
peerStatus,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConnection.js","sourceRoot":"","sources":["../../src/hooks/useConnection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,
|
|
1
|
+
{"version":3,"file":"useConnection.js","sourceRoot":"","sources":["../../src/hooks/useConnection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAEL,QAAQ,IAAI,cAAc,EAC1B,SAAS,IAAI,eAAe,GAC7B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,qBAAqB,EAAE,EAC5B,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAsBvE,SAAS,mBAAmB;IAC1B,MAAM,UAAU,GAAG,oBAAoB,CACrC,gBAAgB,CAAC,iBAAiB,EAClC,qBAAqB,CAAC,UAAU,CACjC,CAAC;IAEF,MAAM,kBAAkB,GAAG,oBAAoB,CAC7C,gBAAgB,CAAC,yBAAyB,EAC1C,qBAAqB,CAAC,kBAAkB,CACzC,CAAC;IAEF,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,CAAC;AAC5C,CAAC;AAsBD;;;;GAIG;AACH,MAAM,UAAU,aAAa;IAC3B,MAAM,EAAE,UAAU,EAAE,kBAAkB,EAAE,GAAG,mBAAmB,EAAE,CAAC;IAEjE,MAAM,QAAQ,GAAG,WAAW,CAC1B,KAAK,EAA0D,EAC7D,GAAG,EACH,SAAS,EACT,YAAY,EACZ,MAAM,GACuB,EAAE,EAAE;QACjC,MAAM,cAAc,CAAC,GAAG,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;IAC7D,CAAC,EACD,EAAE,CACH,CAAC;IAEF,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE;QACjC,eAAe,EAAE,CAAC;IACpB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO;QACL;;;;WAIG;QACH,QAAQ;QACR;;;WAGG;QACH,SAAS;QACT,UAAU;QACV,kBAAkB;KACnB,CAAC;AACJ,CAAC","sourcesContent":["import { useCallback } from 'react';\nimport {\n ConnectionConfig,\n joinRoom as joinRoomClient,\n leaveRoom as leaveRoomClient,\n} from '../common/client';\n\nimport RNFishjamClientModule, {\n ReceivableEvents,\n} from '../RNFishjamClientModule';\nimport { useFishjamEventState } from './internal/useFishjamEventState';\nimport { GenericMetadata } from '../types';\n\n/**\n * Represents the possible statuses of a peer while reconnecting to room\n *\n * - `idle` - No reconnection in progress. See {@link PeerStatus} for more details\n * - `reconnecting` - Peer is in the process of reconnecting.\n * - `error` - There was an error in the reconnection process.\n */\nexport type ReconnectionStatus = 'idle' | 'reconnecting' | 'error';\n\n/**\n * Represents the possible statuses of a peer connection to a room (websocket state).\n *\n * - `idle` - Peer is not connected, either never connected or successfully disconnected.\n * - `connecting` - Peer is in the process of connecting.\n * - `connected` - Peer has successfully connected.\n * - `error` - There was an error in the connection process.\n */\nexport type PeerStatus = 'connecting' | 'connected' | 'error' | 'idle';\n\nfunction useConnectionStatus() {\n const peerStatus = useFishjamEventState(\n ReceivableEvents.PeerStatusChanged,\n RNFishjamClientModule.peerStatus,\n );\n\n const reconnectionStatus = useFishjamEventState(\n ReceivableEvents.ReconnectionStatusChanged,\n RNFishjamClientModule.reconnectionStatus,\n );\n\n return { peerStatus, reconnectionStatus };\n}\nexport type JoinRoomConfig<\n PeerMetadata extends GenericMetadata = GenericMetadata,\n> = {\n /**\n * Fishjam URL\n */\n url: string;\n /**\n * Token received from server (or Room Manager)\n */\n peerToken: string;\n /**\n * String indexed record with metadata, that will be available to all other peers\n */\n peerMetadata?: PeerMetadata;\n /**\n * Additional connection configuration\n */\n config?: ConnectionConfig;\n};\n\n/**\n * Connect/leave room. And get connection status.\n * @group Hooks\n * @category Connection\n */\nexport function useConnection() {\n const { peerStatus, reconnectionStatus } = useConnectionStatus();\n\n const joinRoom = useCallback(\n async <PeerMetadata extends GenericMetadata = GenericMetadata>({\n url,\n peerToken,\n peerMetadata,\n config,\n }: JoinRoomConfig<PeerMetadata>) => {\n await joinRoomClient(url, peerToken, peerMetadata, config);\n },\n [],\n );\n\n const leaveRoom = useCallback(() => {\n leaveRoomClient();\n }, []);\n\n return {\n /**\n * Join room and start streaming camera and microphone\n *\n * See {@link JoinRoomConfig} for parameter list\n */\n joinRoom,\n /**\n * Leave room and stop streaming\n * @type function\n */\n leaveRoom,\n peerStatus,\n reconnectionStatus,\n };\n}\n"]}
|
|
@@ -1,25 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* A type representing the configuration for foreground service permissions.
|
|
3
|
-
*
|
|
4
|
-
* @param enableCamera Indicates whether the camera is enabled for the foreground service.
|
|
5
|
-
* @param enableMicrophone Indicates whether the microphone is enabled for the foreground service.
|
|
6
|
-
* @param channelId The id of the channel. Must be unique per package.
|
|
7
|
-
* @param channelName The user visible name of the channel.
|
|
8
|
-
* @param notificationTitle The title (first row) of the notification, in a standard notification.
|
|
9
|
-
* @param notificationContent The text (second row) of the notification, in a standard notification.
|
|
10
|
-
*
|
|
11
3
|
*/
|
|
12
4
|
export type ForegroundServiceConfig = {
|
|
5
|
+
/**
|
|
6
|
+
* Indicates whether the camera is enabled for the foreground service.
|
|
7
|
+
*/
|
|
13
8
|
enableCamera?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Indicates whether the microphone is enabled for the foreground service.
|
|
11
|
+
*/
|
|
14
12
|
enableMicrophone?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* The id of the channel. Must be unique per package.
|
|
15
|
+
*/
|
|
15
16
|
channelId?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The user visible name of the channel.
|
|
19
|
+
*/
|
|
16
20
|
channelName?: string;
|
|
21
|
+
/**
|
|
22
|
+
* The title (first row) of the notification, in a standard notification.
|
|
23
|
+
*/
|
|
17
24
|
notificationTitle?: string;
|
|
25
|
+
/**
|
|
26
|
+
* The text (second row) of the notification, in a standard notification.
|
|
27
|
+
*/
|
|
18
28
|
notificationContent?: string;
|
|
19
29
|
};
|
|
20
30
|
/**
|
|
21
|
-
* useForegroundService
|
|
22
|
-
*
|
|
23
31
|
* A hook for managing a foreground service on Android. Does nothing on other platforms.
|
|
24
32
|
* You can use this hook to keep your app running in the background. You're also required to run a foreground service when screen sharing.
|
|
25
33
|
*
|
|
@@ -30,7 +38,8 @@ export type ForegroundServiceConfig = {
|
|
|
30
38
|
* @param {Object} config.channelName - The user visible name of the channel.
|
|
31
39
|
* @param {Object} config.notificationTitle - The title (first row) of the notification, in a standard notification.
|
|
32
40
|
* @param {Object} config.notificationContent - The text (second row) of the notification, in a standard notification.
|
|
33
|
-
*
|
|
41
|
+
* @group Hooks
|
|
42
|
+
* @category Connection
|
|
34
43
|
*/
|
|
35
44
|
export declare const useForegroundService: ({ enableCamera, enableMicrophone, channelId, channelName, notificationContent, notificationTitle, }: ForegroundServiceConfig) => void;
|
|
36
45
|
//# sourceMappingURL=useForegroundService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useForegroundService.d.ts","sourceRoot":"","sources":["../../src/hooks/useForegroundService.ts"],"names":[],"mappings":"AAKA
|
|
1
|
+
{"version":3,"file":"useForegroundService.d.ts","sourceRoot":"","sources":["../../src/hooks/useForegroundService.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AA6DF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,oBAAoB,wGAnD9B,uBAAuB,SAsDxB,CAAC"}
|
|
@@ -46,8 +46,6 @@ const useForegroundServiceAndroid = ({ enableCamera, enableMicrophone, channelId
|
|
|
46
46
|
};
|
|
47
47
|
const emptyFunction = () => { };
|
|
48
48
|
/**
|
|
49
|
-
* useForegroundService
|
|
50
|
-
*
|
|
51
49
|
* A hook for managing a foreground service on Android. Does nothing on other platforms.
|
|
52
50
|
* You can use this hook to keep your app running in the background. You're also required to run a foreground service when screen sharing.
|
|
53
51
|
*
|
|
@@ -58,7 +56,8 @@ const emptyFunction = () => { };
|
|
|
58
56
|
* @param {Object} config.channelName - The user visible name of the channel.
|
|
59
57
|
* @param {Object} config.notificationTitle - The title (first row) of the notification, in a standard notification.
|
|
60
58
|
* @param {Object} config.notificationContent - The text (second row) of the notification, in a standard notification.
|
|
61
|
-
*
|
|
59
|
+
* @group Hooks
|
|
60
|
+
* @category Connection
|
|
62
61
|
*/
|
|
63
62
|
export const useForegroundService = Platform.select({
|
|
64
63
|
android: useForegroundServiceAndroid,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useForegroundService.js","sourceRoot":"","sources":["../../src/hooks/useForegroundService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,qBAAqB,MAAM,0BAA0B,CAAC;AAE7D,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"useForegroundService.js","sourceRoot":"","sources":["../../src/hooks/useForegroundService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AM,8BAA8B,EAAE,CAAC;YACvC,eAAe,CAAC,IAAI,CAAC,CAAC;QACxB,CAAC,CAAC;QACF,gBAAgB,EAAE,CAAC;QACnB,OAAO,GAAG,EAAE,CAAC,qBAAqB,CAAC,qBAAqB,EAAE,CAAC;IAC7D,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;AAE/B;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,QAAQ,CAAC,MAAM,CAAC;IAClD,OAAO,EAAE,2BAA2B;IACpC,OAAO,EAAE,aAAa;CACvB,CAAC,CAAC","sourcesContent":["import { useEffect, useState } from 'react';\nimport RNFishjamClientModule from '../RNFishjamClientModule';\n\nimport { PermissionsAndroid, Platform } from 'react-native';\n\n/**\n * A type representing the configuration for foreground service permissions.\n */\nexport type ForegroundServiceConfig = {\n /**\n * Indicates whether the camera is enabled for the foreground service.\n */\n enableCamera?: boolean;\n /**\n * Indicates whether the microphone is enabled for the foreground service.\n */\n enableMicrophone?: boolean;\n /**\n * The id of the channel. Must be unique per package.\n */\n channelId?: string;\n /**\n * The user visible name of the channel.\n */\n channelName?: string;\n /**\n * The title (first row) of the notification, in a standard notification.\n */\n notificationTitle?: string;\n /**\n * The text (second row) of the notification, in a standard notification.\n */\n notificationContent?: string;\n};\n\nconst requestNotificationsPermission = async () => {\n try {\n const result = await PermissionsAndroid.request(\n PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS,\n );\n if (result !== PermissionsAndroid.RESULTS.GRANTED) {\n console.warn(\n \"Notifications permission not granted. User won't be able to see a the app is in background.\",\n );\n }\n } catch (err) {\n console.warn(err);\n }\n};\n\nconst useForegroundServiceAndroid = ({\n enableCamera,\n enableMicrophone,\n channelId,\n channelName,\n notificationContent,\n notificationTitle,\n}: ForegroundServiceConfig) => {\n const [isConfigured, setIsConfigured] = useState(false);\n\n useEffect(() => {\n if (!isConfigured) {\n return;\n }\n RNFishjamClientModule.startForegroundService({\n enableCamera,\n enableMicrophone,\n channelId,\n channelName,\n notificationContent,\n notificationTitle,\n });\n }, [\n channelId,\n channelName,\n enableCamera,\n enableMicrophone,\n isConfigured,\n notificationContent,\n notificationTitle,\n ]);\n\n useEffect(() => {\n const runConfiguration = async () => {\n await requestNotificationsPermission();\n setIsConfigured(true);\n };\n runConfiguration();\n return () => RNFishjamClientModule.stopForegroundService();\n }, []);\n};\n\nconst emptyFunction = () => {};\n\n/**\n * A hook for managing a foreground service on Android. Does nothing on other platforms.\n * You can use this hook to keep your app running in the background. You're also required to run a foreground service when screen sharing.\n *\n * @param {Object} config - Configuration options for the foreground service.\n * @param {boolean} config.enableCamera - Flag to enable or disable camera usage in the foreground service. Only enable after the user has granted the necessary permissions.\n * @param {boolean} config.enableMicrophone - Flag to enable or disable microphone usage in the foreground service. Only enable after the user has granted the necessary permissions.\n * @param {Object} config.channelId - The id of the channel. Must be unique per package.\n * @param {Object} config.channelName - The user visible name of the channel.\n * @param {Object} config.notificationTitle - The title (first row) of the notification, in a standard notification.\n * @param {Object} config.notificationContent - The text (second row) of the notification, in a standard notification.\n * @group Hooks\n * @category Connection\n */\nexport const useForegroundService = Platform.select({\n android: useForegroundServiceAndroid,\n default: emptyFunction,\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMicrophone.js","sourceRoot":"","sources":["../../src/hooks/useMicrophone.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,qBAAqB,EAAE,EAC5B,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEvE;;;;GAIG;AACH,MAAM,UAAU,aAAa;IAC3B,MAAM,cAAc,GAAG,oBAAoB,CACzC,gBAAgB,CAAC,cAAc,EAC/B,qBAAqB,CAAC,cAAc,CACrC,CAAC;IAEF,MAAM,gBAAgB,GAAG,WAAW,CAAC,KAAK,IAAI,EAAE;QAC9C,MAAM,qBAAqB,CAAC,gBAAgB,EAAE,CAAC;IACjD,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO;QACL,+CAA+C;QAC/C,cAAc;QACd,2CAA2C;QAC3C,gBAAgB;KACjB,CAAC;AACJ,CAAC","sourcesContent":["import { useCallback } from 'react';\n\nimport RNFishjamClientModule, {\n ReceivableEvents,\n} from '../RNFishjamClientModule';\nimport { useFishjamEventState } from './internal/useFishjamEventState';\n\n/**\n * This hook can toggle microphone on/off and provides current microphone state.\n * @category Devices\n * @group Hooks\n */\nexport function useMicrophone() {\n const isMicrophoneOn = useFishjamEventState
|
|
1
|
+
{"version":3,"file":"useMicrophone.js","sourceRoot":"","sources":["../../src/hooks/useMicrophone.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,qBAAqB,EAAE,EAC5B,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEvE;;;;GAIG;AACH,MAAM,UAAU,aAAa;IAC3B,MAAM,cAAc,GAAG,oBAAoB,CACzC,gBAAgB,CAAC,cAAc,EAC/B,qBAAqB,CAAC,cAAc,CACrC,CAAC;IAEF,MAAM,gBAAgB,GAAG,WAAW,CAAC,KAAK,IAAI,EAAE;QAC9C,MAAM,qBAAqB,CAAC,gBAAgB,EAAE,CAAC;IACjD,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO;QACL,+CAA+C;QAC/C,cAAc;QACd,2CAA2C;QAC3C,gBAAgB;KACjB,CAAC;AACJ,CAAC","sourcesContent":["import { useCallback } from 'react';\n\nimport RNFishjamClientModule, {\n ReceivableEvents,\n} from '../RNFishjamClientModule';\nimport { useFishjamEventState } from './internal/useFishjamEventState';\n\n/**\n * This hook can toggle microphone on/off and provides current microphone state.\n * @category Devices\n * @group Hooks\n */\nexport function useMicrophone() {\n const isMicrophoneOn = useFishjamEventState(\n ReceivableEvents.IsMicrophoneOn,\n RNFishjamClientModule.isMicrophoneOn,\n );\n\n const toggleMicrophone = useCallback(async () => {\n await RNFishjamClientModule.toggleMicrophone();\n }, []);\n\n return {\n /** Informs if microphone is streaming audio */\n isMicrophoneOn,\n /** Function to toggle microphone on/off */\n toggleMicrophone,\n };\n}\n"]}
|
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Represents the possible statuses of a peer connection to a room (websocket state).
|
|
3
|
-
*
|
|
4
|
-
* idle - Peer is not connected, either never connected or successfully disconnected.
|
|
5
|
-
* connecting - Peer is in the process of connecting.
|
|
6
|
-
* connected - Peer has successfully connected.
|
|
7
|
-
* error - There was an error in the connection process.
|
|
8
|
-
*/
|
|
9
|
-
export type PeerStatus = 'connecting' | 'connected' | 'error' | 'idle';
|
|
10
1
|
/**
|
|
11
2
|
* This hook provides live updates of current connection state of the local peer to a room (websocket state)
|
|
12
3
|
* @returns Current peer status.
|
|
13
4
|
* @deprecated
|
|
5
|
+
* @ignore
|
|
14
6
|
*/
|
|
15
7
|
export declare const usePeerStatus: () => {
|
|
16
|
-
peerStatus: PeerStatus;
|
|
8
|
+
peerStatus: import("./useConnection").PeerStatus;
|
|
17
9
|
};
|
|
18
10
|
//# sourceMappingURL=usePeerStatus.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePeerStatus.d.ts","sourceRoot":"","sources":["../../src/hooks/usePeerStatus.ts"],"names":[],"mappings":"AAKA
|
|
1
|
+
{"version":3,"file":"usePeerStatus.d.ts","sourceRoot":"","sources":["../../src/hooks/usePeerStatus.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,eAAO,MAAM,aAAa;;CAOzB,CAAC"}
|
|
@@ -4,6 +4,7 @@ import { useFishjamEventState } from './internal/useFishjamEventState';
|
|
|
4
4
|
* This hook provides live updates of current connection state of the local peer to a room (websocket state)
|
|
5
5
|
* @returns Current peer status.
|
|
6
6
|
* @deprecated
|
|
7
|
+
* @ignore
|
|
7
8
|
*/
|
|
8
9
|
export const usePeerStatus = () => {
|
|
9
10
|
const peerStatus = useFishjamEventState(ReceivableEvents.PeerStatusChanged, RNFishjamClientModule.peerStatus);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePeerStatus.js","sourceRoot":"","sources":["../../src/hooks/usePeerStatus.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,EAAE,EAC5B,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"usePeerStatus.js","sourceRoot":"","sources":["../../src/hooks/usePeerStatus.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,EAAE,EAC5B,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEvE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE;IAChC,MAAM,UAAU,GAAG,oBAAoB,CACrC,gBAAgB,CAAC,iBAAiB,EAClC,qBAAqB,CAAC,UAAU,CACjC,CAAC;IAEF,OAAO,EAAE,UAAU,EAAE,CAAC;AACxB,CAAC,CAAC","sourcesContent":["import RNFishjamClientModule, {\n ReceivableEvents,\n} from '../RNFishjamClientModule';\nimport { useFishjamEventState } from './internal/useFishjamEventState';\n\n/**\n * This hook provides live updates of current connection state of the local peer to a room (websocket state)\n * @returns Current peer status.\n * @deprecated\n * @ignore\n */\nexport const usePeerStatus = () => {\n const peerStatus = useFishjamEventState(\n ReceivableEvents.PeerStatusChanged,\n RNFishjamClientModule.peerStatus,\n );\n\n return { peerStatus };\n};\n"]}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { Brand, GenericMetadata,
|
|
1
|
+
import { Brand, GenericMetadata, TrackMetadata } from '../types';
|
|
2
2
|
export type PeerId = Brand<string, 'PeerId'>;
|
|
3
3
|
export type TrackId = Brand<string, 'TrackId'>;
|
|
4
4
|
export type TrackType = 'Audio' | 'Video';
|
|
5
5
|
/**
|
|
6
6
|
* Type describing Voice Activity Detection statuses.
|
|
7
7
|
*
|
|
8
|
-
* speech
|
|
9
|
-
* silence - lack of voice activity has been detected
|
|
8
|
+
* - `speech` voice activity has been detected
|
|
9
|
+
* - `silence` - lack of voice activity has been detected
|
|
10
10
|
*/
|
|
11
11
|
export type VadStatus = 'silence' | 'speech';
|
|
12
12
|
export type PeerTrackMetadata<PeerMetadata, ServerMetadata> = {
|
|
13
13
|
peer: PeerMetadata;
|
|
14
14
|
server: ServerMetadata;
|
|
15
15
|
};
|
|
16
|
-
type TrackBase = {
|
|
16
|
+
export type TrackBase = {
|
|
17
17
|
id: TrackId;
|
|
18
18
|
type: TrackType;
|
|
19
19
|
isActive: boolean;
|
|
@@ -25,8 +25,6 @@ export type AudioTrack = TrackBase & {
|
|
|
25
25
|
};
|
|
26
26
|
export type VideoTrack = TrackBase & {
|
|
27
27
|
type: 'Video';
|
|
28
|
-
encoding: TrackEncoding | null;
|
|
29
|
-
encodingReason: EncodingReason | null;
|
|
30
28
|
};
|
|
31
29
|
export type Track = VideoTrack | AudioTrack;
|
|
32
30
|
/**
|
|
@@ -68,33 +66,32 @@ export type Peer<PeerMetadata extends GenericMetadata = GenericMetadata, ServerM
|
|
|
68
66
|
* @template ServerMetadata - Type for server-specific metadata
|
|
69
67
|
*/
|
|
70
68
|
export type UsePeersResult<PeerMetadata extends GenericMetadata = GenericMetadata, ServerMetadata extends GenericMetadata = GenericMetadata> = {
|
|
69
|
+
localPeer: PeerWithTracks<PeerMetadata, ServerMetadata> | null;
|
|
70
|
+
remotePeers: PeerWithTracks<PeerMetadata, ServerMetadata>[];
|
|
71
|
+
peers: Peer<PeerMetadata, ServerMetadata>[];
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Hook that provides live updates of room peers.
|
|
75
|
+
* @template PeerMetadata - Type for peer-specific metadata
|
|
76
|
+
* @template ServerMetadata - Type for server-specific metadata
|
|
77
|
+
* @category Connection
|
|
78
|
+
* @group Hooks
|
|
79
|
+
*/
|
|
80
|
+
export declare function usePeers<PeerMetadata extends GenericMetadata = GenericMetadata, ServerMetadata extends GenericMetadata = GenericMetadata>(): {
|
|
71
81
|
/**
|
|
72
82
|
* The local peer with distinguished tracks (camera, microphone, screen share).
|
|
73
83
|
* Will be null if the local peer is not found.
|
|
74
84
|
*/
|
|
75
|
-
localPeer: PeerWithTracks<
|
|
85
|
+
localPeer: PeerWithTracks<GenericMetadata, GenericMetadata> | null;
|
|
76
86
|
/**
|
|
77
87
|
* Array of remote peers with distinguished tracks (camera, microphone, screen share).
|
|
78
88
|
*/
|
|
79
|
-
remotePeers: PeerWithTracks<
|
|
89
|
+
remotePeers: PeerWithTracks<GenericMetadata, GenericMetadata>[];
|
|
80
90
|
/**
|
|
81
91
|
* @deprecated Use localPeer and remotePeers instead
|
|
82
92
|
* Legacy array containing all peers (both local and remote) without distinguished tracks.
|
|
83
93
|
* This property will be removed in future versions.
|
|
84
94
|
*/
|
|
85
|
-
peers: Peer<
|
|
95
|
+
peers: Peer<GenericMetadata, GenericMetadata>[];
|
|
86
96
|
};
|
|
87
|
-
/**
|
|
88
|
-
* Hook that provides live updates of room peers.
|
|
89
|
-
* @template PeerMetadata - Type for peer-specific metadata
|
|
90
|
-
* @template ServerMetadata - Type for server-specific metadata
|
|
91
|
-
* @returns {UsePeersResult<PeerMetadata, ServerMetadata>} Object containing:
|
|
92
|
-
* - localPeer: The local peer with distinguished tracks (camera, microphone, screen share)
|
|
93
|
-
* - remotePeers: Array of remote peers with distinguished tracks
|
|
94
|
-
* - peers: Deprecated array of all peers without distinguished tracks
|
|
95
|
-
* @category Connection
|
|
96
|
-
* @group Hooks
|
|
97
|
-
*/
|
|
98
|
-
export declare function usePeers<PeerMetadata extends GenericMetadata = GenericMetadata, ServerMetadata extends GenericMetadata = GenericMetadata>(): UsePeersResult<PeerMetadata, ServerMetadata>;
|
|
99
|
-
export {};
|
|
100
97
|
//# sourceMappingURL=usePeers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePeers.d.ts","sourceRoot":"","sources":["../../src/hooks/usePeers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"usePeers.d.ts","sourceRoot":"","sources":["../../src/hooks/usePeers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAMjE,MAAM,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AAC7C,MAAM,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAE/C,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE7C,MAAM,MAAM,iBAAiB,CAAC,YAAY,EAAE,cAAc,IAAI;IAC5D,IAAI,EAAE,YAAY,CAAC;IACnB,MAAM,EAAE,cAAc,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,EAAE,EAAE,OAAO,CAAC;IACZ,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,aAAa,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG;IACnC,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,SAAS,GAAG,SAAS,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG;IACnC,IAAI,EAAE,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,eAAe,GAAG,eAAe,EACtD,cAAc,SAAS,eAAe,GAAG,eAAe;IAoBtD;;;OAGG;;IAEH;;OAEG;;IAEH;;;;OAIG;;EAGN"}
|
package/build/hooks/usePeers.js
CHANGED
|
@@ -39,10 +39,6 @@ function getPeerWithDistinguishedTracks(peer) {
|
|
|
39
39
|
* Hook that provides live updates of room peers.
|
|
40
40
|
* @template PeerMetadata - Type for peer-specific metadata
|
|
41
41
|
* @template ServerMetadata - Type for server-specific metadata
|
|
42
|
-
* @returns {UsePeersResult<PeerMetadata, ServerMetadata>} Object containing:
|
|
43
|
-
* - localPeer: The local peer with distinguished tracks (camera, microphone, screen share)
|
|
44
|
-
* - remotePeers: Array of remote peers with distinguished tracks
|
|
45
|
-
* - peers: Deprecated array of all peers without distinguished tracks
|
|
46
42
|
* @category Connection
|
|
47
43
|
* @group Hooks
|
|
48
44
|
*/
|
|
@@ -53,6 +49,22 @@ export function usePeers() {
|
|
|
53
49
|
return localPeerData ? getPeerWithDistinguishedTracks(localPeerData) : null;
|
|
54
50
|
}, [peers]);
|
|
55
51
|
const remotePeers = useMemo(() => peers.filter((peer) => !peer.isLocal).map(getPeerWithDistinguishedTracks), [peers]);
|
|
56
|
-
return {
|
|
52
|
+
return {
|
|
53
|
+
/**
|
|
54
|
+
* The local peer with distinguished tracks (camera, microphone, screen share).
|
|
55
|
+
* Will be null if the local peer is not found.
|
|
56
|
+
*/
|
|
57
|
+
localPeer,
|
|
58
|
+
/**
|
|
59
|
+
* Array of remote peers with distinguished tracks (camera, microphone, screen share).
|
|
60
|
+
*/
|
|
61
|
+
remotePeers,
|
|
62
|
+
/**
|
|
63
|
+
* @deprecated Use localPeer and remotePeers instead
|
|
64
|
+
* Legacy array containing all peers (both local and remote) without distinguished tracks.
|
|
65
|
+
* This property will be removed in future versions.
|
|
66
|
+
*/
|
|
67
|
+
peers,
|
|
68
|
+
};
|
|
57
69
|
}
|
|
58
70
|
//# sourceMappingURL=usePeers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePeers.js","sourceRoot":"","sources":["../../src/hooks/usePeers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAGhC,OAAO,qBAAqB,EAAE,EAC5B,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"usePeers.js","sourceRoot":"","sources":["../../src/hooks/usePeers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAGhC,OAAO,qBAAqB,EAAE,EAC5B,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAgFvE,SAAS,mBAAmB,CAI1B,KAAwD;IAExD,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC1B,GAAG,IAAI;QACP,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YAClC,GAAG,KAAK;YACR,QAAQ,EACL,KAAsC,EAAE,QAAQ,EAAE,MAAM,IAAI,IAAI;SACpE,CAAC,CAAC;KACJ,CAAC,CAAC,CAAC;AACN,CAAC;AAED,SAAS,8BAA8B,CAIrC,IAAwC;IAExC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;IAEpC,MAAM,mBAAmB,GAAwB,EAAE,CAAC;IAEpD,KAAK,MAAM,KAAK,IAAI,UAAU,EAAE,CAAC;QAC/B,MAAM,SAAS,GAAG,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC;QAEvC,QAAQ,SAAS,EAAE,CAAC;YAClB,KAAK,QAAQ;gBACX,mBAAmB,CAAC,WAAW,GAAG,KAAmB,CAAC;gBACtD,MAAM;YACR,KAAK,YAAY;gBACf,mBAAmB,CAAC,eAAe,GAAG,KAAmB,CAAC;gBAC1D,MAAM;YACR,KAAK,kBAAkB;gBACrB,mBAAmB,CAAC,qBAAqB,GAAG,KAAmB,CAAC;gBAChE,MAAM;YACR,KAAK,kBAAkB;gBACrB,mBAAmB,CAAC,qBAAqB,GAAG,KAAmB,CAAC;gBAChE,MAAM;QACV,CAAC;IACH,CAAC;IAED,OAAO;QACL,GAAG,IAAI;QACP,GAAG,mBAAmB;KACvB,CAAC;AACJ,CAAC;AAkBD;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ;IAItB,MAAM,KAAK,GAAG,oBAAoB,CAChC,gBAAgB,CAAC,WAAW,EAC5B,qBAAqB,CAAC,QAAQ,EAAgC,EAC9D,CAAC,kBAAkB,EAAE,EAAE,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,CAChE,CAAC;IAEF,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,EAAE;QAC7B,MAAM,aAAa,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzD,OAAO,aAAa,CAAC,CAAC,CAAC,8BAA8B,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC9E,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,MAAM,WAAW,GAAG,OAAO,CACzB,GAAG,EAAE,CACH,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,8BAA8B,CAAC,EAC3E,CAAC,KAAK,CAAC,CACR,CAAC;IAEF,OAAO;QACL;;;WAGG;QACH,SAAS;QACT;;WAEG;QACH,WAAW;QACX;;;;WAIG;QACH,KAAK;KACN,CAAC;AACJ,CAAC","sourcesContent":["import { useMemo } from 'react';\n\nimport { Brand, GenericMetadata, TrackMetadata } from '../types';\nimport RNFishjamClientModule, {\n ReceivableEvents,\n} from '../RNFishjamClientModule';\nimport { useFishjamEventState } from './internal/useFishjamEventState';\n\nexport type PeerId = Brand<string, 'PeerId'>;\nexport type TrackId = Brand<string, 'TrackId'>;\n\nexport type TrackType = 'Audio' | 'Video';\n\n/**\n * Type describing Voice Activity Detection statuses.\n *\n * - `speech` voice activity has been detected\n * - `silence` - lack of voice activity has been detected\n */\nexport type VadStatus = 'silence' | 'speech';\n\nexport type PeerTrackMetadata<PeerMetadata, ServerMetadata> = {\n peer: PeerMetadata;\n server: ServerMetadata;\n};\n\nexport type TrackBase = {\n id: TrackId;\n type: TrackType;\n isActive: boolean;\n metadata?: TrackMetadata;\n};\n\nexport type AudioTrack = TrackBase & {\n type: 'Audio';\n vadStatus: VadStatus | undefined;\n};\n\nexport type VideoTrack = TrackBase & {\n type: 'Video';\n};\n\nexport type Track = VideoTrack | AudioTrack;\n/**\n * Type describing possible reasons of currently selected encoding.\n *\n * - other - the exact reason couldn't be determined\n * - encoding_inactive - previously selected encoding became inactive\n * - low_bandwidth - there is no longer enough bandwidth to maintain previously selected encoding\n */\nexport type EncodingReason = 'other' | 'encoding_inactive' | 'low_bandwidth';\n\nexport type DistinguishedTracks = {\n cameraTrack?: VideoTrack;\n microphoneTrack?: AudioTrack;\n screenShareVideoTrack?: VideoTrack;\n screenShareAudioTrack?: AudioTrack;\n};\n\nexport type PeerWithTracks<\n PeerMetadata extends GenericMetadata = GenericMetadata,\n ServerMetadata extends GenericMetadata = GenericMetadata,\n> = Peer<PeerMetadata, ServerMetadata> & DistinguishedTracks;\n\nexport type Peer<\n PeerMetadata extends GenericMetadata = GenericMetadata,\n ServerMetadata extends GenericMetadata = GenericMetadata,\n> = {\n /**\n * id used to identify a peer\n */\n id: PeerId;\n /**\n * whether the peer is local or remote\n */\n isLocal: boolean;\n /**\n * a type containing peer and server metadata\n */\n metadata: PeerTrackMetadata<PeerMetadata, ServerMetadata>;\n /**\n * a list of peer's video and audio tracks\n */\n tracks: Track[];\n};\n\nfunction addIsActiveToTracks<\n PeerMetadata extends GenericMetadata = GenericMetadata,\n ServerMetadata extends GenericMetadata = GenericMetadata,\n>(\n peers: ReadonlyArray<Peer<PeerMetadata, ServerMetadata>>,\n): Peer<PeerMetadata, ServerMetadata>[] {\n return peers.map((peer) => ({\n ...peer,\n tracks: peer.tracks.map((track) => ({\n ...track,\n isActive:\n (track as { metadata?: TrackMetadata })?.metadata?.active ?? true,\n })),\n }));\n}\n\nfunction getPeerWithDistinguishedTracks<\n PeerMetadata extends GenericMetadata = GenericMetadata,\n ServerMetadata extends GenericMetadata = GenericMetadata,\n>(\n peer: Peer<PeerMetadata, ServerMetadata>,\n): PeerWithTracks<PeerMetadata, ServerMetadata> {\n const { tracks: peerTracks } = peer;\n\n const distinguishedTracks: DistinguishedTracks = {};\n\n for (const track of peerTracks) {\n const trackType = track.metadata?.type;\n\n switch (trackType) {\n case 'camera':\n distinguishedTracks.cameraTrack = track as VideoTrack;\n break;\n case 'microphone':\n distinguishedTracks.microphoneTrack = track as AudioTrack;\n break;\n case 'screenShareVideo':\n distinguishedTracks.screenShareVideoTrack = track as VideoTrack;\n break;\n case 'screenShareAudio':\n distinguishedTracks.screenShareAudioTrack = track as AudioTrack;\n break;\n }\n }\n\n return {\n ...peer,\n ...distinguishedTracks,\n };\n}\n\n/**\n * Result type for the usePeers hook.\n * @template PeerMetadata - Type for peer-specific metadata\n * @template ServerMetadata - Type for server-specific metadata\n */\nexport type UsePeersResult<\n PeerMetadata extends GenericMetadata = GenericMetadata,\n ServerMetadata extends GenericMetadata = GenericMetadata,\n> = {\n localPeer: PeerWithTracks<PeerMetadata, ServerMetadata> | null;\n\n remotePeers: PeerWithTracks<PeerMetadata, ServerMetadata>[];\n\n peers: Peer<PeerMetadata, ServerMetadata>[];\n};\n\n/**\n * Hook that provides live updates of room peers.\n * @template PeerMetadata - Type for peer-specific metadata\n * @template ServerMetadata - Type for server-specific metadata\n * @category Connection\n * @group Hooks\n */\nexport function usePeers<\n PeerMetadata extends GenericMetadata = GenericMetadata,\n ServerMetadata extends GenericMetadata = GenericMetadata,\n>() {\n const peers = useFishjamEventState(\n ReceivableEvents.PeersUpdate,\n RNFishjamClientModule.getPeers<PeerMetadata, ServerMetadata>(),\n (peersWithoutActive) => addIsActiveToTracks(peersWithoutActive),\n );\n\n const localPeer = useMemo(() => {\n const localPeerData = peers.find((peer) => peer.isLocal);\n return localPeerData ? getPeerWithDistinguishedTracks(localPeerData) : null;\n }, [peers]);\n\n const remotePeers = useMemo(\n () =>\n peers.filter((peer) => !peer.isLocal).map(getPeerWithDistinguishedTracks),\n [peers],\n );\n\n return {\n /**\n * The local peer with distinguished tracks (camera, microphone, screen share).\n * Will be null if the local peer is not found.\n */\n localPeer,\n /**\n * Array of remote peers with distinguished tracks (camera, microphone, screen share).\n */\n remotePeers,\n /**\n * @deprecated Use localPeer and remotePeers instead\n * Legacy array containing all peers (both local and remote) without distinguished tracks.\n * This property will be removed in future versions.\n */\n peers,\n };\n}\n"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export type ReconnectionStatus = 'idle' | 'reconnecting' | 'error';
|
|
2
1
|
/**
|
|
3
2
|
* Information about reconnection status.
|
|
4
3
|
* Could be used to retrieve connection status, once user will be disconnected
|
|
5
4
|
* @group Hooks
|
|
6
5
|
* @deprecated
|
|
6
|
+
* @ignore
|
|
7
7
|
*/
|
|
8
8
|
export declare function useReconnection(): {
|
|
9
|
-
reconnectionStatus: ReconnectionStatus;
|
|
9
|
+
reconnectionStatus: import("./useConnection").ReconnectionStatus;
|
|
10
10
|
};
|
|
11
11
|
//# sourceMappingURL=useReconnection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useReconnection.d.ts","sourceRoot":"","sources":["../../src/hooks/useReconnection.ts"],"names":[],"mappings":"AAKA
|
|
1
|
+
{"version":3,"file":"useReconnection.d.ts","sourceRoot":"","sources":["../../src/hooks/useReconnection.ts"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,wBAAgB,eAAe;;EAO9B"}
|
|
@@ -5,6 +5,7 @@ import { useFishjamEventState } from './internal/useFishjamEventState';
|
|
|
5
5
|
* Could be used to retrieve connection status, once user will be disconnected
|
|
6
6
|
* @group Hooks
|
|
7
7
|
* @deprecated
|
|
8
|
+
* @ignore
|
|
8
9
|
*/
|
|
9
10
|
export function useReconnection() {
|
|
10
11
|
const reconnectionStatus = useFishjamEventState(ReceivableEvents.ReconnectionStatusChanged, RNFishjamClientModule.reconnectionStatus);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useReconnection.js","sourceRoot":"","sources":["../../src/hooks/useReconnection.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,EAAE,EAC5B,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"useReconnection.js","sourceRoot":"","sources":["../../src/hooks/useReconnection.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,EAAE,EAC5B,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEvE;;;;;;GAMG;AACH,MAAM,UAAU,eAAe;IAC7B,MAAM,kBAAkB,GAAG,oBAAoB,CAC7C,gBAAgB,CAAC,yBAAyB,EAC1C,qBAAqB,CAAC,kBAAkB,CACzC,CAAC;IAEF,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAChC,CAAC","sourcesContent":["import RNFishjamClientModule, {\n ReceivableEvents,\n} from '../RNFishjamClientModule';\nimport { useFishjamEventState } from './internal/useFishjamEventState';\n\n/**\n * Information about reconnection status.\n * Could be used to retrieve connection status, once user will be disconnected\n * @group Hooks\n * @deprecated\n * @ignore\n */\nexport function useReconnection() {\n const reconnectionStatus = useFishjamEventState(\n ReceivableEvents.ReconnectionStatusChanged,\n RNFishjamClientModule.reconnectionStatus,\n );\n\n return { reconnectionStatus };\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SimulcastConfig, TrackMetadata } from '../types';
|
|
2
2
|
export type ScreenShareQuality = 'VGA' | 'HD5' | 'HD15' | 'FHD15' | 'FHD30';
|
|
3
3
|
export type ScreenShareOptions = {
|
|
4
4
|
/**
|
|
@@ -8,10 +8,6 @@ export type ScreenShareOptions = {
|
|
|
8
8
|
* @default `HD15``
|
|
9
9
|
*/
|
|
10
10
|
quality: ScreenShareQuality;
|
|
11
|
-
/**
|
|
12
|
-
* bandwidth limit of a screen share track. By default there is no bandwidth limit.
|
|
13
|
-
*/
|
|
14
|
-
maxBandwidth: TrackBandwidthLimit;
|
|
15
11
|
};
|
|
16
12
|
export type ScreenShareOptionsInternal = {
|
|
17
13
|
screenShareMetadata: TrackMetadata & {
|
|
@@ -25,7 +21,7 @@ export type ScreenShareOptionsInternal = {
|
|
|
25
21
|
/**
|
|
26
22
|
* This hook can toggle screen sharing on/off and provides current screen share state.
|
|
27
23
|
* @returns An object with functions to manage screen share.
|
|
28
|
-
* @category
|
|
24
|
+
* @category Connection
|
|
29
25
|
* @group Hooks
|
|
30
26
|
*/
|
|
31
27
|
export declare function useScreenShare(): {
|
|
@@ -37,22 +33,5 @@ export declare function useScreenShare(): {
|
|
|
37
33
|
*/
|
|
38
34
|
toggleScreenShare: (screenShareOptions?: Partial<ScreenShareOptions>) => Promise<void>;
|
|
39
35
|
handleScreenSharePermission: () => Promise<"granted" | "denied">;
|
|
40
|
-
/**
|
|
41
|
-
* @deprecated
|
|
42
|
-
*/
|
|
43
|
-
setScreenShareTrackBandwidth: (bandwidth: BandwidthLimit) => Promise<void>;
|
|
44
|
-
/**
|
|
45
|
-
* Toggles simulcast encoding of a screen share track on/off
|
|
46
|
-
* @param encoding encoding to toggle
|
|
47
|
-
* @deprecated
|
|
48
|
-
*/
|
|
49
|
-
toggleScreenShareTrackEncoding: (encoding: TrackEncoding) => Promise<void>;
|
|
50
|
-
/**
|
|
51
|
-
* updates maximum bandwidth for the given simulcast encoding of the screen share track
|
|
52
|
-
* @param encoding encoding to update
|
|
53
|
-
* @param bandwidth BandwidthLimit to set
|
|
54
|
-
* @deprecated
|
|
55
|
-
*/
|
|
56
|
-
setScreenShareTrackEncodingBandwidth: (encoding: TrackEncoding, bandwidth: BandwidthLimit) => Promise<void>;
|
|
57
36
|
};
|
|
58
37
|
//# sourceMappingURL=useScreenShare.d.ts.map
|