vdocipher-rn-bridge 1.13.0 → 1.13.2

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/CHANGELOG.md CHANGED
@@ -1,4 +1,13 @@
1
1
  ## Changelog
2
+ ### 1.13.2
3
+ * Updated VdoCipher android sdk dependency to 1.19.4
4
+ * Updated playerConfig to customPlayer Id
5
+ * Added customPlayerId for Downloads
6
+ * Bug fix
7
+
8
+ ### 1.13.1
9
+ * Added resizeMode attribute in style prop
10
+
2
11
  ### 1.13.0
3
12
  * Updated VdoCipher android sdk dependency to 1.19.3
4
13
  * Added support for setting aspect ratio and resize mode
@@ -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.13.0"
22
- def releaseVersionCode = 15
21
+ def releaseVersionName = "1.13.2"
22
+ def releaseVersionCode = 17
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.19.3'
89
+ implementation 'com.vdocipher.aegis:vdocipher-android:1.19.4'
90
90
  }
@@ -57,8 +57,6 @@ public class ReactVdoPlayerUIViewManager extends ViewGroupManager<ReactVdoPlayer
57
57
  boolean enableAutoResume = embedInfo.hasKey("enableAutoResume") && embedInfo.getBoolean("enableAutoResume");
58
58
  String preferredCaptionsLanguage = embedInfo.hasKey("preferredCaptionsLanguage") ?
59
59
  embedInfo.getString("preferredCaptionsLanguage") : null;
60
- String playerConfig = embedInfo.hasKey("playerConfig") ?
61
- embedInfo.getString("playerConfig") : null;
62
60
  String safetyNetApiKey = embedInfo.hasKey("safetyNetApiKey") ?
63
61
  embedInfo.getString("safetyNetApiKey") : null;
64
62
  boolean allowAdbDebugging = !embedInfo.hasKey("allowAdbDebugging") ||
@@ -72,9 +70,6 @@ public class ReactVdoPlayerUIViewManager extends ViewGroupManager<ReactVdoPlayer
72
70
  if (safetyNetApiKey != null) {
73
71
  builder.setSafetyNetApiKey(safetyNetApiKey);
74
72
  }
75
- if (playerConfig != null) {
76
- builder.setPlayerConfig(playerConfig);
77
- }
78
73
  if (preferredCaptionsLanguage != null) {
79
74
  builder.setPreferredCaptionsLanguage(preferredCaptionsLanguage);
80
75
  }
@@ -97,6 +92,12 @@ public class ReactVdoPlayerUIViewManager extends ViewGroupManager<ReactVdoPlayer
97
92
  int bufferingGoalMs = embedInfo.hasKey("bufferingGoalMs") ?
98
93
  embedInfo.getInt("bufferingGoalMs") : 0;
99
94
  String[] overrides = getTechOverride(embedInfo);
95
+ String customPlayerId = null;
96
+ if (embedInfo.hasKey("customPlayerId")) {
97
+ customPlayerId = embedInfo.getString("customPlayerId");
98
+ } else if (embedInfo.hasKey("playerConfig")) {
99
+ customPlayerId = embedInfo.getString("playerConfig");
100
+ }
100
101
 
101
102
  builder.setOtp(otp)
102
103
  .setPlaybackInfo(playbackInfo)
@@ -111,6 +112,9 @@ public class ReactVdoPlayerUIViewManager extends ViewGroupManager<ReactVdoPlayer
111
112
  if (overrides != null) {
112
113
  builder.setTechOverride(overrides);
113
114
  }
115
+ if (customPlayerId != null) {
116
+ builder.setCustomPlayer(customPlayerId);
117
+ }
114
118
  }
115
119
 
116
120
  initParams = builder.build();
@@ -62,11 +62,16 @@ public class VdoDownloadModule extends ReactContextBaseJavaModule implements Vdo
62
62
  Callback successCallback) {
63
63
  String otp = optionParams.getString("otp");
64
64
  String playbackInfo = optionParams.getString("playbackInfo");
65
+ String customPlayerId = null;
66
+ if (optionParams.getString("customPlayerId") != null) {
67
+ customPlayerId = optionParams.getString("customPlayerId");
68
+ }
69
+
65
70
 
66
71
  OptionsDownloader optionsDownloader = new OptionsDownloader(getReactApplicationContext());
67
72
 
68
73
  try {
69
- optionsDownloader.downloadOptionsWithOtp(otp, playbackInfo, null, new OptionsDownloader.Callback() {
74
+ optionsDownloader.downloadOptionsWithOtp(otp, playbackInfo, customPlayerId, new OptionsDownloader.Callback() {
70
75
  @Override
71
76
  public void onOptionsReceived(DownloadOptions options) {
72
77
  Log.i(TAG, "onOptionsReceived");
package/downloads.ts CHANGED
@@ -12,7 +12,7 @@ import * as VdoTypes from './type';
12
12
 
13
13
  const { VdoDownload } = NativeModules;
14
14
 
15
- const getDownloadOptions = (optionParams: VdoTypes.EmbedInfo) => {
15
+ const getDownloadOptions = (optionParams: VdoTypes.OfflineOptionParams) => {
16
16
 
17
17
  return new Promise(function(resolve, reject) {
18
18
  VdoDownload.getDownloadOptions(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vdocipher-rn-bridge",
3
- "version": "1.13.0",
3
+ "version": "1.13.2",
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": {
package/type.ts CHANGED
@@ -10,7 +10,12 @@ export interface EmbedInfo {
10
10
  enableAutoResume?: boolean | null;
11
11
  safetyNetApiKey?: string | null;
12
12
  preferredCaptionsLanguage?: string | null;
13
+ /**
14
+ * @deprecated
15
+ * Use {@link customPlayerId} instead.
16
+ */
13
17
  playerConfig?: string | null;
18
+ customPlayerId?: string | null;
14
19
  /**
15
20
  * @deprecated
16
21
  * This property is no longer required to enable PIP mode.
@@ -25,10 +30,20 @@ export type OfflineEmbedInfo = {
25
30
  enableAutoResume?: boolean | null;
26
31
  safetyNetApiKey?: string | null;
27
32
  preferredCaptionsLanguage?: string | null;
33
+ /**
34
+ * @deprecated
35
+ * This id will be ignored and the customPlayerId passed while downloading will be used
36
+ */
28
37
  playerConfig?: string | null;
29
38
  setPictureInPictureSupport?: boolean | null;
30
39
  }
31
40
 
41
+ export type OfflineOptionParams = {
42
+ otp: string;
43
+ playbackInfo: string;
44
+ customPlayerId?: string;
45
+ }
46
+
32
47
  export interface MediaInfo {
33
48
  mediaId: string;
34
49
  type: string;
@@ -122,6 +137,7 @@ export const VdoPropTypes = {
122
137
  safetyNetApiKey: PropTypes.string,
123
138
  preferredCaptionsLanguage: PropTypes.string,
124
139
  playerConfig: PropTypes.string,
140
+ customPlayerId: PropTypes.string,
125
141
  }),
126
142
  PropTypes.shape({
127
143
  offline: PropTypes.bool.isRequired,
@@ -132,7 +148,9 @@ export const VdoPropTypes = {
132
148
  playerConfig: PropTypes.string,
133
149
  })
134
150
  ]).isRequired,
135
- style: PropTypes.object,
151
+ style: PropTypes.shape({
152
+ resizeMode: PropTypes.string,
153
+ }),
136
154
  showNativeControls: PropTypes.bool,
137
155
  playWhenReady: PropTypes.bool,
138
156
  playbackSpeed: PropTypes.number,