@fishjam-cloud/react-native-client 0.2.1 → 0.2.3

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.
Files changed (105) hide show
  1. package/android/build.gradle +1 -1
  2. package/android/src/main/AndroidManifest.xml +2 -0
  3. package/android/src/main/java/io/fishjam/reactnative/AudioDeviceKind.kt +34 -0
  4. package/android/src/main/java/io/fishjam/reactnative/AudioSwitchManager.kt +61 -0
  5. package/android/src/main/java/io/fishjam/reactnative/EmitableEvents.kt +15 -0
  6. package/android/src/main/java/io/fishjam/reactnative/Errors.kt +31 -0
  7. package/android/src/main/java/io/fishjam/reactnative/FishjamForegroundService.kt +90 -0
  8. package/android/src/main/java/io/fishjam/reactnative/RNFishjamClient.kt +883 -0
  9. package/android/src/main/java/io/fishjam/reactnative/RNFishjamClientModule.kt +371 -0
  10. package/android/src/main/java/io/fishjam/reactnative/Utils.kt +11 -0
  11. package/android/src/main/java/io/fishjam/reactnative/VideoPreviewView.kt +40 -0
  12. package/android/src/main/java/io/fishjam/reactnative/VideoPreviewViewModule.kt +17 -0
  13. package/android/src/main/java/io/fishjam/reactnative/VideoRendererView.kt +58 -0
  14. package/android/src/main/java/io/fishjam/reactnative/VideoRendererViewModule.kt +25 -0
  15. package/android/src/main/java/io/fishjam/reactnative/VideoView.kt +77 -0
  16. package/build/RNFishjamClientModule.d.ts +2 -0
  17. package/build/RNFishjamClientModule.d.ts.map +1 -1
  18. package/build/RNFishjamClientModule.js +2 -1
  19. package/build/RNFishjamClientModule.js.map +1 -1
  20. package/build/common/client.d.ts +4 -1
  21. package/build/common/client.d.ts.map +1 -1
  22. package/build/common/client.js +4 -1
  23. package/build/common/client.js.map +1 -1
  24. package/build/common/metadata.d.ts +1 -0
  25. package/build/common/metadata.d.ts.map +1 -1
  26. package/build/common/metadata.js +1 -0
  27. package/build/common/metadata.js.map +1 -1
  28. package/build/common/webRTC.d.ts +2 -0
  29. package/build/common/webRTC.d.ts.map +1 -1
  30. package/build/common/webRTC.js +2 -0
  31. package/build/common/webRTC.js.map +1 -1
  32. package/build/components/VideoPreviewView.d.ts +6 -3
  33. package/build/components/VideoPreviewView.d.ts.map +1 -1
  34. package/build/components/VideoPreviewView.js +5 -0
  35. package/build/components/VideoPreviewView.js.map +1 -1
  36. package/build/components/VideoRendererView.d.ts +5 -3
  37. package/build/components/VideoRendererView.d.ts.map +1 -1
  38. package/build/components/VideoRendererView.js +4 -0
  39. package/build/components/VideoRendererView.js.map +1 -1
  40. package/build/hooks/useAudioSettings.d.ts +15 -0
  41. package/build/hooks/useAudioSettings.d.ts.map +1 -1
  42. package/build/hooks/useAudioSettings.js +15 -13
  43. package/build/hooks/useAudioSettings.js.map +1 -1
  44. package/build/hooks/useBandwidthEstimation.d.ts +2 -0
  45. package/build/hooks/useBandwidthEstimation.d.ts.map +1 -1
  46. package/build/hooks/useBandwidthEstimation.js +2 -0
  47. package/build/hooks/useBandwidthEstimation.js.map +1 -1
  48. package/build/hooks/useCamera.d.ts +45 -1
  49. package/build/hooks/useCamera.d.ts.map +1 -1
  50. package/build/hooks/useCamera.js +45 -37
  51. package/build/hooks/useCamera.js.map +1 -1
  52. package/build/hooks/useFishjamEvent.d.ts +1 -0
  53. package/build/hooks/useFishjamEvent.d.ts.map +1 -1
  54. package/build/hooks/useFishjamEvent.js +3 -4
  55. package/build/hooks/useFishjamEvent.js.map +1 -1
  56. package/build/hooks/useMicrophone.d.ts +4 -0
  57. package/build/hooks/useMicrophone.d.ts.map +1 -1
  58. package/build/hooks/useMicrophone.js +8 -4
  59. package/build/hooks/useMicrophone.js.map +1 -1
  60. package/build/hooks/useParticipants.d.ts +2 -0
  61. package/build/hooks/useParticipants.d.ts.map +1 -1
  62. package/build/hooks/useParticipants.js +2 -0
  63. package/build/hooks/useParticipants.js.map +1 -1
  64. package/build/hooks/useReconnection.d.ts +6 -0
  65. package/build/hooks/useReconnection.d.ts.map +1 -1
  66. package/build/hooks/useReconnection.js +6 -0
  67. package/build/hooks/useReconnection.js.map +1 -1
  68. package/build/hooks/useScreencast.d.ts +22 -3
  69. package/build/hooks/useScreencast.d.ts.map +1 -1
  70. package/build/hooks/useScreencast.js +30 -22
  71. package/build/hooks/useScreencast.js.map +1 -1
  72. package/build/index.d.ts +1 -1
  73. package/build/index.d.ts.map +1 -1
  74. package/build/index.js +2 -0
  75. package/build/index.js.map +1 -1
  76. package/build/stats/useRTCStatistics.d.ts +1 -0
  77. package/build/stats/useRTCStatistics.d.ts.map +1 -1
  78. package/build/stats/useRTCStatistics.js +1 -0
  79. package/build/stats/useRTCStatistics.js.map +1 -1
  80. package/build/types.d.ts +6 -0
  81. package/build/types.d.ts.map +1 -1
  82. package/build/types.js.map +1 -1
  83. package/build/utils/errorListener.d.ts +2 -0
  84. package/build/utils/errorListener.d.ts.map +1 -0
  85. package/build/utils/errorListener.js +16 -0
  86. package/build/utils/errorListener.js.map +1 -0
  87. package/build/utils/foregroundService.d.ts +2 -0
  88. package/build/utils/foregroundService.d.ts.map +1 -1
  89. package/build/utils/foregroundService.js +2 -0
  90. package/build/utils/foregroundService.js.map +1 -1
  91. package/ios/Events.swift +1 -0
  92. package/ios/RNFishjamClient.podspec +1 -1
  93. package/ios/RNFishjamClient.swift +14 -0
  94. package/package.json +7 -6
  95. package/plugin/broadcastExtensionFiles/FishjamBroadcastSampleHandler.swift +50 -0
  96. package/plugin/broadcastExtensionFiles/FishjamScreenBroadcastExtension.entitlements +10 -0
  97. package/plugin/broadcastExtensionFiles/Info.plist +27 -0
  98. package/plugin/build/types.d.ts +9 -0
  99. package/plugin/build/types.js +2 -0
  100. package/plugin/build/withFishjam.d.ts +4 -0
  101. package/plugin/build/withFishjam.js +13 -0
  102. package/plugin/build/withFishjamAndroid.d.ts +3 -0
  103. package/plugin/build/withFishjamAndroid.js +32 -0
  104. package/plugin/build/withFishjamIos.d.ts +9 -0
  105. package/plugin/build/withFishjamIos.js +222 -0
@@ -1,14 +1,17 @@
1
1
  import RNFishjamClientModule from '../RNFishjamClientModule';
2
2
  /**
3
- *
4
3
  * @param url fishjam Url
5
4
  * @param participantToken
6
5
  * @param participantMetadata
7
6
  * @param config
7
+ * @category Connection
8
8
  */
9
9
  export async function joinRoom(url, participantToken, participantMetadata, config = {}) {
10
10
  await RNFishjamClientModule.joinRoom(url, participantToken, participantMetadata, config);
11
11
  }
12
+ /**
13
+ * @category Connection
14
+ */
12
15
  export async function leaveRoom() {
13
16
  await RNFishjamClientModule.leaveRoom();
14
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/common/client.ts"],"names":[],"mappings":"AACA,OAAO,qBAAqB,MAAM,0BAA0B,CAAC;AAkB7D;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAG5B,GAAW,EACX,gBAAwB,EACxB,mBAAwC,EACxC,SAA2B,EAAE;IAE7B,MAAM,qBAAqB,CAAC,QAAQ,CAClC,GAAG,EACH,gBAAgB,EAChB,mBAAmB,EACnB,MAAM,CACP,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS;IAC7B,MAAM,qBAAqB,CAAC,SAAS,EAAE,CAAC;AAC1C,CAAC","sourcesContent":["import { GenericMetadata } from '../types';\nimport RNFishjamClientModule from '../RNFishjamClientModule';\n\nexport type ConnectionConfig = {\n /**\n * Configuration for automatic reconnection\n * sdk uses a linear backoff algorithm, that is the formula\n * for the delay of the nth attempt is\n * n * delayMs + initialDelayMs\n *\n * Pass 0 for maxAttempts to disable automatic reconnection\n */\n reconnectConfig?: {\n maxAttempts?: number;\n initialDelayMs?: number;\n delayMs?: number;\n };\n};\n\n/**\n *\n * @param url fishjam Url\n * @param participantToken\n * @param participantMetadata\n * @param config\n */\nexport async function joinRoom<\n ParticipantMetadata extends GenericMetadata = GenericMetadata,\n>(\n url: string,\n participantToken: string,\n participantMetadata: ParticipantMetadata,\n config: ConnectionConfig = {},\n) {\n await RNFishjamClientModule.joinRoom(\n url,\n participantToken,\n participantMetadata,\n config,\n );\n}\n\nexport async function leaveRoom() {\n await RNFishjamClientModule.leaveRoom();\n}\n"]}
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/common/client.ts"],"names":[],"mappings":"AACA,OAAO,qBAAqB,MAAM,0BAA0B,CAAC;AAkB7D;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAG5B,GAAW,EACX,gBAAwB,EACxB,mBAAwC,EACxC,SAA2B,EAAE;IAE7B,MAAM,qBAAqB,CAAC,QAAQ,CAClC,GAAG,EACH,gBAAgB,EAChB,mBAAmB,EACnB,MAAM,CACP,CAAC;AACJ,CAAC;AACD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS;IAC7B,MAAM,qBAAqB,CAAC,SAAS,EAAE,CAAC;AAC1C,CAAC","sourcesContent":["import { GenericMetadata } from '../types';\nimport RNFishjamClientModule from '../RNFishjamClientModule';\n\nexport type ConnectionConfig = {\n /**\n * Configuration for automatic reconnection\n * sdk uses a linear backoff algorithm, that is the formula\n * for the delay of the nth attempt is\n * n * delayMs + initialDelayMs\n *\n * Pass 0 for maxAttempts to disable automatic reconnection\n */\n reconnectConfig?: {\n maxAttempts?: number;\n initialDelayMs?: number;\n delayMs?: number;\n };\n};\n\n/**\n * @param url fishjam Url\n * @param participantToken\n * @param participantMetadata\n * @param config\n * @category Connection\n */\nexport async function joinRoom<\n ParticipantMetadata extends GenericMetadata = GenericMetadata,\n>(\n url: string,\n participantToken: string,\n participantMetadata: ParticipantMetadata,\n config: ConnectionConfig = {},\n) {\n await RNFishjamClientModule.joinRoom(\n url,\n participantToken,\n participantMetadata,\n config,\n );\n}\n/**\n * @category Connection\n */\nexport async function leaveRoom() {\n await RNFishjamClientModule.leaveRoom();\n}\n"]}
@@ -2,6 +2,7 @@ import { GenericMetadata } from '../types';
2
2
  /**
3
3
  * a function that updates endpoints's metadata on the server
4
4
  * @param metadata a map indexed by strings, containing participants metadata to be sent to the server
5
+ * @category Connection
5
6
  */
6
7
  export declare function updatePeerMetadata<ParticipantMetadata extends GenericMetadata = GenericMetadata>(metadata: ParticipantMetadata): Promise<void>;
7
8
  //# sourceMappingURL=metadata.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../src/common/metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAG3C;;;GAGG;AACH,wBAAsB,kBAAkB,CACtC,mBAAmB,SAAS,eAAe,GAAG,eAAe,EAC7D,QAAQ,EAAE,mBAAmB,iBAE9B"}
1
+ {"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../src/common/metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAG3C;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,mBAAmB,SAAS,eAAe,GAAG,eAAe,EAC7D,QAAQ,EAAE,mBAAmB,iBAE9B"}
@@ -2,6 +2,7 @@ import RNFishjamClientModule from '../RNFishjamClientModule';
2
2
  /**
3
3
  * a function that updates endpoints's metadata on the server
4
4
  * @param metadata a map indexed by strings, containing participants metadata to be sent to the server
5
+ * @category Connection
5
6
  */
6
7
  export async function updatePeerMetadata(metadata) {
7
8
  await RNFishjamClientModule.updatePeerMetadata(metadata);
@@ -1 +1 @@
1
- {"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../src/common/metadata.ts"],"names":[],"mappings":"AACA,OAAO,qBAAqB,MAAM,0BAA0B,CAAC;AAE7D;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAEtC,QAA6B;IAC7B,MAAM,qBAAqB,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;AAC3D,CAAC","sourcesContent":["import { GenericMetadata } from '../types';\nimport RNFishjamClientModule from '../RNFishjamClientModule';\n\n/**\n * a function that updates endpoints's metadata on the server\n * @param metadata a map indexed by strings, containing participants metadata to be sent to the server\n */\nexport async function updatePeerMetadata<\n ParticipantMetadata extends GenericMetadata = GenericMetadata,\n>(metadata: ParticipantMetadata) {\n await RNFishjamClientModule.updatePeerMetadata(metadata);\n}\n"]}
1
+ {"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../src/common/metadata.ts"],"names":[],"mappings":"AACA,OAAO,qBAAqB,MAAM,0BAA0B,CAAC;AAE7D;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAEtC,QAA6B;IAC7B,MAAM,qBAAqB,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;AAC3D,CAAC","sourcesContent":["import { GenericMetadata } from '../types';\nimport RNFishjamClientModule from '../RNFishjamClientModule';\n\n/**\n * a function that updates endpoints's metadata on the server\n * @param metadata a map indexed by strings, containing participants metadata to be sent to the server\n * @category Connection\n */\nexport async function updatePeerMetadata<\n ParticipantMetadata extends GenericMetadata = GenericMetadata,\n>(metadata: ParticipantMetadata) {\n await RNFishjamClientModule.updatePeerMetadata(metadata);\n}\n"]}
@@ -8,12 +8,14 @@ export type LoggingSeverity = 'verbose' | 'info' | 'warning' | 'error' | 'none';
8
8
  *
9
9
  * @param trackId id of a track which encoding you want to select
10
10
  * @param encoding encoding to select
11
+ * @category Debugging
11
12
  */
12
13
  export declare function setTargetTrackEncoding(trackId: string, encoding: TrackEncoding): Promise<void>;
13
14
  /**
14
15
  * Function that changes level of debugging logs in WebRTC.
15
16
  * @param severity to use when displaying logs
16
17
  * @returns a promise that is resolved when debug severity is changed
18
+ * @category Debugging
17
19
  */
18
20
  export declare function changeWebRTCLoggingSeverity(severity: LoggingSeverity): Promise<void>;
19
21
  //# sourceMappingURL=webRTC.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"webRTC.d.ts","sourceRoot":"","sources":["../../src/common/webRTC.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAEhF;;;;;;;;GAQG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,aAAa,iBAGxB;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,eAAe,GACxB,OAAO,CAAC,IAAI,CAAC,CAEf"}
1
+ {"version":3,"file":"webRTC.d.ts","sourceRoot":"","sources":["../../src/common/webRTC.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAEhF;;;;;;;;;GASG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,aAAa,iBAGxB;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,eAAe,GACxB,OAAO,CAAC,IAAI,CAAC,CAEf"}
@@ -7,6 +7,7 @@ import RNFishjamClientModule from '../RNFishjamClientModule';
7
7
  *
8
8
  * @param trackId id of a track which encoding you want to select
9
9
  * @param encoding encoding to select
10
+ * @category Debugging
10
11
  */
11
12
  export async function setTargetTrackEncoding(trackId, encoding) {
12
13
  await RNFishjamClientModule.setTargetTrackEncoding(trackId, encoding);
@@ -15,6 +16,7 @@ export async function setTargetTrackEncoding(trackId, encoding) {
15
16
  * Function that changes level of debugging logs in WebRTC.
16
17
  * @param severity to use when displaying logs
17
18
  * @returns a promise that is resolved when debug severity is changed
19
+ * @category Debugging
18
20
  */
19
21
  export function changeWebRTCLoggingSeverity(severity) {
20
22
  return RNFishjamClientModule.changeWebRTCLoggingSeverity(severity);
@@ -1 +1 @@
1
- {"version":3,"file":"webRTC.js","sourceRoot":"","sources":["../../src/common/webRTC.ts"],"names":[],"mappings":"AACA,OAAO,qBAAqB,MAAM,0BAA0B,CAAC;AAI7D;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,OAAe,EACf,QAAuB;IAEvB,MAAM,qBAAqB,CAAC,sBAAsB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;AACxE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CACzC,QAAyB;IAEzB,OAAO,qBAAqB,CAAC,2BAA2B,CAAC,QAAQ,CAAC,CAAC;AACrE,CAAC","sourcesContent":["import { TrackEncoding } from '../types';\nimport RNFishjamClientModule from '../RNFishjamClientModule';\n\nexport type LoggingSeverity = 'verbose' | 'info' | 'warning' | 'error' | 'none';\n\n/**\n * sets track encoding that server should send to the client library.\n * The encoding will be sent whenever it is available. If chooses encoding is\n * temporarily unavailable, some other encoding will be sent until choose encoding\n * becomes active again.\n *\n * @param trackId id of a track which encoding you want to select\n * @param encoding encoding to select\n */\nexport async function setTargetTrackEncoding(\n trackId: string,\n encoding: TrackEncoding,\n) {\n await RNFishjamClientModule.setTargetTrackEncoding(trackId, encoding);\n}\n\n/**\n * Function that changes level of debugging logs in WebRTC.\n * @param severity to use when displaying logs\n * @returns a promise that is resolved when debug severity is changed\n */\nexport function changeWebRTCLoggingSeverity(\n severity: LoggingSeverity,\n): Promise<void> {\n return RNFishjamClientModule.changeWebRTCLoggingSeverity(severity);\n}\n"]}
1
+ {"version":3,"file":"webRTC.js","sourceRoot":"","sources":["../../src/common/webRTC.ts"],"names":[],"mappings":"AACA,OAAO,qBAAqB,MAAM,0BAA0B,CAAC;AAI7D;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,OAAe,EACf,QAAuB;IAEvB,MAAM,qBAAqB,CAAC,sBAAsB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;AACxE,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,2BAA2B,CACzC,QAAyB;IAEzB,OAAO,qBAAqB,CAAC,2BAA2B,CAAC,QAAQ,CAAC,CAAC;AACrE,CAAC","sourcesContent":["import { TrackEncoding } from '../types';\nimport RNFishjamClientModule from '../RNFishjamClientModule';\n\nexport type LoggingSeverity = 'verbose' | 'info' | 'warning' | 'error' | 'none';\n\n/**\n * sets track encoding that server should send to the client library.\n * The encoding will be sent whenever it is available. If chooses encoding is\n * temporarily unavailable, some other encoding will be sent until choose encoding\n * becomes active again.\n *\n * @param trackId id of a track which encoding you want to select\n * @param encoding encoding to select\n * @category Debugging\n */\nexport async function setTargetTrackEncoding(\n trackId: string,\n encoding: TrackEncoding,\n) {\n await RNFishjamClientModule.setTargetTrackEncoding(trackId, encoding);\n}\n\n/**\n * Function that changes level of debugging logs in WebRTC.\n * @param severity to use when displaying logs\n * @returns a promise that is resolved when debug severity is changed\n * @category Debugging\n */\nexport function changeWebRTCLoggingSeverity(\n severity: LoggingSeverity,\n): Promise<void> {\n return RNFishjamClientModule.changeWebRTCLoggingSeverity(severity);\n}\n"]}
@@ -4,9 +4,7 @@ import { VideoLayout } from '../types';
4
4
  import { CameraId } from '../hooks/useCamera';
5
5
  export type VideoPreviewViewProps = {
6
6
  /**
7
- * `FILL` or `FIT` - it works just like RN Image component. `FILL` fills the whole view
8
- * with video and it may cut some parts of the video. `FIT` scales the video so the whole
9
- * video is visible, but it may leave some empty space in the view.
7
+ * Video layout inside of the component
10
8
  * @default `FILL`
11
9
  */
12
10
  videoLayout?: VideoLayout;
@@ -17,5 +15,10 @@ export type VideoPreviewViewProps = {
17
15
  */
18
16
  cameraId?: CameraId;
19
17
  };
18
+ /**
19
+ * Render camera preview.
20
+ * Allows to display camera preview beofre streaming is started
21
+ * @category Components
22
+ */
20
23
  export declare const VideoPreviewView: React.ForwardRefExoticComponent<VideoPreviewViewProps & React.RefAttributes<React.ComponentType<VideoPreviewViewProps>>>;
21
24
  //# sourceMappingURL=VideoPreviewView.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"VideoPreviewView.d.ts","sourceRoot":"","sources":["../../src/components/VideoPreviewView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,MAAM,MAAM,qBAAqB,GAAG;IAClC;;;;;OAKG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB,CAAC;AAKF,eAAO,MAAM,gBAAgB,0HAM3B,CAAC"}
1
+ {"version":3,"file":"VideoPreviewView.d.ts","sourceRoot":"","sources":["../../src/components/VideoPreviewView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,MAAM,MAAM,qBAAqB,GAAG;IAClC;;;OAGG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB,CAAC;AAKF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,0HAM3B,CAAC"}
@@ -1,6 +1,11 @@
1
1
  import { requireNativeViewManager } from 'expo-modules-core';
2
2
  import * as React from 'react';
3
3
  const NativeView = requireNativeViewManager('VideoPreviewViewModule');
4
+ /**
5
+ * Render camera preview.
6
+ * Allows to display camera preview beofre streaming is started
7
+ * @category Components
8
+ */
4
9
  export const VideoPreviewView = React.forwardRef((props, ref) => (
5
10
  // @ts-expect-error ref prop needs to be updated
6
11
  <NativeView {...props} captureDeviceId={props.cameraId} ref={ref}/>));
@@ -1 +1 @@
1
- {"version":3,"file":"VideoPreviewView.js","sourceRoot":"","sources":["../../src/components/VideoPreviewView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAsB/B,MAAM,UAAU,GACd,wBAAwB,CAAC,wBAAwB,CAAC,CAAC;AAErD,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAC,UAAU,CAG9C,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC;AAChB,gDAAgD;AAChD,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,CAAC,eAAe,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAG,CACrE,CAAC,CAAC","sourcesContent":["import { requireNativeViewManager } from 'expo-modules-core';\nimport * as React from 'react';\nimport { ViewStyle } from 'react-native';\n\nimport { VideoLayout } from '../types';\nimport { CameraId } from '../hooks/useCamera';\n\nexport type VideoPreviewViewProps = {\n /**\n * `FILL` or `FIT` - it works just like RN Image component. `FILL` fills the whole view\n * with video and it may cut some parts of the video. `FIT` scales the video so the whole\n * video is visible, but it may leave some empty space in the view.\n * @default `FILL`\n */\n videoLayout?: VideoLayout;\n style?: ViewStyle;\n /**\n * Id of the camera used for preview. Get available cameras with `cameras` property.\n * @default the first front camera\n */\n cameraId?: CameraId;\n};\n\nconst NativeView: React.ComponentType<VideoPreviewViewProps> =\n requireNativeViewManager('VideoPreviewViewModule');\n\nexport const VideoPreviewView = React.forwardRef<\n React.ComponentType<VideoPreviewViewProps>,\n VideoPreviewViewProps\n>((props, ref) => (\n // @ts-expect-error ref prop needs to be updated\n <NativeView {...props} captureDeviceId={props.cameraId} ref={ref} />\n));\n"]}
1
+ {"version":3,"file":"VideoPreviewView.js","sourceRoot":"","sources":["../../src/components/VideoPreviewView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAoB/B,MAAM,UAAU,GACd,wBAAwB,CAAC,wBAAwB,CAAC,CAAC;AAErD;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAC,UAAU,CAG9C,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC;AAChB,gDAAgD;AAChD,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,CAAC,eAAe,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAG,CACrE,CAAC,CAAC","sourcesContent":["import { requireNativeViewManager } from 'expo-modules-core';\nimport * as React from 'react';\nimport { ViewStyle } from 'react-native';\n\nimport { VideoLayout } from '../types';\nimport { CameraId } from '../hooks/useCamera';\n\nexport type VideoPreviewViewProps = {\n /**\n * Video layout inside of the component\n * @default `FILL`\n */\n videoLayout?: VideoLayout;\n style?: ViewStyle;\n /**\n * Id of the camera used for preview. Get available cameras with `cameras` property.\n * @default the first front camera\n */\n cameraId?: CameraId;\n};\n\nconst NativeView: React.ComponentType<VideoPreviewViewProps> =\n requireNativeViewManager('VideoPreviewViewModule');\n\n/**\n * Render camera preview.\n * Allows to display camera preview beofre streaming is started\n * @category Components\n */\nexport const VideoPreviewView = React.forwardRef<\n React.ComponentType<VideoPreviewViewProps>,\n VideoPreviewViewProps\n>((props, ref) => (\n // @ts-expect-error ref prop needs to be updated\n <NativeView {...props} captureDeviceId={props.cameraId} ref={ref} />\n));\n"]}
@@ -7,13 +7,15 @@ export type VideoRendererProps = {
7
7
  */
8
8
  trackId: string;
9
9
  /**
10
- * `FILL` or `FIT` - it works just like RN Image component. `FILL` fills the whole view
11
- * with video and it may cut some parts of the video. `FIT` scales the video so the whole
12
- * video is visible, but it may leave some empty space in the view.
10
+ * Video layout inside of the component
13
11
  * @default `FILL`
14
12
  */
15
13
  videoLayout?: VideoLayout;
16
14
  style?: ViewStyle;
17
15
  };
16
+ /**
17
+ * Render video track received from {@link useParticipants} hook
18
+ * @category Components
19
+ */
18
20
  export declare const VideoRendererView: React.ForwardRefExoticComponent<VideoRendererProps & React.RefAttributes<React.ComponentType<VideoRendererProps>>>;
19
21
  //# sourceMappingURL=VideoRendererView.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"VideoRendererView.d.ts","sourceRoot":"","sources":["../../src/components/VideoRendererView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAKF,eAAO,MAAM,iBAAiB,oHAM5B,CAAC"}
1
+ {"version":3,"file":"VideoRendererView.d.ts","sourceRoot":"","sources":["../../src/components/VideoRendererView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAKF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,oHAM5B,CAAC"}
@@ -1,6 +1,10 @@
1
1
  import { requireNativeViewManager } from 'expo-modules-core';
2
2
  import * as React from 'react';
3
3
  const NativeView = requireNativeViewManager('VideoRendererViewModule');
4
+ /**
5
+ * Render video track received from {@link useParticipants} hook
6
+ * @category Components
7
+ */
4
8
  export const VideoRendererView = React.forwardRef((props, ref) => (
5
9
  // @ts-expect-error ref prop needs to be updated
6
10
  <NativeView {...props} ref={ref}/>));
@@ -1 +1 @@
1
- {"version":3,"file":"VideoRendererView.js","sourceRoot":"","sources":["../../src/components/VideoRendererView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAoB/B,MAAM,UAAU,GACd,wBAAwB,CAAC,yBAAyB,CAAC,CAAC;AAEtD,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC,UAAU,CAG/C,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC;AAChB,gDAAgD;AAChD,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAG,CACpC,CAAC,CAAC","sourcesContent":["import { requireNativeViewManager } from 'expo-modules-core';\nimport * as React from 'react';\nimport { ViewStyle } from 'react-native';\n\nimport { VideoLayout } from '../types';\n\nexport type VideoRendererProps = {\n /**\n * id of the video track which you want to render.\n */\n trackId: string;\n /**\n * `FILL` or `FIT` - it works just like RN Image component. `FILL` fills the whole view\n * with video and it may cut some parts of the video. `FIT` scales the video so the whole\n * video is visible, but it may leave some empty space in the view.\n * @default `FILL`\n */\n videoLayout?: VideoLayout;\n style?: ViewStyle;\n};\n\nconst NativeView: React.ComponentType<VideoRendererProps> =\n requireNativeViewManager('VideoRendererViewModule');\n\nexport const VideoRendererView = React.forwardRef<\n React.ComponentType<VideoRendererProps>,\n VideoRendererProps\n>((props, ref) => (\n // @ts-expect-error ref prop needs to be updated\n <NativeView {...props} ref={ref} />\n));\n"]}
1
+ {"version":3,"file":"VideoRendererView.js","sourceRoot":"","sources":["../../src/components/VideoRendererView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAkB/B,MAAM,UAAU,GACd,wBAAwB,CAAC,yBAAyB,CAAC,CAAC;AAEtD;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC,UAAU,CAG/C,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC;AAChB,gDAAgD;AAChD,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAG,CACpC,CAAC,CAAC","sourcesContent":["import { requireNativeViewManager } from 'expo-modules-core';\nimport * as React from 'react';\nimport { ViewStyle } from 'react-native';\n\nimport { VideoLayout } from '../types';\n\nexport type VideoRendererProps = {\n /**\n * id of the video track which you want to render.\n */\n trackId: string;\n /**\n * Video layout inside of the component\n * @default `FILL`\n */\n videoLayout?: VideoLayout;\n style?: ViewStyle;\n};\n\nconst NativeView: React.ComponentType<VideoRendererProps> =\n requireNativeViewManager('VideoRendererViewModule');\n\n/**\n * Render video track received from {@link useParticipants} hook\n * @category Components\n */\nexport const VideoRendererView = React.forwardRef<\n React.ComponentType<VideoRendererProps>,\n VideoRendererProps\n>((props, ref) => (\n // @ts-expect-error ref prop needs to be updated\n <NativeView {...props} ref={ref} />\n));\n"]}
@@ -6,6 +6,8 @@ export type AudioOutputDevice = {
6
6
  };
7
7
  /**
8
8
  * This hook manages audio settings.
9
+ * @category Devices
10
+ * @group Hooks
9
11
  */
10
12
  export declare function useAudioSettings(): {
11
13
  /**
@@ -16,8 +18,21 @@ export declare function useAudioSettings(): {
16
18
  * [Android only] available audio output devices to be set
17
19
  */
18
20
  availableDevices: AudioOutputDevice[];
21
+ /**
22
+ * [Android only] selects output audio device.
23
+ * For detecting and selecting bluettoth devices make sure you have the BLUETOOTH_CONNECT permission.
24
+ */
19
25
  selectOutputAudioDevice: (device: AudioOutputDeviceType) => Promise<void>;
26
+ /**
27
+ * [iOS only] selects audio session mode. For more information refer to Apple's documentation:
28
+ * https://developer.apple.com/documentation/avfaudio/avaudiosession/mode/
29
+ *
30
+ */
20
31
  selectAudioSessionMode: (audioSessionMode: AudioSessionMode) => Promise<void>;
32
+ /**
33
+ * [iOS only] Shows a picker modal that allows user to select output audio device. For more
34
+ * information refer to Apple's documentation: https://developer.apple.com/documentation/avkit/avroutepickerview
35
+ */
21
36
  showAudioRoutePicker: () => Promise<void>;
22
37
  };
23
38
  //# sourceMappingURL=useAudioSettings.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useAudioSettings.d.ts","sourceRoot":"","sources":["../../src/hooks/useAudioSettings.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,qBAAqB,GAC7B,WAAW,GACX,SAAS,GACT,SAAS,GACT,UAAU,CAAC;AAEf,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,WAAW,CAAC;AAEzD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,qBAAqB,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAOF;;GAEG;AACH,wBAAgB,gBAAgB;IAsE5B;;OAEG;;IAEH;;OAEG;;sCAhDY,qBAAqB;+CAkBX,gBAAgB;;EAoC5C"}
1
+ {"version":3,"file":"useAudioSettings.d.ts","sourceRoot":"","sources":["../../src/hooks/useAudioSettings.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,qBAAqB,GAC7B,WAAW,GACX,SAAS,GACT,SAAS,GACT,UAAU,CAAC;AAEf,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,WAAW,CAAC;AAEzD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,qBAAqB,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAOF;;;;GAIG;AACH,wBAAgB,gBAAgB;IAyD5B;;OAEG;;IAEH;;OAEG;;IAEH;;;OAGG;sCA5CY,qBAAqB;IA8CpC;;;;OAIG;+CArCsB,gBAAgB;IAuCzC;;;OAGG;;EAGN"}
@@ -4,6 +4,8 @@ import RNFishjamClientModule from '../RNFishjamClientModule';
4
4
  import { ReceivableEvents, useFishjamEvent } from './useFishjamEvent';
5
5
  /**
6
6
  * This hook manages audio settings.
7
+ * @category Devices
8
+ * @group Hooks
7
9
  */
8
10
  export function useAudioSettings() {
9
11
  const [selectedAudioOutputDevice, setSelectedAudioOutputDevice] = useState(null);
@@ -21,10 +23,6 @@ export function useAudioSettings() {
21
23
  }
22
24
  };
23
25
  }, [onAudioDevice]);
24
- /**
25
- * [Android only] selects output audio device.
26
- * For detecting and selecting bluettoth devices make sure you have the BLUETOOTH_CONNECT permission.
27
- */
28
26
  const selectOutputAudioDevice = useCallback(async (device) => {
29
27
  if (Platform.OS === 'ios') {
30
28
  throw Error('selectOutputAudioDevice function is supported only on Android. ' +
@@ -32,21 +30,12 @@ export function useAudioSettings() {
32
30
  }
33
31
  await RNFishjamClientModule.setOutputAudioDevice(device);
34
32
  }, []);
35
- /**
36
- * [iOS only] selects audio session mode. For more information refer to Apple's documentation:
37
- * https://developer.apple.com/documentation/avfaudio/avaudiosession/mode/
38
- *
39
- */
40
33
  const selectAudioSessionMode = useCallback(async (audioSessionMode) => {
41
34
  if (Platform.OS === 'android') {
42
35
  throw Error('selectAudioSessionMode function is supported only on iOS');
43
36
  }
44
37
  await RNFishjamClientModule.selectAudioSessionMode(audioSessionMode);
45
38
  }, []);
46
- /**
47
- * [iOS only] Shows a picker modal that allows user to select output audio device. For more
48
- * information refer to Apple's documentation: https://developer.apple.com/documentation/avkit/avroutepickerview
49
- */
50
39
  const showAudioRoutePicker = useCallback(async () => {
51
40
  if (Platform.OS === 'android') {
52
41
  throw Error('showAudioRoutePicker function is supported only on iOS. ' +
@@ -63,8 +52,21 @@ export function useAudioSettings() {
63
52
  * [Android only] available audio output devices to be set
64
53
  */
65
54
  availableDevices,
55
+ /**
56
+ * [Android only] selects output audio device.
57
+ * For detecting and selecting bluettoth devices make sure you have the BLUETOOTH_CONNECT permission.
58
+ */
66
59
  selectOutputAudioDevice,
60
+ /**
61
+ * [iOS only] selects audio session mode. For more information refer to Apple's documentation:
62
+ * https://developer.apple.com/documentation/avfaudio/avaudiosession/mode/
63
+ *
64
+ */
67
65
  selectAudioSessionMode,
66
+ /**
67
+ * [iOS only] Shows a picker modal that allows user to select output audio device. For more
68
+ * information refer to Apple's documentation: https://developer.apple.com/documentation/avkit/avroutepickerview
69
+ */
68
70
  showAudioRoutePicker,
69
71
  };
70
72
  }
@@ -1 +1 @@
1
- {"version":3,"file":"useAudioSettings.js","sourceRoot":"","sources":["../../src/hooks/useAudioSettings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,qBAAqB,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAoBtE;;GAEG;AACH,MAAM,UAAU,gBAAgB;IAC9B,MAAM,CAAC,yBAAyB,EAAE,4BAA4B,CAAC,GAC7D,QAAQ,CAA2B,IAAI,CAAC,CAAC;IAC3C,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CACtD,EAAE,CACH,CAAC;IAEF,MAAM,aAAa,GAAG,WAAW,CAAC,CAAC,KAAyB,EAAE,EAAE;QAC9D,4BAA4B,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;QACnD,mBAAmB,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAC9C,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,eAAe,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAC;IAEnE,SAAS,CAAC,GAAG,EAAE;QACb,qBAAqB,CA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AC","sourcesContent":["import { useCallback, useEffect, useState } from 'react';\nimport { Platform } from 'react-native';\n\nimport RNFishjamClientModule from '../RNFishjamClientModule';\nimport { ReceivableEvents, useFishjamEvent } from './useFishjamEvent';\n\nexport type AudioOutputDeviceType =\n | 'bluetooth'\n | 'headset'\n | 'speaker'\n | 'earpiece';\n\nexport type AudioSessionMode = 'voiceChat' | 'videoChat';\n\nexport type AudioOutputDevice = {\n type: AudioOutputDeviceType;\n name: string;\n};\n\ntype OnAudioDeviceEvent = {\n selectedDevice: AudioOutputDevice;\n availableDevices: AudioOutputDevice[];\n};\n\n/**\n * This hook manages audio settings.\n */\nexport function useAudioSettings() {\n const [selectedAudioOutputDevice, setSelectedAudioOutputDevice] =\n useState<AudioOutputDevice | null>(null);\n const [availableDevices, setAvailableDevices] = useState<AudioOutputDevice[]>(\n [],\n );\n\n const onAudioDevice = useCallback((event: OnAudioDeviceEvent) => {\n setSelectedAudioOutputDevice(event.selectedDevice);\n setAvailableDevices(event.availableDevices);\n }, []);\n\n useFishjamEvent(ReceivableEvents.AudioDeviceUpdate, onAudioDevice);\n\n useEffect(() => {\n RNFishjamClientModule.startAudioSwitcher();\n return () => {\n if (Platform.OS === 'android') {\n RNFishjamClientModule.stopAudioSwitcher();\n }\n };\n }, [onAudioDevice]);\n\n /**\n * [Android only] selects output audio device.\n * For detecting and selecting bluettoth devices make sure you have the BLUETOOTH_CONNECT permission.\n */\n const selectOutputAudioDevice = useCallback(\n async (device: AudioOutputDeviceType) => {\n if (Platform.OS === 'ios') {\n throw Error(\n 'selectOutputAudioDevice function is supported only on Android. ' +\n 'To select an output audio device on iOS use selectAudioSessionMode or showAudioRoutePicker functions',\n );\n }\n await RNFishjamClientModule.setOutputAudioDevice(device);\n },\n [],\n );\n\n /**\n * [iOS only] selects audio session mode. For more information refer to Apple's documentation:\n * https://developer.apple.com/documentation/avfaudio/avaudiosession/mode/\n *\n */\n const selectAudioSessionMode = useCallback(\n async (audioSessionMode: AudioSessionMode) => {\n if (Platform.OS === 'android') {\n throw Error('selectAudioSessionMode function is supported only on iOS');\n }\n await RNFishjamClientModule.selectAudioSessionMode(audioSessionMode);\n },\n [],\n );\n\n /**\n * [iOS only] Shows a picker modal that allows user to select output audio device. For more\n * information refer to Apple's documentation: https://developer.apple.com/documentation/avkit/avroutepickerview\n */\n const showAudioRoutePicker = useCallback(async () => {\n if (Platform.OS === 'android') {\n throw Error(\n 'showAudioRoutePicker function is supported only on iOS. ' +\n 'To select an output audio device on Android use selectOutputAudioDevice function',\n );\n }\n await RNFishjamClientModule.showAudioRoutePicker();\n }, []);\n\n return {\n /**\n * currently selected output audio device\n */\n selectedAudioOutputDevice,\n /**\n * [Android only] available audio output devices to be set\n */\n availableDevices,\n selectOutputAudioDevice,\n selectAudioSessionMode,\n showAudioRoutePicker,\n };\n}\n"]}
1
+ {"version":3,"file":"useAudioSettings.js","sourceRoot":"","sources":["../../src/hooks/useAudioSettings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,qBAAqB,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAoBtE;;;;GAIG;AACH,MAAM,UAAU,gBAAgB;IAC9B,MAAM,CAAC,yBAAyB,EAAE,4BAA4B,CAAC,GAC7D,QAAQ,CAA2B,IAAI,CAAC,CAAC;IAC3C,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CACtD,EAAE,CACH,CAAC;IAEF,MAAM,aAAa,GAAG,WAAW,CAAC,CAAC,KAAyB,EAAE,EAAE;QAC9D,4BAA4B,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;QACnD,mBAAmB,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAC9C,CAAC,EAAE,EAAE,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WAEG;QACH,gBAAgB;QAChB;;;WAGG;QACH,uBAAuB;QACvB;;;;WAIG;QACH,sBAAsB;QACtB;;;WAGG;QACH,oBAAoB;KACrB,CAAC;AACJ,CAAC","sourcesContent":["import { useCallback, useEffect, useState } from 'react';\nimport { Platform } from 'react-native';\n\nimport RNFishjamClientModule from '../RNFishjamClientModule';\nimport { ReceivableEvents, useFishjamEvent } from './useFishjamEvent';\n\nexport type AudioOutputDeviceType =\n | 'bluetooth'\n | 'headset'\n | 'speaker'\n | 'earpiece';\n\nexport type AudioSessionMode = 'voiceChat' | 'videoChat';\n\nexport type AudioOutputDevice = {\n type: AudioOutputDeviceType;\n name: string;\n};\n\ntype OnAudioDeviceEvent = {\n selectedDevice: AudioOutputDevice;\n availableDevices: AudioOutputDevice[];\n};\n\n/**\n * This hook manages audio settings.\n * @category Devices\n * @group Hooks\n */\nexport function useAudioSettings() {\n const [selectedAudioOutputDevice, setSelectedAudioOutputDevice] =\n useState<AudioOutputDevice | null>(null);\n const [availableDevices, setAvailableDevices] = useState<AudioOutputDevice[]>(\n [],\n );\n\n const onAudioDevice = useCallback((event: OnAudioDeviceEvent) => {\n setSelectedAudioOutputDevice(event.selectedDevice);\n setAvailableDevices(event.availableDevices);\n }, []);\n\n useFishjamEvent(ReceivableEvents.AudioDeviceUpdate, onAudioDevice);\n\n useEffect(() => {\n RNFishjamClientModule.startAudioSwitcher();\n return () => {\n if (Platform.OS === 'android') {\n RNFishjamClientModule.stopAudioSwitcher();\n }\n };\n }, [onAudioDevice]);\n\n const selectOutputAudioDevice = useCallback(\n async (device: AudioOutputDeviceType) => {\n if (Platform.OS === 'ios') {\n throw Error(\n 'selectOutputAudioDevice function is supported only on Android. ' +\n 'To select an output audio device on iOS use selectAudioSessionMode or showAudioRoutePicker functions',\n );\n }\n await RNFishjamClientModule.setOutputAudioDevice(device);\n },\n [],\n );\n\n const selectAudioSessionMode = useCallback(\n async (audioSessionMode: AudioSessionMode) => {\n if (Platform.OS === 'android') {\n throw Error('selectAudioSessionMode function is supported only on iOS');\n }\n await RNFishjamClientModule.selectAudioSessionMode(audioSessionMode);\n },\n [],\n );\n\n const showAudioRoutePicker = useCallback(async () => {\n if (Platform.OS === 'android') {\n throw Error(\n 'showAudioRoutePicker function is supported only on iOS. ' +\n 'To select an output audio device on Android use selectOutputAudioDevice function',\n );\n }\n await RNFishjamClientModule.showAudioRoutePicker();\n }, []);\n\n return {\n /**\n * currently selected output audio device\n */\n selectedAudioOutputDevice,\n /**\n * [Android only] available audio output devices to be set\n */\n availableDevices,\n /**\n * [Android only] selects output audio device.\n * For detecting and selecting bluettoth devices make sure you have the BLUETOOTH_CONNECT permission.\n */\n selectOutputAudioDevice,\n /**\n * [iOS only] selects audio session mode. For more information refer to Apple's documentation:\n * https://developer.apple.com/documentation/avfaudio/avaudiosession/mode/\n *\n */\n selectAudioSessionMode,\n /**\n * [iOS only] Shows a picker modal that allows user to select output audio device. For more\n * information refer to Apple's documentation: https://developer.apple.com/documentation/avkit/avroutepickerview\n */\n showAudioRoutePicker,\n };\n}\n"]}
@@ -2,6 +2,8 @@
2
2
  * This hook provides current bandwidth estimation
3
3
  * estimation - client's available incoming bitrate estimated
4
4
  * by the server. It's measured in bits per second.
5
+ * @category Debugging
6
+ * @group Hooks
5
7
  */
6
8
  export declare function useBandwidthEstimation(): {
7
9
  estimation: number | null;
@@ -1 +1 @@
1
- {"version":3,"file":"useBandwidthEstimation.d.ts","sourceRoot":"","sources":["../../src/hooks/useBandwidthEstimation.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,wBAAgB,sBAAsB;;EAMrC"}
1
+ {"version":3,"file":"useBandwidthEstimation.d.ts","sourceRoot":"","sources":["../../src/hooks/useBandwidthEstimation.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,wBAAgB,sBAAsB;;EAMrC"}
@@ -4,6 +4,8 @@ import { ReceivableEvents, useFishjamEvent } from './useFishjamEvent';
4
4
  * This hook provides current bandwidth estimation
5
5
  * estimation - client's available incoming bitrate estimated
6
6
  * by the server. It's measured in bits per second.
7
+ * @category Debugging
8
+ * @group Hooks
7
9
  */
8
10
  export function useBandwidthEstimation() {
9
11
  const [estimation, setEstimation] = useState(null);
@@ -1 +1 @@
1
- {"version":3,"file":"useBandwidthEstimation.js","sourceRoot":"","sources":["../../src/hooks/useBandwidthEstimation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEtE;;;;GAIG;AACH,MAAM,UAAU,sBAAsB;IACpC,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAElE,eAAe,CAAC,gBAAgB,CAAC,mBAAmB,EAAE,aAAa,CAAC,CAAC;IAErE,OAAO,EAAE,UAAU,EAAE,CAAC;AACxB,CAAC","sourcesContent":["import { useState } from 'react';\n\nimport { ReceivableEvents, useFishjamEvent } from './useFishjamEvent';\n\n/**\n * This hook provides current bandwidth estimation\n * estimation - client's available incoming bitrate estimated\n * by the server. It's measured in bits per second.\n */\nexport function useBandwidthEstimation() {\n const [estimation, setEstimation] = useState<number | null>(null);\n\n useFishjamEvent(ReceivableEvents.BandwidthEstimation, setEstimation);\n\n return { estimation };\n}\n"]}
1
+ {"version":3,"file":"useBandwidthEstimation.js","sourceRoot":"","sources":["../../src/hooks/useBandwidthEstimation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEtE;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB;IACpC,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAElE,eAAe,CAAC,gBAAgB,CAAC,mBAAmB,EAAE,aAAa,CAAC,CAAC;IAErE,OAAO,EAAE,UAAU,EAAE,CAAC;AACxB,CAAC","sourcesContent":["import { useState } from 'react';\n\nimport { ReceivableEvents, useFishjamEvent } from './useFishjamEvent';\n\n/**\n * This hook provides current bandwidth estimation\n * estimation - client's available incoming bitrate estimated\n * by the server. It's measured in bits per second.\n * @category Debugging\n * @group Hooks\n */\nexport function useBandwidthEstimation() {\n const [estimation, setEstimation] = useState<number | null>(null);\n\n useFishjamEvent(ReceivableEvents.BandwidthEstimation, setEstimation);\n\n return { estimation };\n}\n"]}
@@ -54,17 +54,61 @@ export type CameraConfigInternal = CameraConfigBase & {
54
54
  export declare function updateCameraConfig(config: Readonly<CameraConfig>): CameraConfigInternal;
55
55
  /**
56
56
  * This hook can toggle camera on/off and provides current camera state.
57
+ * @category Devices
58
+ * @group Hooks
57
59
  */
58
60
  export declare function useCamera(): {
61
+ /**
62
+ * Informs if user camera is streaming video
63
+ */
59
64
  isCameraOn: boolean;
65
+ /**
66
+ * Which camera is now used for streaming (or will be used as default when camera will be enabled)
67
+ */
60
68
  currentCamera: Camera | undefined;
69
+ /**
70
+ * Simulcast configuration
71
+ */
61
72
  simulcastConfig: SimulcastConfig;
73
+ /**
74
+ * Property that lists cameras available on device.
75
+ * @returns A promise that resolves to the list of available cameras.
76
+ */
62
77
  cameras: readonly Camera[];
78
+ /** Enable/disable current camera */
63
79
  toggleCamera: () => Promise<void>;
80
+ /**
81
+ * Prepares camera and starts local video track
82
+ * @param config configuration of the camera capture
83
+ * @returns A promise that resolves when camera is started.
84
+ */
64
85
  prepareCamera: (config?: Readonly<CameraConfig>) => Promise<void>;
65
- switchCamera: (cameraId: CameraId) => Promise<void>;
86
+ /**
87
+ * Switches to the specified camera.
88
+ * List of available devices can be retrieved from `cameras` variable
89
+ * @returns A promise that resolves when camera is switched.
90
+ */ switchCamera: (cameraId: CameraId) => Promise<void>;
91
+ /**
92
+ * @deprecated
93
+ * toggles encoding of a video track on/off
94
+ * @param encoding encoding to toggle
95
+ */
66
96
  toggleVideoTrackEncoding: (encoding: TrackEncoding) => Promise<void>;
97
+ /**
98
+ * updates maximum bandwidth for the given simulcast encoding of the video track
99
+ * @param encoding encoding to update
100
+ * @param bandwidth BandwidthLimit to set
101
+ * @deprecated
102
+ */
67
103
  setVideoTrackEncodingBandwidth: (encoding: TrackEncoding, bandwidth: BandwidthLimit) => Promise<void>;
104
+ /**
105
+ * updates maximum bandwidth for the video track. This value directly translates
106
+ * to quality of the stream and the amount of RTP packets being sent. In case simulcast
107
+ * is enabled bandwidth is split between all of the variant streams proportionally to
108
+ * their resolution.
109
+ * @param BandwidthLimit to set
110
+ * @deprecated
111
+ */
68
112
  setVideoTrackBandwidth: (bandwidth: BandwidthLimit) => Promise<void>;
69
113
  };
70
114
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"useCamera.d.ts","sourceRoot":"","sources":["../../src/hooks/useCamera.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,cAAc,EACd,KAAK,EACL,uBAAuB,EACvB,eAAe,EACf,mBAAmB,EACnB,aAAa,EACd,MAAM,UAAU,CAAC;AAKlB,MAAM,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;AAEjD,MAAM,MAAM,qBAAqB,GAAG,OAAO,GAAG,MAAM,GAAG,aAAa,CAAC;AAErE,MAAM,MAAM,MAAM,GAAG;IACnB,EAAE,EAAE,QAAQ,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,qBAAqB,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,YAAY,GACpB,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,OAAO,GACP,OAAO,GACP,MAAM,GACN,OAAO,CAAC;AAEZ,KAAK,gBAAgB,GAAG;IACtB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;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"}
@@ -45,6 +45,8 @@ export function updateCameraConfig(config) {
45
45
  }
46
46
  /**
47
47
  * This hook can toggle camera on/off and provides current camera state.
48
+ * @category Devices
49
+ * @group Hooks
48
50
  */
49
51
  export function useCamera() {
50
52
  const [isCameraOn, setIsCameraOn] = useState(RNFishjamClientModule.isCameraOn);
@@ -52,18 +54,9 @@ export function useCamera() {
52
54
  const [simulcastConfig, setSimulcastConfig] = useState(defaultSimulcastConfig());
53
55
  useFishjamEvent(ReceivableEvents.SimulcastConfigUpdate, setSimulcastConfig);
54
56
  useFishjamEvent(ReceivableEvents.IsCameraOn, setIsCameraOn);
55
- /**
56
- * Property that lists cameras available on device.
57
- * @returns A promise that resolves to the list of available cameras.
58
- */
59
57
  const cameras = useMemo(() => {
60
58
  return RNFishjamClientModule.cameras;
61
59
  }, []);
62
- /**
63
- * Prepares camera and starts local camera capture.
64
- * @param config configuration of the camera capture
65
- * @returns A promise that resolves when camera is started.
66
- */
67
60
  const prepareCamera = useCallback(async (config = {}) => {
68
61
  const camera = RNFishjamClientModule.cameras.find((camera) => config.cameraId
69
62
  ? camera.id === config.cameraId
@@ -75,9 +68,6 @@ export function useCamera() {
75
68
  });
76
69
  await RNFishjamClientModule.startCamera(updatedConfig);
77
70
  }, []);
78
- /**
79
- * Toggles camera on/off
80
- */
81
71
  const toggleCamera = useCallback(async () => {
82
72
  const state = await RNFishjamClientModule.toggleCamera();
83
73
  await RNFishjamClientModule.updateVideoTrackMetadata({
@@ -86,54 +76,72 @@ export function useCamera() {
86
76
  });
87
77
  setIsCameraOn(state);
88
78
  }, []);
89
- /**
90
- * Switches to the specified camera.
91
- * List of available devices can be retrieved from `cameras` variable
92
- * @returns A promise that resolves when camera is switched.
93
- */
94
79
  const switchCamera = useCallback(async (cameraId) => {
95
80
  await RNFishjamClientModule.switchCamera(cameraId);
96
81
  setCurrentCamera(cameras.find((camera) => camera.id === cameraId));
97
82
  }, [cameras]);
98
- /**
99
- * @deprecated
100
- * updates maximum bandwidth for the video track. This value directly translates
101
- * to quality of the stream and the amount of RTP packets being sent. In case simulcast
102
- * is enabled bandwidth is split between all of the variant streams proportionally to
103
- * their resolution.
104
- * @param BandwidthLimit to set
105
- */
106
83
  const setVideoTrackBandwidth = useCallback(async (bandwidth) => {
107
84
  await RNFishjamClientModule.setVideoTrackBandwidth(bandwidth);
108
85
  }, []);
109
- /**
110
- * @deprecated
111
- * toggles encoding of a video track on/off
112
- * @param encoding encoding to toggle
113
- */
114
86
  const toggleVideoTrackEncoding = useCallback(async (encoding) => {
115
87
  const videoSimulcastConfig = await RNFishjamClientModule.toggleVideoTrackEncoding(encoding);
116
88
  setSimulcastConfig(videoSimulcastConfig);
117
89
  }, []);
118
- /**
119
- * @deprecated
120
- * updates maximum bandwidth for the given simulcast encoding of the video track
121
- * @param encoding encoding to update
122
- * @param bandwidth BandwidthLimit to set
123
- */
124
90
  const setVideoTrackEncodingBandwidth = useCallback(async (encoding, bandwidth) => {
125
91
  await RNFishjamClientModule.setVideoTrackEncodingBandwidth(encoding, bandwidth);
126
92
  }, []);
127
93
  return {
94
+ /**
95
+ * Informs if user camera is streaming video
96
+ */
128
97
  isCameraOn,
98
+ /**
99
+ * Which camera is now used for streaming (or will be used as default when camera will be enabled)
100
+ */
129
101
  currentCamera,
102
+ /**
103
+ * Simulcast configuration
104
+ */
130
105
  simulcastConfig,
106
+ /**
107
+ * Property that lists cameras available on device.
108
+ * @returns A promise that resolves to the list of available cameras.
109
+ */
131
110
  cameras,
111
+ /** Enable/disable current camera */
132
112
  toggleCamera,
113
+ /**
114
+ * Prepares camera and starts local video track
115
+ * @param config configuration of the camera capture
116
+ * @returns A promise that resolves when camera is started.
117
+ */
133
118
  prepareCamera,
134
- switchCamera,
119
+ /**
120
+ * Switches to the specified camera.
121
+ * List of available devices can be retrieved from `cameras` variable
122
+ * @returns A promise that resolves when camera is switched.
123
+ */ switchCamera,
124
+ /**
125
+ * @deprecated
126
+ * toggles encoding of a video track on/off
127
+ * @param encoding encoding to toggle
128
+ */
135
129
  toggleVideoTrackEncoding,
130
+ /**
131
+ * updates maximum bandwidth for the given simulcast encoding of the video track
132
+ * @param encoding encoding to update
133
+ * @param bandwidth BandwidthLimit to set
134
+ * @deprecated
135
+ */
136
136
  setVideoTrackEncodingBandwidth,
137
+ /**
138
+ * updates maximum bandwidth for the video track. This value directly translates
139
+ * to quality of the stream and the amount of RTP packets being sent. In case simulcast
140
+ * is enabled bandwidth is split between all of the variant streams proportionally to
141
+ * their resolution.
142
+ * @param BandwidthLimit to set
143
+ * @deprecated
144
+ */
137
145
  setVideoTrackBandwidth,
138
146
  };
139
147
  }