@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.
Files changed (101) hide show
  1. package/README.md +6 -6
  2. package/android/build.gradle +6 -2
  3. package/android/src/main/java/io/fishjam/reactnative/EmitableEvents.kt +4 -2
  4. package/android/src/main/java/io/fishjam/reactnative/RNFishjamClient.kt +60 -39
  5. package/android/src/main/java/io/fishjam/reactnative/RNFishjamClientModule.kt +11 -19
  6. package/build/RNFishjamClientModule.d.ts +24 -8
  7. package/build/RNFishjamClientModule.d.ts.map +1 -1
  8. package/build/RNFishjamClientModule.js +0 -1
  9. package/build/RNFishjamClientModule.js.map +1 -1
  10. package/build/common/client.d.ts +4 -4
  11. package/build/common/client.d.ts.map +1 -1
  12. package/build/common/client.js +4 -4
  13. package/build/common/client.js.map +1 -1
  14. package/build/common/metadata.d.ts +1 -0
  15. package/build/common/metadata.d.ts.map +1 -1
  16. package/build/common/metadata.js +1 -0
  17. package/build/common/metadata.js.map +1 -1
  18. package/build/components/FishjamRoom/index.d.ts +21 -0
  19. package/build/components/FishjamRoom/index.d.ts.map +1 -1
  20. package/build/components/FishjamRoom/index.js +29 -9
  21. package/build/components/FishjamRoom/index.js.map +1 -1
  22. package/build/components/VideoPreviewView.d.ts +7 -3
  23. package/build/components/VideoPreviewView.d.ts.map +1 -1
  24. package/build/components/VideoPreviewView.js +5 -1
  25. package/build/components/VideoPreviewView.js.map +1 -1
  26. package/build/components/VideoRendererView.d.ts +13 -0
  27. package/build/components/VideoRendererView.d.ts.map +1 -1
  28. package/build/components/VideoRendererView.js +13 -0
  29. package/build/components/VideoRendererView.js.map +1 -1
  30. package/build/hooks/internal/useFishjamEvent.d.ts +3 -2
  31. package/build/hooks/internal/useFishjamEvent.d.ts.map +1 -1
  32. package/build/hooks/internal/useFishjamEvent.js +25 -1
  33. package/build/hooks/internal/useFishjamEvent.js.map +1 -1
  34. package/build/hooks/internal/useFishjamEventState.d.ts +2 -2
  35. package/build/hooks/internal/useFishjamEventState.d.ts.map +1 -1
  36. package/build/hooks/internal/useFishjamEventState.js.map +1 -1
  37. package/build/hooks/useAppScreenShare.d.ts +10 -1
  38. package/build/hooks/useAppScreenShare.d.ts.map +1 -1
  39. package/build/hooks/useAppScreenShare.js +9 -7
  40. package/build/hooks/useAppScreenShare.js.map +1 -1
  41. package/build/hooks/useAudioSettings.d.ts +4 -0
  42. package/build/hooks/useAudioSettings.d.ts.map +1 -1
  43. package/build/hooks/useAudioSettings.js.map +1 -1
  44. package/build/hooks/useBandwidthEstimation.d.ts +3 -0
  45. package/build/hooks/useBandwidthEstimation.d.ts.map +1 -1
  46. package/build/hooks/useBandwidthEstimation.js +6 -1
  47. package/build/hooks/useBandwidthEstimation.js.map +1 -1
  48. package/build/hooks/useCamera.d.ts +12 -35
  49. package/build/hooks/useCamera.d.ts.map +1 -1
  50. package/build/hooks/useCamera.js +11 -60
  51. package/build/hooks/useCamera.js.map +1 -1
  52. package/build/hooks/useConnection.d.ts +29 -13
  53. package/build/hooks/useConnection.d.ts.map +1 -1
  54. package/build/hooks/useConnection.js +11 -5
  55. package/build/hooks/useConnection.js.map +1 -1
  56. package/build/hooks/useForegroundService.d.ts +20 -11
  57. package/build/hooks/useForegroundService.d.ts.map +1 -1
  58. package/build/hooks/useForegroundService.js +2 -3
  59. package/build/hooks/useForegroundService.js.map +1 -1
  60. package/build/hooks/useMicrophone.js.map +1 -1
  61. package/build/hooks/usePeerStatus.d.ts +2 -10
  62. package/build/hooks/usePeerStatus.d.ts.map +1 -1
  63. package/build/hooks/usePeerStatus.js +1 -0
  64. package/build/hooks/usePeerStatus.js.map +1 -1
  65. package/build/hooks/usePeers.d.ts +19 -22
  66. package/build/hooks/usePeers.d.ts.map +1 -1
  67. package/build/hooks/usePeers.js +17 -5
  68. package/build/hooks/usePeers.js.map +1 -1
  69. package/build/hooks/useReconnection.d.ts +2 -2
  70. package/build/hooks/useReconnection.d.ts.map +1 -1
  71. package/build/hooks/useReconnection.js +1 -0
  72. package/build/hooks/useReconnection.js.map +1 -1
  73. package/build/hooks/useScreenShare.d.ts +2 -23
  74. package/build/hooks/useScreenShare.d.ts.map +1 -1
  75. package/build/hooks/useScreenShare.js +1 -36
  76. package/build/hooks/useScreenShare.js.map +1 -1
  77. package/build/index.d.ts +6 -7
  78. package/build/index.d.ts.map +1 -1
  79. package/build/index.js +0 -2
  80. package/build/index.js.map +1 -1
  81. package/build/types.d.ts +3 -19
  82. package/build/types.d.ts.map +1 -1
  83. package/build/types.js.map +1 -1
  84. package/build/utils/eventPayloadValidator.d.ts +3 -0
  85. package/build/utils/eventPayloadValidator.d.ts.map +1 -0
  86. package/build/utils/eventPayloadValidator.js +85 -0
  87. package/build/utils/eventPayloadValidator.js.map +1 -0
  88. package/ios/Events.swift +4 -1
  89. package/ios/RNFishjamClient.podspec +1 -1
  90. package/ios/RNFishjamClient.swift +60 -48
  91. package/ios/RNFishjamClientModule.swift +5 -10
  92. package/ios/VideoPreviewView.swift +5 -0
  93. package/ios/VideoRendererView.swift +5 -0
  94. package/package.json +21 -14
  95. package/plugin/build/withFishjamAndroid.js +1 -0
  96. package/plugin/build/withFishjamIos.js +17 -7
  97. package/build/common/webRTC.d.ts +0 -14
  98. package/build/common/webRTC.d.ts.map +0 -1
  99. package/build/common/webRTC.js +0 -15
  100. package/build/common/webRTC.js.map +0 -1
  101. /package/{LICENSE → LICENSE.txt} +0 -0
@@ -3,9 +3,6 @@ import ExpoModulesCore
3
3
  struct RNSimulcastConfig: Record {
4
4
  @Field
5
5
  var enabled: Bool = false
6
-
7
- @Field
8
- var activeEncodings: [String] = []
9
6
  }
10
7
 
11
8
  struct CameraConfig: Record {
@@ -21,9 +18,6 @@ struct CameraConfig: Record {
21
18
  @Field
22
19
  var simulcastConfig: RNSimulcastConfig = RNSimulcastConfig()
23
20
 
24
- @Field
25
- var maxBandwidth: RNTrackBandwidthLimit = RNTrackBandwidthLimit(0)
26
-
27
21
  @Field
28
22
  var cameraEnabled: Bool = true
29
23
 
@@ -48,9 +42,6 @@ struct ScreenShareOptions: Record {
48
42
 
49
43
  @Field
50
44
  var simulcastConfig: RNSimulcastConfig = RNSimulcastConfig()
51
-
52
- @Field
53
- var maxBandwidth: RNTrackBandwidthLimit = RNTrackBandwidthLimit(0)
54
45
  }
55
46
 
56
47
  struct ReconnectConfig: Record {
@@ -118,6 +109,10 @@ public class RNFishjamClientModule: Module {
118
109
  return rnFishjamClient.isAppScreenShareOn
119
110
  }
120
111
 
112
+ Property("isCameraInitialized") {
113
+ return rnFishjamClient.isCameraInitialized
114
+ }
115
+
121
116
  Function("getPeers") {
122
117
  return rnFishjamClient.getPeers()
123
118
  }
@@ -211,7 +206,7 @@ public class RNFishjamClientModule: Module {
211
206
  }
212
207
 
213
208
  AsyncFunction("getStatistics") {
214
- try rnFishjamClient.getStatistics()
209
+ try await rnFishjamClient.getStatistics()
215
210
  }
216
211
 
217
212
  AsyncFunction("selectAudioSessionMode") { (sessionMode: String) in
@@ -45,6 +45,11 @@ class VideoPreviewView: ExpoView, LocalCameraTrackChangedListener {
45
45
  }
46
46
  }
47
47
 
48
+ override func layoutSubviews() {
49
+ super.layoutSubviews()
50
+ videoView.frame = self.frame
51
+ }
52
+
48
53
  var videoLayout: String = "FILL" {
49
54
  didSet {
50
55
  switch videoLayout {
@@ -26,6 +26,11 @@ class VideoRendererView: ExpoView, TrackUpdateListener {
26
26
  }
27
27
  }
28
28
 
29
+ override func layoutSubviews() {
30
+ super.layoutSubviews()
31
+ videoView.frame = self.frame
32
+ }
33
+
29
34
  func updateVideoTrack() {
30
35
  DispatchQueue.main.async { [weak self] in
31
36
  guard let self, self.superview != nil else { return }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@fishjam-cloud/react-native-client",
3
- "version": "0.6.0",
4
- "description": "A React Native client for Fishjam Cloud",
5
- "author": "Fishjam Cloud Team",
3
+ "version": "0.8.0",
4
+ "description": "A React Native client for Fishjam",
5
+ "author": "Fishjam Team",
6
6
  "license": "Apache-2.0",
7
7
  "main": "build/index.js",
8
8
  "types": "build/index.d.ts",
@@ -22,6 +22,7 @@
22
22
  "keywords": [
23
23
  "react-native",
24
24
  "expo",
25
+ "Fishjam",
25
26
  "FishjamCloud",
26
27
  "MembraneWebRTC",
27
28
  "webRTC",
@@ -39,29 +40,28 @@
39
40
  },
40
41
  "homepage": "https://fishjam.io",
41
42
  "dependencies": {
42
- "phoenix": "^1.7.6",
43
43
  "promise-fs": "^2.1.1",
44
- "protobufjs": "^7.4.0"
44
+ "protobufjs": "^7.4.0",
45
+ "zod": "^3.24.1"
45
46
  },
46
47
  "devDependencies": {
47
48
  "@testing-library/dom": "^10.4.0",
48
49
  "@testing-library/react": "^16.0.1",
49
- "@types/lodash": "^4.17.13",
50
- "@types/phoenix": "^1.6.5",
50
+ "@types/lodash": "^4.17.15",
51
51
  "@types/promise-fs": "^2.1.2",
52
52
  "@types/react": "^18.3.12",
53
- "expo-module-scripts": "^4.0.2",
53
+ "expo-module-scripts": "^4.0.3",
54
54
  "husky": "^9.1.7",
55
55
  "jest": "^29.6.1",
56
56
  "jest-environment-jsdom": "^29.6.1",
57
- "jest-expo": "^52.0.0",
57
+ "jest-expo": "~52.0.2",
58
58
  "jest-websocket-mock": "^2.4.0",
59
- "pod-install": "^0.3.2",
59
+ "pod-install": "^0.3.4",
60
60
  "react-dom": "^18.3.1",
61
- "ts-proto": "^2.3.0",
62
- "typedoc": "^0.26.11",
61
+ "ts-proto": "^2.6.1",
62
+ "typedoc": "^0.27.6",
63
63
  "typedoc-plugin-mark-react-functional-components": "^0.2.2",
64
- "typescript": "^5.6.3"
64
+ "typescript": "^5.7.3"
65
65
  },
66
66
  "peerDependencies": {
67
67
  "expo": "*",
@@ -89,5 +89,12 @@
89
89
  "expo-module.config.json",
90
90
  "README.md",
91
91
  "!**/node_modules"
92
- ]
92
+ ],
93
+ "expo": {
94
+ "doctor": {
95
+ "reactNativeDirectoryCheck": {
96
+ "listUnknownPackages": false
97
+ }
98
+ }
99
+ }
93
100
  }
@@ -10,6 +10,7 @@ const withFishjamForegroundService = (config) => (0, config_plugins_1.withAndroi
10
10
  $: {
11
11
  'android:name': 'io.fishjam.reactnative.foregroundService.FishjamForegroundService',
12
12
  'android:foregroundServiceType': 'camera|microphone|mediaProjection',
13
+ 'android:stopWithTask': 'true',
13
14
  },
14
15
  };
15
16
  const existingServiceIndex = mainApplication.service.findIndex((service) => service.$['android:name'] === newService.$['android:name']);
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  exports.SBE_PODFILE_SNIPPET = void 0;
27
37
  // ios-related code was mostly copied from OneSignal expo plugin: https://github.com/OneSignal/onesignal-expo-plugin/blob/main/onesignal/withOneSignalIos.ts
@@ -1,14 +0,0 @@
1
- import { TrackEncoding } from '../types';
2
- import type { TrackId } from '../hooks/usePeers';
3
- /**
4
- * sets track encoding that server should send to the client library.
5
- * The encoding will be sent whenever it is available. If chooses encoding is
6
- * temporarily unavailable, some other encoding will be sent until choose encoding
7
- * becomes active again.
8
- *
9
- * @param trackId id of a track which encoding you want to select
10
- * @param encoding encoding to select
11
- * @category Debugging
12
- */
13
- export declare function setTargetTrackEncoding(trackId: TrackId, encoding: TrackEncoding): Promise<void>;
14
- //# sourceMappingURL=webRTC.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"webRTC.d.ts","sourceRoot":"","sources":["../../src/common/webRTC.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD;;;;;;;;;GASG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,aAAa,iBAGxB"}
@@ -1,15 +0,0 @@
1
- import RNFishjamClientModule from '../RNFishjamClientModule';
2
- /**
3
- * sets track encoding that server should send to the client library.
4
- * The encoding will be sent whenever it is available. If chooses encoding is
5
- * temporarily unavailable, some other encoding will be sent until choose encoding
6
- * becomes active again.
7
- *
8
- * @param trackId id of a track which encoding you want to select
9
- * @param encoding encoding to select
10
- * @category Debugging
11
- */
12
- export async function setTargetTrackEncoding(trackId, encoding) {
13
- await RNFishjamClientModule.setTargetTrackEncoding(trackId, encoding);
14
- }
15
- //# sourceMappingURL=webRTC.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"webRTC.js","sourceRoot":"","sources":["../../src/common/webRTC.ts"],"names":[],"mappings":"AACA,OAAO,qBAAqB,MAAM,0BAA0B,CAAC;AAG7D;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,OAAgB,EAChB,QAAuB;IAEvB,MAAM,qBAAqB,CAAC,sBAAsB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;AACxE,CAAC","sourcesContent":["import { TrackEncoding } from '../types';\nimport RNFishjamClientModule from '../RNFishjamClientModule';\nimport type { TrackId } from '../hooks/usePeers';\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: TrackId,\n encoding: TrackEncoding,\n) {\n await RNFishjamClientModule.setTargetTrackEncoding(trackId, encoding);\n}\n"]}
File without changes