@stream-io/video-react-native-sdk 0.3.9 → 0.3.10
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 +7 -0
- package/dist/commonjs/version.js +1 -1
- package/dist/commonjs/version.js.map +1 -1
- package/dist/module/version.js +1 -1
- package/dist/module/version.js.map +1 -1
- package/dist/typescript/version.d.ts +1 -1
- package/dist/typescript/version.d.ts.map +1 -1
- package/expo-config-plugin/dist/withMainActivity.js +65 -46
- package/package.json +1 -1
- package/src/version.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
### [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)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **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)
|
|
11
|
+
|
|
5
12
|
### [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
13
|
|
|
7
14
|
### Dependency Updates
|
package/dist/commonjs/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["version","exports"],"sourceRoot":"../../src","sources":["version.ts"],"mappings":";;;;;;AAAO,MAAMA,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAG,
|
|
1
|
+
{"version":3,"names":["version","exports"],"sourceRoot":"../../src","sources":["version.ts"],"mappings":";;;;;;AAAO,MAAMA,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAG,QAAQ"}
|
package/dist/module/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = '0.3.
|
|
1
|
+
export const version = '0.3.10';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["version"],"sourceRoot":"../../src","sources":["version.ts"],"mappings":"AAAA,OAAO,MAAMA,OAAO,GAAG,
|
|
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.
|
|
1
|
+
export declare const version = "0.3.10";
|
|
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,
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
36
|
-
throw new Error(
|
|
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
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '0.3.
|
|
1
|
+
export const version = '0.3.10';
|