@stream-io/video-react-native-sdk 0.3.9 → 0.3.11

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/CHANGELOG.md CHANGED
@@ -2,6 +2,19 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ### [0.3.11](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-0.3.10...@stream-io/video-react-native-sdk-0.3.11) (2024-01-19)
6
+
7
+ ### Dependency Updates
8
+
9
+ * `@stream-io/video-client` updated to version `0.5.6`
10
+ * `@stream-io/video-react-bindings` updated to version `0.3.17`
11
+ ### [0.3.10](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-0.3.9...@stream-io/video-react-native-sdk-0.3.10) (2024-01-16)
12
+
13
+
14
+ ### Features
15
+
16
+ * **react-native:** add support for kotlin in expo config plugin ([#1239](https://github.com/GetStream/stream-video-js/issues/1239)) ([d285e32](https://github.com/GetStream/stream-video-js/commit/d285e32940cf3864932cc6053f8e66bc164bceb0)), closes [#1231](https://github.com/GetStream/stream-video-js/issues/1231)
17
+
5
18
  ### [0.3.9](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-0.3.8...@stream-io/video-react-native-sdk-0.3.9) (2024-01-16)
6
19
 
7
20
  ### Dependency Updates
@@ -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 = '0.3.9';
7
+ const version = exports.version = '0.3.11';
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,OAAO"}
1
+ {"version":3,"names":["version","exports"],"sourceRoot":"../../src","sources":["version.ts"],"mappings":";;;;;;AAAO,MAAMA,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAG,QAAQ"}
@@ -1,2 +1,2 @@
1
- export const version = '0.3.9';
1
+ export const version = '0.3.11';
2
2
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["version"],"sourceRoot":"../../src","sources":["version.ts"],"mappings":"AAAA,OAAO,MAAMA,OAAO,GAAG,OAAO"}
1
+ {"version":3,"names":["version"],"sourceRoot":"../../src","sources":["version.ts"],"mappings":"AAAA,OAAO,MAAMA,OAAO,GAAG,QAAQ"}
@@ -1,2 +1,2 @@
1
- export declare const version = "0.3.9";
1
+ export declare const version = "0.3.11";
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,UAAU,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,WAAW,CAAC"}
@@ -8,64 +8,83 @@ const codeMod_1 = require("@expo/config-plugins/build/android/codeMod");
8
8
  const addNewLinesToMainActivity_1 = __importDefault(require("./common/addNewLinesToMainActivity"));
9
9
  const withStreamVideoReactNativeSDKMainActivity = (configuration, props) => {
10
10
  return (0, config_plugins_1.withMainActivity)(configuration, (config) => {
11
- if (['java'].includes(config.modResults.language)) {
12
- try {
13
- /*
14
- import com.streamvideo.reactnative.StreamVideoReactNative;
15
- import android.util.Rational;
16
- import androidx.lifecycle.Lifecycle;
17
- import android.app.PictureInPictureParams;
18
- */
19
- config.modResults.contents = (0, codeMod_1.addImports)(config.modResults.contents, [
20
- 'com.streamvideo.reactnative.StreamVideoReactNative',
21
- 'android.os.Build',
22
- 'android.util.Rational',
23
- 'androidx.lifecycle.Lifecycle',
24
- 'android.app.PictureInPictureParams',
25
- ], config.modResults.language === 'java');
26
- config.modResults.contents = addOnPictureInPictureModeChanged(config.modResults.contents);
27
- if (props?.androidPictureInPicture?.enableAutomaticEnter) {
28
- config.modResults.contents = addOnUserLeaveHint(config.modResults.contents);
29
- }
30
- }
31
- catch (error) {
32
- throw new Error("Cannot add StreamVideoReactNativeSDK to the project's MainApplication because it's malformed.");
11
+ const isMainActivityJava = config.modResults.language === 'java';
12
+ try {
13
+ config.modResults.contents = (0, codeMod_1.addImports)(config.modResults.contents, [
14
+ 'com.streamvideo.reactnative.StreamVideoReactNative',
15
+ 'android.os.Build',
16
+ 'android.util.Rational',
17
+ 'androidx.lifecycle.Lifecycle',
18
+ 'android.app.PictureInPictureParams',
19
+ ], isMainActivityJava);
20
+ config.modResults.contents = addOnPictureInPictureModeChanged(config.modResults.contents, isMainActivityJava);
21
+ if (props?.androidPictureInPicture?.enableAutomaticEnter) {
22
+ config.modResults.contents = addOnUserLeaveHint(config.modResults.contents, isMainActivityJava);
33
23
  }
34
24
  }
35
- else {
36
- throw new Error('Cannot setup StreamVideoReactNativeSDK because the MainApplication is not in Java');
25
+ catch (error) {
26
+ throw new Error("Cannot add StreamVideoReactNativeSDK to the project's MainApplication because it's malformed.");
37
27
  }
38
28
  return config;
39
29
  });
40
30
  };
41
- function addOnPictureInPictureModeChanged(contents) {
31
+ function addOnPictureInPictureModeChanged(contents, isJava) {
42
32
  if (!contents.includes('StreamVideoReactNative.onPictureInPictureModeChanged')) {
43
- const statementToInsert = `
44
- @Override
45
- public void onPictureInPictureModeChanged(boolean isInPictureInPictureMode) {
46
- super.onPictureInPictureModeChanged(isInPictureInPictureMode);
47
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && getLifecycle().getCurrentState() == Lifecycle.State.CREATED) {
48
- // when user clicks on Close button of PIP
49
- finishAndRemoveTask();
50
- } else {
51
- StreamVideoReactNative.onPictureInPictureModeChanged(isInPictureInPictureMode);
52
- }
53
- }`;
33
+ let statementToInsert = '';
34
+ if (isJava) {
35
+ statementToInsert = `
36
+ @Override
37
+ public void onPictureInPictureModeChanged(boolean isInPictureInPictureMode) {
38
+ super.onPictureInPictureModeChanged(isInPictureInPictureMode);
39
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && getLifecycle().getCurrentState() == Lifecycle.State.CREATED) {
40
+ // when user clicks on Close button of PIP
41
+ finishAndRemoveTask();
42
+ } else {
43
+ StreamVideoReactNative.onPictureInPictureModeChanged(isInPictureInPictureMode);
44
+ }
45
+ }`;
46
+ }
47
+ else {
48
+ // Kotlin
49
+ statementToInsert = `
50
+ override fun onPictureInPictureModeChanged(isInPictureInPictureMode: Boolean) {
51
+ super.onPictureInPictureModeChanged(isInPictureInPictureMode)
52
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && lifecycle.currentState == Lifecycle.State.CREATED) {
53
+ // when user clicks on Close button of PIP
54
+ finishAndRemoveTask()
55
+ } else {
56
+ StreamVideoReactNative.onPictureInPictureModeChanged(isInPictureInPictureMode)
57
+ }
58
+ }`;
59
+ }
54
60
  contents = (0, addNewLinesToMainActivity_1.default)(contents, statementToInsert.trim().split('\n'));
55
61
  }
56
62
  return contents;
57
63
  }
58
- function addOnUserLeaveHint(contents) {
64
+ function addOnUserLeaveHint(contents, isJava) {
59
65
  if (!contents.includes('StreamVideoReactNative.canAutoEnterPictureInPictureMode')) {
60
- const statementToInsert = `
61
- @Override
62
- public void onUserLeaveHint () {
63
- if (StreamVideoReactNative.canAutoEnterPictureInPictureMode) {
64
- PictureInPictureParams.Builder builder = new PictureInPictureParams.Builder();
65
- builder.setAspectRatio(new Rational(480, 640));
66
- enterPictureInPictureMode(builder.build());
67
- }
68
- }`;
66
+ let statementToInsert = '';
67
+ if (isJava) {
68
+ statementToInsert = `
69
+ @Override
70
+ public void onUserLeaveHint () {
71
+ if (StreamVideoReactNative.canAutoEnterPictureInPictureMode) {
72
+ PictureInPictureParams.Builder builder = new PictureInPictureParams.Builder();
73
+ builder.setAspectRatio(new Rational(480, 640));
74
+ enterPictureInPictureMode(builder.build());
75
+ }
76
+ }`;
77
+ }
78
+ else {
79
+ statementToInsert = `
80
+ override fun onUserLeaveHint () {
81
+ if (StreamVideoReactNative.canAutoEnterPictureInPictureMode) {
82
+ val builder = PictureInPictureParams.Builder()
83
+ builder.setAspectRatio(Rational(480, 640))
84
+ enterPictureInPictureMode(builder.build())
85
+ }
86
+ }`;
87
+ }
69
88
  contents = (0, addNewLinesToMainActivity_1.default)(contents, statementToInsert.trim().split('\n'));
70
89
  }
71
90
  return contents;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stream-io/video-react-native-sdk",
3
- "version": "0.3.9",
3
+ "version": "0.3.11",
4
4
  "packageManager": "yarn@3.2.4",
5
5
  "main": "dist/commonjs/index.js",
6
6
  "module": "dist/module/index.js",
@@ -45,8 +45,8 @@
45
45
  "!**/.*"
46
46
  ],
47
47
  "dependencies": {
48
- "@stream-io/video-client": "^0.5.5",
49
- "@stream-io/video-react-bindings": "^0.3.16",
48
+ "@stream-io/video-client": "^0.5.6",
49
+ "@stream-io/video-react-bindings": "^0.3.17",
50
50
  "intl-pluralrules": "2.0.1",
51
51
  "lodash.merge": "^4.6.2",
52
52
  "react-native-url-polyfill": "1.3.0",
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '0.3.9';
1
+ export const version = '0.3.11';