@stream-io/video-react-native-sdk 1.20.1-alpha.2 → 1.20.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.1-alpha.1';
7
+ const version = exports.version = '1.20.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,gBAAgB","ignoreList":[]}
1
+ {"version":3,"names":["version","exports"],"sourceRoot":"../../src","sources":["version.ts"],"mappings":";;;;;;AAAO,MAAMA,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAG,QAAQ","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- export const version = '1.20.1-alpha.1';
1
+ export const version = '1.20.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,gBAAgB","ignoreList":[]}
1
+ {"version":3,"names":["version"],"sourceRoot":"../../src","sources":["version.ts"],"mappings":"AAAA,OAAO,MAAMA,OAAO,GAAG,QAAQ","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- export declare const version = "1.20.1-alpha.1";
1
+ export declare const version = "1.20.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,mBAAmB,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,WAAW,CAAC"}
@@ -13,6 +13,17 @@ 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
+
16
27
  private func setupNotificationObserver() {
17
28
  NotificationCenter.default.addObserver(
18
29
  self,
@@ -22,6 +33,10 @@ class RTCViewPip: UIView {
22
33
  )
23
34
  }
24
35
 
36
+ deinit {
37
+ NotificationCenter.default.removeObserver(self)
38
+ }
39
+
25
40
  func setWebRtcModule(_ module: WebRTCModule) {
26
41
  webRtcModule = module
27
42
  }
@@ -67,21 +82,16 @@ class RTCViewPip: UIView {
67
82
  self.pictureInPictureController = nil
68
83
  }
69
84
 
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)
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
75
91
  DispatchQueue.main.async {
76
92
  NSLog("PiP - onCallClosed called due to view detaching")
77
93
  self.onCallClosed()
78
94
  }
79
- } else {
80
- print("PiP - RTCViewPip has been added to a superview.")
81
- setupNotificationObserver()
82
- DispatchQueue.main.async {
83
- self.pictureInPictureController?.sourceView = self
84
- }
85
95
  }
86
96
  }
87
97
  }
@@ -9,21 +9,34 @@ import Foundation
9
9
 
10
10
  @objc(RTCViewPipManager)
11
11
  class RTCViewPipManager: RCTViewManager {
12
-
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
+
13
23
  override func view() -> UIView! {
14
24
  let view = RTCViewPip()
15
25
  view.setWebRtcModule(self.bridge.module(forName: "WebRTCModule") as! WebRTCModule)
26
+ self._view = view
16
27
  return view
17
28
  }
18
-
29
+
19
30
  override static func requiresMainQueueSetup() -> Bool {
20
31
  return true
21
32
  }
22
-
33
+
23
34
  @objc func onCallClosed(_ reactTag: NSNumber) {
24
35
  self.bridge!.uiManager.addUIBlock { (_: RCTUIManager?, viewRegistry: [NSNumber: UIView]?) in
25
36
  guard let pipView = viewRegistry?[reactTag] as? RTCViewPip else {
26
- NSLog("PiP - onCallClosed cant be called, Invalid view returned from registry, expecting RTCViewPip")
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
27
40
  return
28
41
  }
29
42
  DispatchQueue.main.async {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stream-io/video-react-native-sdk",
3
- "version": "1.20.1-alpha.2",
3
+ "version": "1.20.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/",
@@ -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": "workspace:^",
128
+ "@stream-io/noise-cancellation-react-native": "^0.2.0",
129
129
  "@stream-io/react-native-webrtc": "^125.4.0",
130
- "@stream-io/video-filters-react-native": "workspace:^",
130
+ "@stream-io/video-filters-react-native": "^0.6.0",
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.1-alpha.1';
1
+ export const version = '1.20.1';
@@ -1,14 +0,0 @@
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>