vdocipher-rn-bridge 1.20.8 → 1.20.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.
@@ -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.20.8"
22
- def releaseVersionCode = 40
21
+ def releaseVersionName = "1.20.10"
22
+ def releaseVersionCode = 42
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.26.9'
89
+ implementation 'com.vdocipher.aegis:vdocipher-android:1.28.6'
90
90
  }
@@ -40,6 +40,9 @@ import com.facebook.react.bridge.ReadableMap;
40
40
 
41
41
  import com.vdocipher.aegis.ui.view.FullScreenActionListener;
42
42
 
43
+ import com.vdocipher.aegis.media.PlayerOption;
44
+ import com.vdocipher.aegis.player.VdoTimeLine;
45
+
43
46
 
44
47
  public class ReactVdoPlayerUIView extends LinearLayout implements LifecycleEventListener {
45
48
  private static final String TAG = "ReactVdoPlayerUIView";
@@ -452,6 +455,11 @@ public class ReactVdoPlayerUIView extends LinearLayout implements LifecycleEvent
452
455
  Log.e(TAG, msg);
453
456
  eventEmitter.initFailure(errorDescription);
454
457
  }
458
+
459
+ @Override
460
+ public void onDeInitializationSuccess() {
461
+
462
+ }
455
463
  };
456
464
 
457
465
  public void load(VdoInitParams params) {
@@ -537,6 +545,16 @@ public class ReactVdoPlayerUIView extends LinearLayout implements LifecycleEvent
537
545
  Log.i(TAG, "onMediaEnded");
538
546
  eventEmitter.mediaEnded(vdoInitParams);
539
547
  }
548
+
549
+ @Override
550
+ public void onMetaDataLoaded(PlayerOption playerOption) {
551
+ Log.i(TAG, "onMetaDataLoaded");
552
+ }
553
+
554
+ @Override
555
+ public void onTimelineChanged(VdoTimeLine a,int b) {
556
+ Log.i(TAG, "onTimelineChanged");
557
+ }
540
558
  };
541
559
 
542
560
 
@@ -103,8 +103,6 @@ public class ReactVdoPlayerUIViewManager extends ViewGroupManager<ReactVdoPlayer
103
103
  && embedInfo.getBoolean("forceHighestSupportedBitrate");
104
104
  int maxVideoBitrateKbps = embedInfo.hasKey("maxVideoBitrateKbps") ?
105
105
  embedInfo.getInt("maxVideoBitrateKbps") : Integer.MAX_VALUE;
106
- int bufferingGoalMs = embedInfo.hasKey("bufferingGoalMs") ?
107
- embedInfo.getInt("bufferingGoalMs") : 0;
108
106
  String[] overrides = getTechOverride(embedInfo);
109
107
  String customPlayerId = null;
110
108
  if (embedInfo.hasKey("customPlayerId")) {
@@ -126,9 +124,6 @@ public class ReactVdoPlayerUIViewManager extends ViewGroupManager<ReactVdoPlayer
126
124
  .setForceHighestSupportedBitrate(forceHighestSupportedBitrate)
127
125
  .setMaxVideoBitrateKbps(maxVideoBitrateKbps);
128
126
 
129
- if (bufferingGoalMs > 0) {
130
- builder.setBufferingGoalMs(bufferingGoalMs);
131
- }
132
127
  if (overrides != null) {
133
128
  builder.setTechOverride(overrides);
134
129
  }
@@ -47,6 +47,9 @@ import android.graphics.Color;
47
47
  import android.view.Gravity;
48
48
  import android.widget.LinearLayout;
49
49
 
50
+ import com.vdocipher.aegis.media.PlayerOption;
51
+ import com.vdocipher.aegis.player.VdoTimeLine;
52
+
50
53
  public class ReactVdoPlayerView extends LinearLayout implements LifecycleEventListener {
51
54
  private static final String TAG = "ReactVdoPlayerView";
52
55
 
@@ -521,29 +524,34 @@ public class ReactVdoPlayerView extends LinearLayout implements LifecycleEventLi
521
524
  // InitializationListener impl
522
525
 
523
526
  PlayerHost.InitializationListener initializationListener = new PlayerHost.InitializationListener() {
524
- @Override
525
- public void onInitializationSuccess(PlayerHost playerHost, VdoPlayer player, boolean restored) {
526
- Log.d(TAG, "init success");
527
- vdoPlayer = player;
528
- availableTracks = vdoPlayer.getAvailableTracks();
529
- selectedTracks = vdoPlayer.getSelectedTracks();
530
- vdoPlayer.addPlaybackEventListener(playbackListener);
531
- eventEmitter.initSuccess(restored);
527
+ @Override
528
+ public void onInitializationSuccess(PlayerHost playerHost, VdoPlayer player, boolean restored) {
529
+ Log.d(TAG, "init success");
530
+ vdoPlayer = player;
531
+ availableTracks = vdoPlayer.getAvailableTracks();
532
+ selectedTracks = vdoPlayer.getSelectedTracks();
533
+ vdoPlayer.addPlaybackEventListener(playbackListener);
534
+ eventEmitter.initSuccess(restored);
535
+
536
+ // load pending params
537
+ if (pendingInitParams != null) {
538
+ Log.d(TAG, "load pending params");
539
+ load(pendingInitParams);
540
+ pendingInitParams = null;
541
+ }
532
542
 
533
- // load pending params
534
- if (pendingInitParams != null) {
535
- Log.d(TAG, "load pending params");
536
- load(pendingInitParams);
537
- pendingInitParams = null;
538
543
  }
539
544
 
540
- }
545
+ @Override
546
+ public void onInitializationFailure(PlayerHost playerHost, ErrorDescription errorDescription) {
547
+ Log.e(TAG, "init failure: " + errorDescription.toString());
548
+ eventEmitter.initFailure(errorDescription);
549
+ }
541
550
 
542
- @Override
543
- public void onInitializationFailure(PlayerHost playerHost, ErrorDescription errorDescription) {
544
- Log.e(TAG, "init failure: " + errorDescription.toString());
545
- eventEmitter.initFailure(errorDescription);
546
- }
551
+ @Override
552
+ public void onDeInitializationSuccess() {
553
+
554
+ }
547
555
 
548
556
  };
549
557
 
@@ -664,5 +672,15 @@ private final VdoPlayer.PlaybackEventListener playbackListener = new VdoPlayer.P
664
672
  selectedTracks = tracksSelected;
665
673
  eventEmitter.tracksChanged(availableTracks, selectedTracks);
666
674
  }
675
+
676
+ @Override
677
+ public void onMetaDataLoaded(PlayerOption playerOption) {
678
+ Log.i(TAG, "onMetaDataLoaded");
679
+ }
680
+
681
+ @Override
682
+ public void onTimelineChanged(VdoTimeLine a,int b) {
683
+ Log.i(TAG, "onTimelineChanged");
684
+ }
667
685
  };
668
686
  }
@@ -104,8 +104,6 @@ public class ReactVdoPlayerViewManager extends ViewGroupManager<ReactVdoPlayerVi
104
104
  && embedInfo.getBoolean("forceHighestSupportedBitrate");
105
105
  int maxVideoBitrateKbps = embedInfo.hasKey("maxVideoBitrateKbps") ?
106
106
  embedInfo.getInt("maxVideoBitrateKbps") : Integer.MAX_VALUE;
107
- int bufferingGoalMs = embedInfo.hasKey("bufferingGoalMs") ?
108
- embedInfo.getInt("bufferingGoalMs") : 0;
109
107
  String[] overrides = getTechOverride(embedInfo);
110
108
 
111
109
  if (token != null && mediaId != null) {
@@ -121,9 +119,6 @@ public class ReactVdoPlayerViewManager extends ViewGroupManager<ReactVdoPlayerVi
121
119
  .setForceHighestSupportedBitrate(forceHighestSupportedBitrate)
122
120
  .setMaxVideoBitrateKbps(maxVideoBitrateKbps);
123
121
 
124
- if (bufferingGoalMs > 0) {
125
- builder.setBufferingGoalMs(bufferingGoalMs);
126
- }
127
122
  if (overrides != null) {
128
123
  builder.setTechOverride(overrides);
129
124
  }
@@ -293,12 +293,6 @@ public class VdoDownloadModule extends ReactContextBaseJavaModule implements Vdo
293
293
  }
294
294
  }
295
295
 
296
- @Override
297
- public void onCatalystInstanceDestroy() {
298
- super.onCatalystInstanceDestroy();
299
- // TODO unregister EventListener
300
- }
301
-
302
296
  // VdoDownloadManager.EventListener impl
303
297
 
304
298
  @Override
@@ -23,6 +23,9 @@ import com.vdocipher.aegis.ui.view.VdoPlayerUIFragment;
23
23
  import androidx.annotation.RequiresApi;
24
24
  import android.app.PictureInPictureParams;
25
25
 
26
+ import com.vdocipher.aegis.media.PlayerOption;
27
+ import com.vdocipher.aegis.player.VdoTimeLine;
28
+
26
29
  public class VdoPlayerActivity extends AppCompatActivity implements PlayerHost.InitializationListener {
27
30
 
28
31
  private static final String TAG = "VdoPlayerActivity";
@@ -134,6 +137,11 @@ public class VdoPlayerActivity extends AppCompatActivity implements PlayerHost.I
134
137
  Toast.makeText(VdoPlayerActivity.this, "initialization failure: " + errorDescription.errorMsg, Toast.LENGTH_LONG).show();
135
138
  }
136
139
 
140
+ @Override
141
+ public void onDeInitializationSuccess() {
142
+
143
+ }
144
+
137
145
  private VdoPlayer.PlaybackEventListener playbackListener = new VdoPlayer.PlaybackEventListener() {
138
146
  @Override
139
147
  public void onPlayerStateChanged(boolean playWhenReady, int playbackState) {
@@ -188,6 +196,16 @@ public class VdoPlayerActivity extends AppCompatActivity implements PlayerHost.I
188
196
  public void onMediaEnded(VdoInitParams vdoInitParams) {
189
197
  log("onMediaEnded");
190
198
  }
199
+
200
+ @Override
201
+ public void onMetaDataLoaded(PlayerOption playerOption) {
202
+ Log.i(TAG, "onMetaDataLoaded");
203
+ }
204
+
205
+ @Override
206
+ public void onTimelineChanged(VdoTimeLine a,int b) {
207
+ Log.i(TAG, "onTimelineChanged");
208
+ }
191
209
  };
192
210
 
193
211
  @Override
@@ -26,6 +26,9 @@ import java.util.ArrayList;
26
26
  import java.util.Arrays;
27
27
  import java.util.List;
28
28
 
29
+ import com.vdocipher.aegis.media.PlayerOption;
30
+ import com.vdocipher.aegis.player.VdoTimeLine;
31
+
29
32
  /**
30
33
  * A view for controlling playback via a VdoPlayer.
31
34
  */
@@ -567,6 +570,16 @@ public class VdoPlayerControlView extends FrameLayout {
567
570
 
568
571
  @Override
569
572
  public void onTracksChanged(Track[] availableTracks, Track[] selectedTracks) {}
573
+
574
+ @Override
575
+ public void onMetaDataLoaded(PlayerOption playerOption) {
576
+ Log.i(TAG, "onMetaDataLoaded");
577
+ }
578
+
579
+ @Override
580
+ public void onTimelineChanged(VdoTimeLine a,int b) {
581
+ Log.i(TAG, "onTimelineChanged");
582
+ }
570
583
  }
571
584
 
572
585
  /**
@@ -79,8 +79,6 @@ public class VdocipherRnBridgeModule extends ReactContextBaseJavaModule {
79
79
  && embedInfo.getBoolean("forceHighestSupportedBitrate");
80
80
  int maxVideoBitrateKbps = embedInfo.hasKey("maxVideoBitrateKbps") ?
81
81
  embedInfo.getInt("maxVideoBitrateKbps") : Integer.MAX_VALUE;
82
- int bufferingGoalMs = embedInfo.hasKey("bufferingGoalMs") ?
83
- embedInfo.getInt("bufferingGoalMs") : 0;
84
82
  String[] overrides = getTechOverride(embedInfo);
85
83
  String customPlayerId = null;
86
84
  if (embedInfo.hasKey("customPlayerId")) {
@@ -102,9 +100,6 @@ public class VdocipherRnBridgeModule extends ReactContextBaseJavaModule {
102
100
  .setForceHighestSupportedBitrate(forceHighestSupportedBitrate)
103
101
  .setMaxVideoBitrateKbps(maxVideoBitrateKbps);
104
102
 
105
- if (bufferingGoalMs > 0) {
106
- builder.setBufferingGoalMs(bufferingGoalMs);
107
- }
108
103
  if (overrides != null) {
109
104
  builder.setTechOverride(overrides);
110
105
  }
@@ -236,7 +236,7 @@ class VdoDownload: RCTEventEmitter {
236
236
  let index = selections.first,
237
237
  asset.getVideoQualities().count > index {
238
238
  // assuming index from 'availableTracksMap' is equivalent to index of 'asset.getVideoQualities()' as both are ordered pairs
239
- asset.percentDownload = 0
239
+ // asset.percentDownload = 0
240
240
  successCallback([])
241
241
 
242
242
 
@@ -263,7 +263,7 @@ class VdoDownload: RCTEventEmitter {
263
263
  let index = selections.first,
264
264
  asset.getVideoQualities().count > index {
265
265
  // assuming index from 'availableTracksMap' is equivalent to index of 'asset.getVideoQualities()' as both are ordered pairs
266
- asset.percentDownload = 0
266
+ // asset.percentDownload = 0
267
267
  successCallback([])
268
268
 
269
269
 
@@ -316,7 +316,7 @@ class VdoDownload: RCTEventEmitter {
316
316
  else if asset.downloadState == .downloaded {
317
317
  asset.deleteDownload()
318
318
  }
319
- asset.percentDownload = 0
319
+ // asset.percentDownload = 0
320
320
  DownloadEventEmitter.sharedInstance.dispatch(name: .EVENT_DELETED, params: ["mediaId": asset.videoId, "downloadStatus": CreateMap.sharedInstance.createVdoAssetMap(with: asset)])
321
321
  }
322
322
  }
@@ -379,13 +379,13 @@ class VdoDownload: RCTEventEmitter {
379
379
  }
380
380
  if let videoId = notice[VdoAsset.Keys.videoId] as? String {
381
381
  if videoId == self.asset?.videoId, let asset = asset {
382
- asset.percentDownload = percentDownload
382
+ // asset.percentDownload = percentDownload
383
383
  DownloadEventEmitter.sharedInstance.dispatch(name: .EVENT_CHANGED, params: ["mediaId": asset.videoId, "downloadStatus": CreateMap.sharedInstance.createVdoAssetMap(with: asset)])
384
384
  } else {
385
385
  let customPlayerId = VdoDownload.getCustomPlayerIdForMediaId(videoId)
386
386
  VdoAsset.createAsset(videoId: videoId, playerId: customPlayerId) { asset, _ in
387
387
  guard let asset = asset else { return }
388
- asset.percentDownload = percentDownload
388
+ // asset.percentDownload = percentDownload
389
389
  DownloadEventEmitter.sharedInstance.dispatch(name: .EVENT_CHANGED, params: ["mediaId": asset.videoId, "downloadStatus": CreateMap.sharedInstance.createVdoAssetMap(with: asset)])
390
390
  }
391
391
  }
@@ -5,7 +5,7 @@ import VdoFramework
5
5
  @objc(VdocipherRnBridge)
6
6
  class VdocipherRnBridge: RCTViewManager {
7
7
 
8
- static let vdocipherRnBridgeVersionString = "1.20.8"
8
+ static let vdocipherRnBridgeVersionString = "1.20.10"
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.20.8",
3
+ "version": "1.20.10",
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": {
@@ -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.6.0"
20
+ s.dependency "VdoFramework", "2.7.0"
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