vdocipher-rn-bridge 1.17.6 → 1.19.0
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 +3 -3
- package/android/src/main/java/com/vdocipher/rnbridge/ReactVdoPlayerUIView.java +1 -1
- package/android/src/main/java/com/vdocipher/rnbridge/ReactVdoPlayerUIViewManager.java +0 -5
- package/android/src/main/java/com/vdocipher/rnbridge/ReactVdoPlayerViewManager.java +0 -5
- package/android/src/main/java/com/vdocipher/rnbridge/VdoDownloadModule.java +21 -0
- package/android/src/main/java/com/vdocipher/rnbridge/VdocipherRnBridgeModule.java +0 -5
- package/downloads.ts +23 -0
- package/ios/VdocipherRnBridgeViewManager.swift +1 -1
- package/package.json +2 -2
- package/react-native-vdocipher-rn-bridge.podspec +1 -1
- package/type.ts +0 -10
package/android/build.gradle
CHANGED
|
@@ -18,8 +18,8 @@ apply plugin: 'com.android.library'
|
|
|
18
18
|
// TODO read from package.json
|
|
19
19
|
// "releaseVersionName" must be the same as "version" in package.json
|
|
20
20
|
// "releaseVersionCode" must increment by 1 with every release
|
|
21
|
-
def releaseVersionName = "1.
|
|
22
|
-
def releaseVersionCode =
|
|
21
|
+
def releaseVersionName = "1.19.0"
|
|
22
|
+
def releaseVersionCode = 29
|
|
23
23
|
|
|
24
24
|
android {
|
|
25
25
|
compileSdkVersion 33
|
|
@@ -86,5 +86,5 @@ repositories {
|
|
|
86
86
|
dependencies {
|
|
87
87
|
compileOnly 'com.facebook.react:react-native:+'
|
|
88
88
|
implementation 'androidx.appcompat:appcompat:1.3.1'
|
|
89
|
-
implementation 'com.vdocipher.aegis:vdocipher-android:1.
|
|
89
|
+
implementation 'com.vdocipher.aegis:vdocipher-android:1.25.0'
|
|
90
90
|
}
|
|
@@ -92,7 +92,7 @@ public class ReactVdoPlayerUIView extends FrameLayout implements LifecycleEventL
|
|
|
92
92
|
fragmentManager.beginTransaction().replace(getId(), vdoPlayerUIFragment, "VdoPlayerUIFragmentRN").commitAllowingStateLoss();
|
|
93
93
|
fragmentManager.executePendingTransactions();
|
|
94
94
|
if (isRunningOnTv(activity)) {
|
|
95
|
-
vdoPlayerControlView = vdoPlayerUIFragment.requireView().findViewById(R.id.vdo_player_control_view);
|
|
95
|
+
vdoPlayerControlView = vdoPlayerUIFragment.requireView().findViewById(com.vdocipher.aegis.R.id.vdo_player_control_view);
|
|
96
96
|
}
|
|
97
97
|
// initialize the playerFragment; a VdoPlayer instance will be received
|
|
98
98
|
// in onInitializationSuccess() callback
|
|
@@ -68,8 +68,6 @@ public class ReactVdoPlayerUIViewManager extends ViewGroupManager<ReactVdoPlayer
|
|
|
68
68
|
boolean enableAutoResume = embedInfo.hasKey("enableAutoResume") && embedInfo.getBoolean("enableAutoResume");
|
|
69
69
|
String preferredCaptionsLanguage = embedInfo.hasKey("preferredCaptionsLanguage") ?
|
|
70
70
|
embedInfo.getString("preferredCaptionsLanguage") : null;
|
|
71
|
-
String safetyNetApiKey = embedInfo.hasKey("safetyNetApiKey") ?
|
|
72
|
-
embedInfo.getString("safetyNetApiKey") : null;
|
|
73
71
|
boolean allowAdbDebugging = !embedInfo.hasKey("allowAdbDebugging") ||
|
|
74
72
|
embedInfo.getBoolean("allowAdbDebugging");
|
|
75
73
|
|
|
@@ -78,9 +76,6 @@ public class ReactVdoPlayerUIViewManager extends ViewGroupManager<ReactVdoPlayer
|
|
|
78
76
|
if (enableAutoResume) {
|
|
79
77
|
builder.enableAutoResume();
|
|
80
78
|
}
|
|
81
|
-
if (safetyNetApiKey != null) {
|
|
82
|
-
builder.setSafetyNetApiKey(safetyNetApiKey);
|
|
83
|
-
}
|
|
84
79
|
if (preferredCaptionsLanguage != null) {
|
|
85
80
|
builder.setPreferredCaptionsLanguage(preferredCaptionsLanguage);
|
|
86
81
|
}
|
|
@@ -69,8 +69,6 @@ public class ReactVdoPlayerViewManager extends ViewGroupManager<ReactVdoPlayerVi
|
|
|
69
69
|
boolean enableAutoResume = embedInfo.hasKey("enableAutoResume") && embedInfo.getBoolean("enableAutoResume");
|
|
70
70
|
String preferredCaptionsLanguage = embedInfo.hasKey("preferredCaptionsLanguage") ?
|
|
71
71
|
embedInfo.getString("preferredCaptionsLanguage") : null;
|
|
72
|
-
String safetyNetApiKey = embedInfo.hasKey("safetyNetApiKey") ?
|
|
73
|
-
embedInfo.getString("safetyNetApiKey") : null;
|
|
74
72
|
boolean allowAdbDebugging = !embedInfo.hasKey("allowAdbDebugging") ||
|
|
75
73
|
embedInfo.getBoolean("allowAdbDebugging");
|
|
76
74
|
|
|
@@ -79,9 +77,6 @@ public class ReactVdoPlayerViewManager extends ViewGroupManager<ReactVdoPlayerVi
|
|
|
79
77
|
if (enableAutoResume) {
|
|
80
78
|
builder.enableAutoResume();
|
|
81
79
|
}
|
|
82
|
-
if (safetyNetApiKey != null) {
|
|
83
|
-
builder.setSafetyNetApiKey(safetyNetApiKey);
|
|
84
|
-
}
|
|
85
80
|
if (preferredCaptionsLanguage != null) {
|
|
86
81
|
builder.setPreferredCaptionsLanguage(preferredCaptionsLanguage);
|
|
87
82
|
}
|
|
@@ -243,6 +243,27 @@ public class VdoDownloadModule extends ReactContextBaseJavaModule implements Vdo
|
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
245
|
|
|
246
|
+
@ReactMethod
|
|
247
|
+
public void isExpired(String mediaId,
|
|
248
|
+
Callback errorCallback,
|
|
249
|
+
Callback successCallback) {
|
|
250
|
+
try {
|
|
251
|
+
VdoDownloadManager.Query query = new VdoDownloadManager.Query();
|
|
252
|
+
query.setFilterByMediaId(mediaId);
|
|
253
|
+
VdoDownloadManager vdoDownloadManager = VdoDownloadManager.getInstance(getReactApplicationContext());
|
|
254
|
+
vdoDownloadManager.query(query, statusList -> {
|
|
255
|
+
Log.i(TAG, statusList.size() + " results found");
|
|
256
|
+
boolean isExpired = statusList.get(0).isExpired(getReactApplicationContext());
|
|
257
|
+
successCallback.invoke(
|
|
258
|
+
isExpired
|
|
259
|
+
);
|
|
260
|
+
});
|
|
261
|
+
} catch (RuntimeException e) {
|
|
262
|
+
Log.e(TAG, "error fetching expiry: " + Log.getStackTraceString(e));
|
|
263
|
+
errorCallback.invoke(e.getClass().getName(), e.getMessage());
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
246
267
|
@Override
|
|
247
268
|
public void onCatalystInstanceDestroy() {
|
|
248
269
|
super.onCatalystInstanceDestroy();
|
|
@@ -44,8 +44,6 @@ public class VdocipherRnBridgeModule extends ReactContextBaseJavaModule {
|
|
|
44
44
|
boolean enableAutoResume = embedInfo.hasKey("enableAutoResume") && embedInfo.getBoolean("enableAutoResume");
|
|
45
45
|
String preferredCaptionsLanguage = embedInfo.hasKey("preferredCaptionsLanguage") ?
|
|
46
46
|
embedInfo.getString("preferredCaptionsLanguage") : null;
|
|
47
|
-
String safetyNetApiKey = embedInfo.hasKey("safetyNetApiKey") ?
|
|
48
|
-
embedInfo.getString("safetyNetApiKey") : null;
|
|
49
47
|
boolean allowAdbDebugging = !embedInfo.hasKey("allowAdbDebugging") ||
|
|
50
48
|
embedInfo.getBoolean("allowAdbDebugging");
|
|
51
49
|
|
|
@@ -54,9 +52,6 @@ public class VdocipherRnBridgeModule extends ReactContextBaseJavaModule {
|
|
|
54
52
|
if (enableAutoResume) {
|
|
55
53
|
builder.enableAutoResume();
|
|
56
54
|
}
|
|
57
|
-
if (safetyNetApiKey != null) {
|
|
58
|
-
builder.setSafetyNetApiKey(safetyNetApiKey);
|
|
59
|
-
}
|
|
60
55
|
if (preferredCaptionsLanguage != null) {
|
|
61
56
|
builder.setPreferredCaptionsLanguage(preferredCaptionsLanguage);
|
|
62
57
|
}
|
package/downloads.ts
CHANGED
|
@@ -117,6 +117,28 @@ const resume = (mediaIds: Array<string>) => {
|
|
|
117
117
|
});
|
|
118
118
|
};
|
|
119
119
|
|
|
120
|
+
const isExpired = (mediaId: string) => {
|
|
121
|
+
|
|
122
|
+
if (Platform.OS == 'ios') {
|
|
123
|
+
console.warn("Download expiry method not supported in iOS");
|
|
124
|
+
return new Promise(function(resolve, reject) {
|
|
125
|
+
reject({errorCode: -1, errorMsg: "Download expiry method not supported in iOS", httpStatusCode: -1});
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return new Promise(function(resolve, reject) {
|
|
130
|
+
VdoDownload.isExpired(
|
|
131
|
+
mediaId,
|
|
132
|
+
(exception: string, msg: string) => {
|
|
133
|
+
reject({exception, msg});
|
|
134
|
+
},
|
|
135
|
+
(isExpired: boolean) => {
|
|
136
|
+
resolve(isExpired);
|
|
137
|
+
}
|
|
138
|
+
);
|
|
139
|
+
});
|
|
140
|
+
};
|
|
141
|
+
|
|
120
142
|
export default VdoDownload;
|
|
121
143
|
|
|
122
144
|
module.exports = {
|
|
@@ -125,6 +147,7 @@ module.exports = {
|
|
|
125
147
|
remove,
|
|
126
148
|
stop,
|
|
127
149
|
resume,
|
|
150
|
+
isExpired,
|
|
128
151
|
addEventListener
|
|
129
152
|
};
|
|
130
153
|
|
|
@@ -5,7 +5,7 @@ import VdoFramework
|
|
|
5
5
|
@objc(VdocipherRnBridge)
|
|
6
6
|
class VdocipherRnBridge: RCTViewManager {
|
|
7
7
|
|
|
8
|
-
static let vdocipherRnBridgeVersionString = "1.
|
|
8
|
+
static let vdocipherRnBridgeVersionString = "1.19.0"
|
|
9
9
|
|
|
10
10
|
@objc override static func requiresMainQueueSetup() -> Bool {
|
|
11
11
|
return true
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vdocipher-rn-bridge",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.19.0",
|
|
4
4
|
"description": "React native bridge library that delegates to vdocipher native android SDK",
|
|
5
5
|
"homepage": "https://www.vdocipher.com/docs/mobile/react-native/getting-started/",
|
|
6
6
|
"scripts": {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"author": "",
|
|
13
13
|
"license": "",
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"react-native": "0.68 - 0.
|
|
15
|
+
"react-native": "0.68 - 0.73"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"deprecated-react-native-prop-types": "^2.3.0",
|
|
@@ -17,7 +17,7 @@ Pod::Spec.new do |s|
|
|
|
17
17
|
s.source_files = "ios/**/*.{h,m,mm,swift}"
|
|
18
18
|
|
|
19
19
|
s.dependency "React-Core"
|
|
20
|
-
s.dependency "VdoFramework", "2.5.
|
|
20
|
+
s.dependency "VdoFramework", "2.5.4"
|
|
21
21
|
|
|
22
22
|
# Don't install the dependencies when we run `pod install` in the old architecture.
|
|
23
23
|
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
|
package/type.ts
CHANGED
|
@@ -20,10 +20,6 @@ export interface EmbedInfo {
|
|
|
20
20
|
*/
|
|
21
21
|
bufferingGoalMs?: number | null;
|
|
22
22
|
enableAutoResume?: boolean | null;
|
|
23
|
-
/**
|
|
24
|
-
* Not supported in iOS
|
|
25
|
-
*/
|
|
26
|
-
safetyNetApiKey?: string | null;
|
|
27
23
|
preferredCaptionsLanguage?: string | null;
|
|
28
24
|
/**
|
|
29
25
|
* @deprecated
|
|
@@ -43,10 +39,6 @@ export type OfflineEmbedInfo = {
|
|
|
43
39
|
offline: boolean;
|
|
44
40
|
mediaId: string;
|
|
45
41
|
enableAutoResume?: boolean | null;
|
|
46
|
-
/**
|
|
47
|
-
* Not supported in iOS
|
|
48
|
-
*/
|
|
49
|
-
safetyNetApiKey?: string | null;
|
|
50
42
|
preferredCaptionsLanguage?: string | null;
|
|
51
43
|
/**
|
|
52
44
|
* @deprecated
|
|
@@ -161,7 +153,6 @@ export const VdoPropTypes = {
|
|
|
161
153
|
maxVideoBitrateKbps: PropTypes.number,
|
|
162
154
|
bufferingGoalMs: PropTypes.number,
|
|
163
155
|
enableAutoResume: PropTypes.bool,
|
|
164
|
-
safetyNetApiKey: PropTypes.string,
|
|
165
156
|
preferredCaptionsLanguage: PropTypes.string,
|
|
166
157
|
playerConfig: PropTypes.string,
|
|
167
158
|
customPlayerId: PropTypes.string,
|
|
@@ -170,7 +161,6 @@ export const VdoPropTypes = {
|
|
|
170
161
|
offline: PropTypes.bool.isRequired,
|
|
171
162
|
mediaId: PropTypes.string.isRequired,
|
|
172
163
|
enableAutoResume: PropTypes.bool,
|
|
173
|
-
safetyNetApiKey: PropTypes.string,
|
|
174
164
|
preferredCaptionsLanguage: PropTypes.string,
|
|
175
165
|
playerConfig: PropTypes.string,
|
|
176
166
|
})
|