@100mslive/react-native-video-plugin 1.0.0 → 1.1.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.
- package/android/build.gradle +4 -4
- package/android/gradle.properties +5 -5
- package/android/src/main/java/com/hms/reactnativevideoplugin/ReactNativeVideoPluginModule.kt +1 -1
- package/lib/commonjs/HMSVirtualBackgroundPlugin.js +11 -0
- package/lib/commonjs/HMSVirtualBackgroundPlugin.js.map +1 -1
- package/lib/module/HMSVirtualBackgroundPlugin.js +11 -0
- package/lib/module/HMSVirtualBackgroundPlugin.js.map +1 -1
- package/package.json +13 -12
- package/sdk-versions.json +1 -1
- package/src/HMSVirtualBackgroundPlugin.ts +19 -1
package/android/build.gradle
CHANGED
|
@@ -12,7 +12,7 @@ buildscript {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
dependencies {
|
|
15
|
-
classpath "com.android.tools.build:gradle:7.2
|
|
15
|
+
classpath "com.android.tools.build:gradle:8.7.2"
|
|
16
16
|
// noinspection DifferentKotlinGradleVersion
|
|
17
17
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
18
18
|
}
|
|
@@ -71,13 +71,13 @@ android {
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
lint {
|
|
75
75
|
disable "GradleCompatible"
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
compileOptions {
|
|
79
|
-
sourceCompatibility JavaVersion.
|
|
80
|
-
targetCompatibility JavaVersion.
|
|
79
|
+
sourceCompatibility JavaVersion.VERSION_17
|
|
80
|
+
targetCompatibility JavaVersion.VERSION_17
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
ReactNativeVideoPlugin_kotlinVersion=
|
|
2
|
-
ReactNativeVideoPlugin_minSdkVersion=
|
|
3
|
-
ReactNativeVideoPlugin_targetSdkVersion=
|
|
4
|
-
ReactNativeVideoPlugin_compileSdkVersion=
|
|
5
|
-
ReactNativeVideoPlugin_ndkversion=
|
|
1
|
+
ReactNativeVideoPlugin_kotlinVersion=2.0.21
|
|
2
|
+
ReactNativeVideoPlugin_minSdkVersion=24
|
|
3
|
+
ReactNativeVideoPlugin_targetSdkVersion=35
|
|
4
|
+
ReactNativeVideoPlugin_compileSdkVersion=35
|
|
5
|
+
ReactNativeVideoPlugin_ndkversion=27.1.12297006
|
package/android/src/main/java/com/hms/reactnativevideoplugin/ReactNativeVideoPluginModule.kt
CHANGED
|
@@ -71,7 +71,7 @@ class ReactNativeVideoPluginModule(reactContext: ReactApplicationContext) :
|
|
|
71
71
|
}
|
|
72
72
|
try {
|
|
73
73
|
val bitmap: Bitmap? =
|
|
74
|
-
if (bgImageUri.startsWith("http://")) {
|
|
74
|
+
if (bgImageUri.startsWith("http://") || bgImageUri.startsWith("https://")) {
|
|
75
75
|
val url = URL(bgImageUri)
|
|
76
76
|
BitmapFactory.decodeStream(url.openConnection().getInputStream())
|
|
77
77
|
} else if (bgImageUri.startsWith("file://")) {
|
|
@@ -55,6 +55,17 @@ class HMSVirtualBackgroundPlugin extends _HMSVideoPlugin.HMSVideoPlugin {
|
|
|
55
55
|
}
|
|
56
56
|
exports.HMSVirtualBackgroundPlugin = HMSVirtualBackgroundPlugin;
|
|
57
57
|
function resolveBackground(background) {
|
|
58
|
+
// Check if it's a remote URL with dimensions already provided
|
|
59
|
+
if (typeof background === 'object' && 'uri' in background && background.uri && (background.uri.startsWith('http://') || background.uri.startsWith('https://')) && background.width && background.height) {
|
|
60
|
+
// For remote URLs with dimensions, pass them through directly
|
|
61
|
+
// Don't use Image.resolveAssetSource() as it doesn't handle remote URLs properly
|
|
62
|
+
return {
|
|
63
|
+
type: 'image',
|
|
64
|
+
source: background
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// For bundled assets (require()) or local file:// URLs, use resolveAssetSource
|
|
58
69
|
return {
|
|
59
70
|
type: 'image',
|
|
60
71
|
source: _reactNative.Image.resolveAssetSource(background)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_HMSVideoPlugin","HMSVirtualBackgroundPlugin","HMSVideoPlugin","NAME","constructor","setBlur","blurRadius","data","id","background","type","nativeModule","changeVirtualBackground","setBackground","backgroundImage","resolveBackground","exports","source","Image","resolveAssetSource"],"sourceRoot":"../../src","sources":["HMSVirtualBackgroundPlugin.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAOA,IAAAC,eAAA,GAAAD,OAAA;AAEO,MAAME,0BAA0B,SAASC,8BAAc,CAAC;EAC7D,OAAOC,IAAI,GAAG,4BAA4B;EAE1CC,WAAWA,CAAA,EAAG;IACZ,KAAK,CAACH,0BAA0B,CAACE,IAAI,CAAC;EACxC;;EAEA;AACF;AACA;AACA;EACEE,OAAOA,CAACC,UAAkB,EAAoB;IAC5C,MAAMC,IAAI,GAAG;MACXC,EAAE,EAAE,OAAO;MACXC,UAAU,EAAE;QAAEC,IAAI,EAAE,MAAM;QAAEJ;MAAW;IACzC,CAAC;IACD,OAAO,IAAI,CAACK,YAAY,CAACC,uBAAuB,CAACL,IAAI,CAAC;EACxD;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEM,aAAaA,CACXC,eAAoD,EAClC;IAClB,MAAML,UAAU,GAAGM,iBAAiB,CAACD,eAAe,CAAC;IACrD,MAAMP,IAAI,GAAG;MACXC,EAAE,EAAE,OAAO;MACXC;IACF,CAAC;IACD,OAAO,IAAI,CAACE,YAAY,CAACC,uBAAuB,CAACL,IAAI,CAAC;EACxD;AACF;AAACS,OAAA,CAAAf,0BAAA,GAAAA,0BAAA;AAED,SAASc,iBAAiBA,CAACN,UAA+C,EAGxE;EACA,OAAO;IACLC,IAAI,EAAE,OAAO;
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_HMSVideoPlugin","HMSVirtualBackgroundPlugin","HMSVideoPlugin","NAME","constructor","setBlur","blurRadius","data","id","background","type","nativeModule","changeVirtualBackground","setBackground","backgroundImage","resolveBackground","exports","uri","startsWith","width","height","source","Image","resolveAssetSource"],"sourceRoot":"../../src","sources":["HMSVirtualBackgroundPlugin.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAOA,IAAAC,eAAA,GAAAD,OAAA;AAEO,MAAME,0BAA0B,SAASC,8BAAc,CAAC;EAC7D,OAAOC,IAAI,GAAG,4BAA4B;EAE1CC,WAAWA,CAAA,EAAG;IACZ,KAAK,CAACH,0BAA0B,CAACE,IAAI,CAAC;EACxC;;EAEA;AACF;AACA;AACA;EACEE,OAAOA,CAACC,UAAkB,EAAoB;IAC5C,MAAMC,IAAI,GAAG;MACXC,EAAE,EAAE,OAAO;MACXC,UAAU,EAAE;QAAEC,IAAI,EAAE,MAAM;QAAEJ;MAAW;IACzC,CAAC;IACD,OAAO,IAAI,CAACK,YAAY,CAACC,uBAAuB,CAACL,IAAI,CAAC;EACxD;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEM,aAAaA,CACXC,eAAoD,EAClC;IAClB,MAAML,UAAU,GAAGM,iBAAiB,CAACD,eAAe,CAAC;IACrD,MAAMP,IAAI,GAAG;MACXC,EAAE,EAAE,OAAO;MACXC;IACF,CAAC;IACD,OAAO,IAAI,CAACE,YAAY,CAACC,uBAAuB,CAACL,IAAI,CAAC;EACxD;AACF;AAACS,OAAA,CAAAf,0BAAA,GAAAA,0BAAA;AAED,SAASc,iBAAiBA,CAACN,UAA+C,EAGxE;EACA;EACA,IACE,OAAOA,UAAU,KAAK,QAAQ,IAC9B,KAAK,IAAIA,UAAU,IACnBA,UAAU,CAACQ,GAAG,KACbR,UAAU,CAACQ,GAAG,CAACC,UAAU,CAAC,SAAS,CAAC,IAAIT,UAAU,CAACQ,GAAG,CAACC,UAAU,CAAC,UAAU,CAAC,CAAC,IAC/ET,UAAU,CAACU,KAAK,IAChBV,UAAU,CAACW,MAAM,EACjB;IACA;IACA;IACA,OAAO;MACLV,IAAI,EAAE,OAAO;MACbW,MAAM,EAAEZ;IACV,CAAC;EACH;;EAEA;EACA,OAAO;IACLC,IAAI,EAAE,OAAO;IACbW,MAAM,EAAEC,kBAAK,CAACC,kBAAkB,CAACd,UAAU;EAC7C,CAAC;AACH","ignoreList":[]}
|
|
@@ -48,6 +48,17 @@ export class HMSVirtualBackgroundPlugin extends HMSVideoPlugin {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
function resolveBackground(background) {
|
|
51
|
+
// Check if it's a remote URL with dimensions already provided
|
|
52
|
+
if (typeof background === 'object' && 'uri' in background && background.uri && (background.uri.startsWith('http://') || background.uri.startsWith('https://')) && background.width && background.height) {
|
|
53
|
+
// For remote URLs with dimensions, pass them through directly
|
|
54
|
+
// Don't use Image.resolveAssetSource() as it doesn't handle remote URLs properly
|
|
55
|
+
return {
|
|
56
|
+
type: 'image',
|
|
57
|
+
source: background
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// For bundled assets (require()) or local file:// URLs, use resolveAssetSource
|
|
51
62
|
return {
|
|
52
63
|
type: 'image',
|
|
53
64
|
source: Image.resolveAssetSource(background)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Image","HMSVideoPlugin","HMSVirtualBackgroundPlugin","NAME","constructor","setBlur","blurRadius","data","id","background","type","nativeModule","changeVirtualBackground","setBackground","backgroundImage","resolveBackground","source","resolveAssetSource"],"sourceRoot":"../../src","sources":["HMSVirtualBackgroundPlugin.ts"],"mappings":"AAAA,SAASA,KAAK,QAAQ,cAAc;AAOpC,SAASC,cAAc,QAAQ,kBAAkB;AAEjD,OAAO,MAAMC,0BAA0B,SAASD,cAAc,CAAC;EAC7D,OAAOE,IAAI,GAAG,4BAA4B;EAE1CC,WAAWA,CAAA,EAAG;IACZ,KAAK,CAACF,0BAA0B,CAACC,IAAI,CAAC;EACxC;;EAEA;AACF;AACA;AACA;EACEE,OAAOA,CAACC,UAAkB,EAAoB;IAC5C,MAAMC,IAAI,GAAG;MACXC,EAAE,EAAE,OAAO;MACXC,UAAU,EAAE;QAAEC,IAAI,EAAE,MAAM;QAAEJ;MAAW;IACzC,CAAC;IACD,OAAO,IAAI,CAACK,YAAY,CAACC,uBAAuB,CAACL,IAAI,CAAC;EACxD;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEM,aAAaA,CACXC,eAAoD,EAClC;IAClB,MAAML,UAAU,GAAGM,iBAAiB,CAACD,eAAe,CAAC;IACrD,MAAMP,IAAI,GAAG;MACXC,EAAE,EAAE,OAAO;MACXC;IACF,CAAC;IACD,OAAO,IAAI,CAACE,YAAY,CAACC,uBAAuB,CAACL,IAAI,CAAC;EACxD;AACF;AAEA,SAASQ,iBAAiBA,CAACN,UAA+C,EAGxE;EACA,OAAO;IACLC,IAAI,EAAE,OAAO;
|
|
1
|
+
{"version":3,"names":["Image","HMSVideoPlugin","HMSVirtualBackgroundPlugin","NAME","constructor","setBlur","blurRadius","data","id","background","type","nativeModule","changeVirtualBackground","setBackground","backgroundImage","resolveBackground","uri","startsWith","width","height","source","resolveAssetSource"],"sourceRoot":"../../src","sources":["HMSVirtualBackgroundPlugin.ts"],"mappings":"AAAA,SAASA,KAAK,QAAQ,cAAc;AAOpC,SAASC,cAAc,QAAQ,kBAAkB;AAEjD,OAAO,MAAMC,0BAA0B,SAASD,cAAc,CAAC;EAC7D,OAAOE,IAAI,GAAG,4BAA4B;EAE1CC,WAAWA,CAAA,EAAG;IACZ,KAAK,CAACF,0BAA0B,CAACC,IAAI,CAAC;EACxC;;EAEA;AACF;AACA;AACA;EACEE,OAAOA,CAACC,UAAkB,EAAoB;IAC5C,MAAMC,IAAI,GAAG;MACXC,EAAE,EAAE,OAAO;MACXC,UAAU,EAAE;QAAEC,IAAI,EAAE,MAAM;QAAEJ;MAAW;IACzC,CAAC;IACD,OAAO,IAAI,CAACK,YAAY,CAACC,uBAAuB,CAACL,IAAI,CAAC;EACxD;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEM,aAAaA,CACXC,eAAoD,EAClC;IAClB,MAAML,UAAU,GAAGM,iBAAiB,CAACD,eAAe,CAAC;IACrD,MAAMP,IAAI,GAAG;MACXC,EAAE,EAAE,OAAO;MACXC;IACF,CAAC;IACD,OAAO,IAAI,CAACE,YAAY,CAACC,uBAAuB,CAACL,IAAI,CAAC;EACxD;AACF;AAEA,SAASQ,iBAAiBA,CAACN,UAA+C,EAGxE;EACA;EACA,IACE,OAAOA,UAAU,KAAK,QAAQ,IAC9B,KAAK,IAAIA,UAAU,IACnBA,UAAU,CAACO,GAAG,KACbP,UAAU,CAACO,GAAG,CAACC,UAAU,CAAC,SAAS,CAAC,IAAIR,UAAU,CAACO,GAAG,CAACC,UAAU,CAAC,UAAU,CAAC,CAAC,IAC/ER,UAAU,CAACS,KAAK,IAChBT,UAAU,CAACU,MAAM,EACjB;IACA;IACA;IACA,OAAO;MACLT,IAAI,EAAE,OAAO;MACbU,MAAM,EAAEX;IACV,CAAC;EACH;;EAEA;EACA,OAAO;IACLC,IAAI,EAAE,OAAO;IACbU,MAAM,EAAEpB,KAAK,CAACqB,kBAAkB,CAACZ,UAAU;EAC7C,CAAC;AACH","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@100mslive/react-native-video-plugin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "HMSSDK now provides support for Virtual Background using @100mslive/react-native-video-plugin. It allows users to change their background during a call. Users can choose from a variety of backgrounds or upload their own custom background. It also provides a feature to blur the background.",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
"type": "git",
|
|
115
115
|
"url": "git+https://github.com/100mslive/react-native-video-plugin.git"
|
|
116
116
|
},
|
|
117
|
-
"author": "
|
|
117
|
+
"author": "Yogesh Singh (https://www.100ms.live/)",
|
|
118
118
|
"license": "MIT",
|
|
119
119
|
"bugs": {
|
|
120
120
|
"url": "https://github.com/100mslive/react-native-video-plugin/issues"
|
|
@@ -124,13 +124,13 @@
|
|
|
124
124
|
"registry": "https://registry.npmjs.org/"
|
|
125
125
|
},
|
|
126
126
|
"devDependencies": {
|
|
127
|
-
"@100mslive/react-native-hms": "
|
|
127
|
+
"@100mslive/react-native-hms": "1.12.0",
|
|
128
128
|
"@commitlint/config-conventional": "^17.0.2",
|
|
129
129
|
"@evilmartians/lefthook": "^1.5.0",
|
|
130
|
-
"@react-native/babel-preset": "
|
|
131
|
-
"@react-native/eslint-config": "
|
|
130
|
+
"@react-native/babel-preset": "0.78.1",
|
|
131
|
+
"@react-native/eslint-config": "0.78.1",
|
|
132
132
|
"@types/jest": "^29.5.5",
|
|
133
|
-
"@types/react": "^
|
|
133
|
+
"@types/react": "^19.0.6",
|
|
134
134
|
"commitlint": "^17.0.2",
|
|
135
135
|
"del-cli": "^5.1.0",
|
|
136
136
|
"eslint": "^8.51.0",
|
|
@@ -138,24 +138,25 @@
|
|
|
138
138
|
"eslint-plugin-prettier": "^5.0.1",
|
|
139
139
|
"jest": "^29.7.0",
|
|
140
140
|
"prettier": "^3.0.3",
|
|
141
|
-
"react": "
|
|
142
|
-
"react-native": "0.
|
|
141
|
+
"react": "19.0.0",
|
|
142
|
+
"react-native": "0.78.1",
|
|
143
143
|
"react-native-builder-bob": "^0.20.0",
|
|
144
144
|
"turbo": "^1.10.7",
|
|
145
|
-
"typescript": "^5.
|
|
145
|
+
"typescript": "^5.7.3"
|
|
146
146
|
},
|
|
147
147
|
"resolutions": {
|
|
148
|
-
"@types/react": "^
|
|
148
|
+
"@types/react": "^19.0.6",
|
|
149
|
+
"image-size": "2.0.2"
|
|
149
150
|
},
|
|
150
151
|
"peerDependencies": {
|
|
151
|
-
"@100mslive/react-native-hms": "
|
|
152
|
+
"@100mslive/react-native-hms": "1.12.0",
|
|
152
153
|
"react": "*",
|
|
153
154
|
"react-native": "*"
|
|
154
155
|
},
|
|
155
156
|
"workspaces": [
|
|
156
157
|
"example"
|
|
157
158
|
],
|
|
158
|
-
"packageManager": "yarn@
|
|
159
|
+
"packageManager": "yarn@4.10.3",
|
|
159
160
|
"jest": {
|
|
160
161
|
"preset": "react-native",
|
|
161
162
|
"modulePathIgnorePatterns": [
|
package/sdk-versions.json
CHANGED
|
@@ -57,8 +57,26 @@ export class HMSVirtualBackgroundPlugin extends HMSVideoPlugin {
|
|
|
57
57
|
|
|
58
58
|
function resolveBackground(background: ImageURISource | ImageRequireSource): {
|
|
59
59
|
type: 'image';
|
|
60
|
-
source: ImageResolvedAssetSource;
|
|
60
|
+
source: ImageResolvedAssetSource | ImageURISource;
|
|
61
61
|
} {
|
|
62
|
+
// Check if it's a remote URL with dimensions already provided
|
|
63
|
+
if (
|
|
64
|
+
typeof background === 'object' &&
|
|
65
|
+
'uri' in background &&
|
|
66
|
+
background.uri &&
|
|
67
|
+
(background.uri.startsWith('http://') || background.uri.startsWith('https://')) &&
|
|
68
|
+
background.width &&
|
|
69
|
+
background.height
|
|
70
|
+
) {
|
|
71
|
+
// For remote URLs with dimensions, pass them through directly
|
|
72
|
+
// Don't use Image.resolveAssetSource() as it doesn't handle remote URLs properly
|
|
73
|
+
return {
|
|
74
|
+
type: 'image',
|
|
75
|
+
source: background as ImageURISource,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// For bundled assets (require()) or local file:// URLs, use resolveAssetSource
|
|
62
80
|
return {
|
|
63
81
|
type: 'image',
|
|
64
82
|
source: Image.resolveAssetSource(background),
|