vdocipher-rn-bridge 1.18.0 → 1.19.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.
@@ -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.18.0"
22
- def releaseVersionCode = 28
21
+ def releaseVersionName = "1.19.1"
22
+ def releaseVersionCode = 30
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.24.1'
89
+ implementation 'com.vdocipher.aegis:vdocipher-android:1.25.1'
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
@@ -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();
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.18.0"
8
+ static let vdocipherRnBridgeVersionString = "1.19.1"
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.18.0",
3
+ "version": "1.19.1",
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.72.4"
15
+ "react-native": "0.68 - 0.73"
16
16
  },
17
17
  "dependencies": {
18
18
  "deprecated-react-native-prop-types": "^2.3.0",