vdocipher-rn-bridge 1.20.2 → 1.20.4

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.2"
22
- def releaseVersionCode = 34
21
+ def releaseVersionName = "1.20.4"
22
+ def releaseVersionCode = 36
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.3'
89
+ implementation 'com.vdocipher.aegis:vdocipher-android:1.26.4'
90
90
  }
@@ -5,11 +5,13 @@ import androidx.fragment.app.FragmentManager;
5
5
  import androidx.fragment.app.Fragment;
6
6
 
7
7
  import android.util.Log;
8
+ import android.view.View;
8
9
  import android.view.KeyEvent;
9
10
  import android.view.ViewGroup;
10
11
  import android.widget.FrameLayout;
11
12
  import android.content.pm.ActivityInfo;
12
13
  import android.view.LayoutInflater;
14
+ import android.view.Gravity;
13
15
 
14
16
  import com.facebook.react.bridge.LifecycleEventListener;
15
17
  import com.facebook.react.uimanager.ThemedReactContext;
@@ -31,6 +33,7 @@ import androidx.core.app.PictureInPictureModeChangedInfo;
31
33
  import com.facebook.react.bridge.Callback;
32
34
  import com.facebook.react.bridge.WritableMap;
33
35
  import com.facebook.react.bridge.Arguments;
36
+ import android.widget.LinearLayout;
34
37
 
35
38
  import com.facebook.react.bridge.WritableArray;
36
39
  import com.facebook.react.bridge.ReadableMap;
@@ -38,7 +41,7 @@ import com.facebook.react.bridge.ReadableMap;
38
41
  import com.vdocipher.aegis.ui.view.FullScreenActionListener;
39
42
 
40
43
 
41
- public class ReactVdoPlayerUIView extends FrameLayout implements LifecycleEventListener {
44
+ public class ReactVdoPlayerUIView extends LinearLayout implements LifecycleEventListener {
42
45
  private static final String TAG = "ReactVdoPlayerUIView";
43
46
 
44
47
  private final ThemedReactContext themedReactContext;
@@ -64,6 +67,9 @@ public class ReactVdoPlayerUIView extends FrameLayout implements LifecycleEventL
64
67
  private Track[] selectedTracks;
65
68
  private Handler mainHandler;
66
69
 
70
+ private static int FRAME_LAYOUT_OFFSET = 30;
71
+ private int frameLayoutId;
72
+
67
73
  private int resizeMode = PlayerHost.RESIZE_MODE_FIT;
68
74
 
69
75
  public ReactVdoPlayerUIView(ThemedReactContext context) {
@@ -71,8 +77,17 @@ public class ReactVdoPlayerUIView extends FrameLayout implements LifecycleEventL
71
77
  themedReactContext = context;
72
78
  activity = (AppCompatActivity) themedReactContext.getCurrentActivity();
73
79
  setKeepScreenOn(true);
80
+ setClickable(false);
81
+ setGravity(Gravity.CENTER);
74
82
  setBackgroundColor(Color.BLACK);
75
83
 
84
+ FrameLayout frameLayout = new FrameLayout(context);
85
+ frameLayout.setKeepScreenOn(true);
86
+ frameLayoutId = getId() + FRAME_LAYOUT_OFFSET;
87
+ frameLayout.setId(frameLayoutId);
88
+
89
+ addView(frameLayout);
90
+
76
91
  context.addLifecycleEventListener(this);
77
92
 
78
93
  mainHandler = new Handler(Looper.getMainLooper());
@@ -89,7 +104,7 @@ public class ReactVdoPlayerUIView extends FrameLayout implements LifecycleEventL
89
104
  new Handler().postDelayed(() -> {
90
105
  if (fragmentManager != null && !fragmentManager.isDestroyed()) {
91
106
  try {
92
- fragmentManager.beginTransaction().replace(getId(), vdoPlayerUIFragment, "VdoPlayerUIFragmentRN").commitAllowingStateLoss();
107
+ fragmentManager.beginTransaction().replace(frameLayoutId, vdoPlayerUIFragment, "VdoPlayerUIFragmentRN").commitAllowingStateLoss();
93
108
  fragmentManager.executePendingTransactions();
94
109
  if (isRunningOnTv(activity)) {
95
110
  vdoPlayerControlView = vdoPlayerUIFragment.requireView().findViewById(com.vdocipher.aegis.R.id.vdo_player_control_view);
@@ -211,6 +226,9 @@ public class ReactVdoPlayerUIView extends FrameLayout implements LifecycleEventL
211
226
  public void setResizeMode(String resizeModeName) {
212
227
  if (resizeModeName != null && !resizeModeName.isEmpty()) {
213
228
  this.resizeMode = resizeModeIntFromName(resizeModeName);
229
+ if (vdoPlayerUIFragment != null) {
230
+ vdoPlayerUIFragment.setResizeMode(this.resizeMode);
231
+ }
214
232
  }
215
233
  }
216
234
 
@@ -44,7 +44,10 @@ import com.facebook.react.bridge.WritableMap;
44
44
  import com.facebook.react.bridge.Arguments;
45
45
  import android.graphics.Color;
46
46
 
47
- public class ReactVdoPlayerView extends FrameLayout implements LifecycleEventListener {
47
+ import android.view.Gravity;
48
+ import android.widget.LinearLayout;
49
+
50
+ public class ReactVdoPlayerView extends LinearLayout implements LifecycleEventListener {
48
51
  private static final String TAG = "ReactVdoPlayerView";
49
52
 
50
53
  private final ThemedReactContext themedReactContext;
@@ -55,6 +58,9 @@ public class ReactVdoPlayerView extends FrameLayout implements LifecycleEventLis
55
58
 
56
59
  private VdoPlayer vdoPlayer;
57
60
 
61
+ private static int FRAME_LAYOUT_OFFSET = 30;
62
+ private int frameLayoutId;
63
+
58
64
  // from props
59
65
  private boolean playWhenReady = true;
60
66
  private float pendingPlaybackSpeed = 0;
@@ -86,8 +92,17 @@ public class ReactVdoPlayerView extends FrameLayout implements LifecycleEventLis
86
92
  // Get a handler that can be used to post to the main thread
87
93
  mainHandler = new Handler(Looper.getMainLooper());
88
94
  setKeepScreenOn(true);
95
+ setClickable(false);
96
+ setGravity(Gravity.CENTER);
89
97
  setBackgroundColor(Color.BLACK);
90
98
 
99
+ FrameLayout frameLayout = new FrameLayout(context);
100
+ frameLayout.setKeepScreenOn(true);
101
+ frameLayoutId = getId() + FRAME_LAYOUT_OFFSET;
102
+ frameLayout.setId(frameLayoutId);
103
+
104
+ addView(frameLayout);
105
+
91
106
  eventEmitter = new VdoEventEmitter(context);
92
107
 
93
108
  setPictureInPictureSupport();
@@ -100,7 +115,7 @@ public class ReactVdoPlayerView extends FrameLayout implements LifecycleEventLis
100
115
  new Handler().postDelayed(() -> {
101
116
  if (fragmentManager != null && !fragmentManager.isDestroyed()) {
102
117
  try {
103
- fragmentManager.beginTransaction().replace(getId(), vdoPlayerUIFragment, "VdoPlayerUIFragmentRN").commitAllowingStateLoss();
118
+ fragmentManager.beginTransaction().replace(frameLayoutId, vdoPlayerUIFragment, "VdoPlayerUIFragmentRN").commitAllowingStateLoss();
104
119
  fragmentManager.executePendingTransactions();
105
120
  // initialize the playerFragment; a VdoPlayer instance will be received
106
121
  // in onInitializationSuccess() callback
@@ -236,6 +251,9 @@ public class ReactVdoPlayerView extends FrameLayout implements LifecycleEventLis
236
251
  public void setResizeMode(String resizeModeName) {
237
252
  if (resizeModeName != null && !resizeModeName.isEmpty()) {
238
253
  this.resizeMode = resizeModeIntFromName(resizeModeName);
254
+ if (vdoPlayerUIFragment != null) {
255
+ vdoPlayerUIFragment.setResizeMode(this.resizeMode);
256
+ }
239
257
  }
240
258
  }
241
259
 
@@ -5,7 +5,7 @@ import VdoFramework
5
5
  @objc(VdocipherRnBridge)
6
6
  class VdocipherRnBridge: RCTViewManager {
7
7
 
8
- static let vdocipherRnBridgeVersionString = "1.20.2"
8
+ static let vdocipherRnBridgeVersionString = "1.20.4"
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.2",
3
+ "version": "1.20.4",
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.5.6"
20
+ s.dependency "VdoFramework", "2.5.7"
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