@stream-io/video-react-native-sdk 1.20.0 → 1.20.1-alpha.1

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.
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.version = void 0;
7
- const version = exports.version = '1.20.0';
7
+ const version = exports.version = '1.20.1-alpha.1';
8
8
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["version","exports"],"sourceRoot":"../../src","sources":["version.ts"],"mappings":";;;;;;AAAO,MAAMA,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAG,QAAQ","ignoreList":[]}
1
+ {"version":3,"names":["version","exports"],"sourceRoot":"../../src","sources":["version.ts"],"mappings":";;;;;;AAAO,MAAMA,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAG,gBAAgB","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- export const version = '1.20.0';
1
+ export const version = '1.20.1-alpha.1';
2
2
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["version"],"sourceRoot":"../../src","sources":["version.ts"],"mappings":"AAAA,OAAO,MAAMA,OAAO,GAAG,QAAQ","ignoreList":[]}
1
+ {"version":3,"names":["version"],"sourceRoot":"../../src","sources":["version.ts"],"mappings":"AAAA,OAAO,MAAMA,OAAO,GAAG,gBAAgB","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- export declare const version = "1.20.0";
1
+ export declare const version = "1.20.1-alpha.1";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,WAAW,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,mBAAmB,CAAC"}
@@ -37,7 +37,9 @@ function addOnPictureInPictureModeChanged(contents, isJava) {
37
37
  @Override
38
38
  public void onPictureInPictureModeChanged(boolean isInPictureInPictureMode, Configuration newConfig) {
39
39
  super.onPictureInPictureModeChanged(isInPictureInPictureMode, newConfig);
40
-
40
+ if (isFinishing()) {
41
+ return;
42
+ }
41
43
  if (lifecycleOwner.getLifecycle().getCurrentState() == Lifecycle.State.CREATED) {
42
44
  // When user clicks on Close button of PIP
43
45
  finishAndRemoveTask();
@@ -51,6 +53,9 @@ function addOnPictureInPictureModeChanged(contents, isJava) {
51
53
  statementToInsert = `
52
54
  override fun onPictureInPictureModeChanged(isInPictureInPictureMode: Boolean, newConfig: Configuration) {
53
55
  super.onPictureInPictureModeChanged(isInPictureInPictureMode)
56
+ if (isFinishing) {
57
+ return
58
+ }
54
59
  if (lifecycle.currentState === Lifecycle.State.CREATED) {
55
60
  // when user clicks on Close button of PIP
56
61
  finishAndRemoveTask()
@@ -13,17 +13,6 @@ class RTCViewPip: UIView {
13
13
  private var pictureInPictureController = StreamPictureInPictureController()
14
14
  private var webRtcModule: WebRTCModule?
15
15
 
16
- override init(frame: CGRect) {
17
- super.init(frame: frame)
18
- setupNotificationObserver()
19
- self.pictureInPictureController?.sourceView = self
20
- }
21
-
22
- required init?(coder aDecoder: NSCoder) {
23
- super.init(coder: aDecoder)
24
- setupNotificationObserver()
25
- }
26
-
27
16
  private func setupNotificationObserver() {
28
17
  NotificationCenter.default.addObserver(
29
18
  self,
@@ -33,10 +22,6 @@ class RTCViewPip: UIView {
33
22
  )
34
23
  }
35
24
 
36
- deinit {
37
- NotificationCenter.default.removeObserver(self)
38
- }
39
-
40
25
  func setWebRtcModule(_ module: WebRTCModule) {
41
26
  webRtcModule = module
42
27
  }
@@ -82,16 +67,21 @@ class RTCViewPip: UIView {
82
67
  self.pictureInPictureController = nil
83
68
  }
84
69
 
85
- override func didMoveToWindow() {
86
- super.didMoveToWindow()
87
- let isVisible = self.superview != nil && self.window != nil;
88
- if (!isVisible) {
89
- // view is detached so we cleanup the pip controller
90
- // taken from: https://github.com/software-mansion/react-native-screens/blob/main/Example/ios/ScreensExample/RNSSampleLifecycleAwareView.m
70
+ override func didMoveToSuperview() {
71
+ super.didMoveToSuperview()
72
+ if self.superview == nil {
73
+ print("PiP - RTCViewPip has been removed from its superview.")
74
+ NotificationCenter.default.removeObserver(self)
91
75
  DispatchQueue.main.async {
92
76
  NSLog("PiP - onCallClosed called due to view detaching")
93
77
  self.onCallClosed()
94
78
  }
79
+ } else {
80
+ print("PiP - RTCViewPip has been added to a superview.")
81
+ setupNotificationObserver()
82
+ DispatchQueue.main.async {
83
+ self.pictureInPictureController?.sourceView = self
84
+ }
95
85
  }
96
86
  }
97
87
  }
@@ -9,34 +9,21 @@ import Foundation
9
9
 
10
10
  @objc(RTCViewPipManager)
11
11
  class RTCViewPipManager: RCTViewManager {
12
-
13
- // A cached RTCViewPip reference.
14
- //
15
- // Often, the view unmounts before the `onCallClosed` command arrives and as a consequence
16
- // pipView.onCallClosed() method wasn't called, as the view can't be found in the ViewRegistry
17
- // causing dangling PiP window with the last video frame frozen.
18
- // Now, once this happens, instead forwarding the command to the view returned by the registry,
19
- // we manually apply it to the cached view. The current setup allows only one PipView, so we
20
- // don't have to introduce more complex view tracking mechanism.
21
- private var _view: RTCViewPip? = nil
22
-
12
+
23
13
  override func view() -> UIView! {
24
14
  let view = RTCViewPip()
25
15
  view.setWebRtcModule(self.bridge.module(forName: "WebRTCModule") as! WebRTCModule)
26
- self._view = view
27
16
  return view
28
17
  }
29
-
18
+
30
19
  override static func requiresMainQueueSetup() -> Bool {
31
20
  return true
32
21
  }
33
-
22
+
34
23
  @objc func onCallClosed(_ reactTag: NSNumber) {
35
24
  self.bridge!.uiManager.addUIBlock { (_: RCTUIManager?, viewRegistry: [NSNumber: UIView]?) in
36
25
  guard let pipView = viewRegistry?[reactTag] as? RTCViewPip else {
37
- NSLog("PiP - onCallClosed can't be called, Invalid view returned from registry, expecting RTCViewPip. Disposing the cached view.")
38
- self._view?.onCallClosed()
39
- self._view = nil
26
+ NSLog("PiP - onCallClosed cant be called, Invalid view returned from registry, expecting RTCViewPip")
40
27
  return
41
28
  }
42
29
  DispatchQueue.main.async {
@@ -0,0 +1,14 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>SchemeUserState</key>
6
+ <dict>
7
+ <key>StreamVideoReactNative.xcscheme_^#shared#^_</key>
8
+ <dict>
9
+ <key>orderHint</key>
10
+ <integer>0</integer>
11
+ </dict>
12
+ </dict>
13
+ </dict>
14
+ </plist>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stream-io/video-react-native-sdk",
3
- "version": "1.20.0",
3
+ "version": "1.20.1-alpha.1",
4
4
  "description": "Stream Video SDK for React Native",
5
5
  "author": "https://getstream.io",
6
6
  "homepage": "https://getstream.io/video/docs/react-native/",
@@ -45,8 +45,8 @@
45
45
  "!**/.*"
46
46
  ],
47
47
  "dependencies": {
48
- "@stream-io/video-client": "1.27.1",
49
- "@stream-io/video-react-bindings": "1.7.10",
48
+ "@stream-io/video-client": "workspace:*",
49
+ "@stream-io/video-react-bindings": "workspace:*",
50
50
  "intl-pluralrules": "2.0.1",
51
51
  "lodash.merge": "^4.6.2",
52
52
  "react-native-url-polyfill": "1.3.0",
@@ -125,9 +125,9 @@
125
125
  "@react-native-firebase/app": "^22.1.0",
126
126
  "@react-native-firebase/messaging": "^22.1.0",
127
127
  "@react-native/babel-preset": "^0.79.2",
128
- "@stream-io/noise-cancellation-react-native": "^0.2.0",
128
+ "@stream-io/noise-cancellation-react-native": "workspace:^",
129
129
  "@stream-io/react-native-webrtc": "^125.4.0",
130
- "@stream-io/video-filters-react-native": "^0.6.0",
130
+ "@stream-io/video-filters-react-native": "workspace:^",
131
131
  "@testing-library/jest-native": "^5.4.3",
132
132
  "@testing-library/react-native": "13.2.0",
133
133
  "@tsconfig/node14": "14.1.3",
@@ -164,4 +164,4 @@
164
164
  "typescript"
165
165
  ]
166
166
  }
167
- }
167
+ }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '1.20.0';
1
+ export const version = '1.20.1-alpha.1';