vdocipher-rn-bridge 1.20.7 → 1.20.9
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/VdoPlayerUIView.tsx +8 -0
- package/VdoPlayerView.tsx +42 -0
- package/android/build.gradle +3 -3
- package/android/src/main/java/com/vdocipher/rnbridge/ReactVdoPlayerUIView.java +18 -0
- package/android/src/main/java/com/vdocipher/rnbridge/ReactVdoPlayerUIViewManager.java +0 -5
- package/android/src/main/java/com/vdocipher/rnbridge/ReactVdoPlayerView.java +38 -20
- package/android/src/main/java/com/vdocipher/rnbridge/ReactVdoPlayerViewManager.java +0 -5
- package/android/src/main/java/com/vdocipher/rnbridge/VdoDownloadModule.java +0 -6
- package/android/src/main/java/com/vdocipher/rnbridge/VdoPlayerActivity.java +18 -0
- package/android/src/main/java/com/vdocipher/rnbridge/VdoPlayerControlView.java +13 -0
- package/android/src/main/java/com/vdocipher/rnbridge/VdocipherRnBridgeModule.java +0 -5
- package/ios/RCTVdoPlayerUIView.swift +0 -2
- package/ios/RCTVdoPlayerView.swift +0 -3
- package/ios/VdoCipherRNView.swift +4 -16
- package/ios/VdoDownload.swift +5 -5
- package/ios/VdocipherRnBridgeViewManager.m +1 -0
- package/ios/VdocipherRnBridgeViewManager.swift +1 -1
- package/navigationHelper.ts +8 -0
- package/package.json +4 -3
- package/react-native-vdocipher-rn-bridge.podspec +1 -1
package/VdoPlayerUIView.tsx
CHANGED
|
@@ -65,6 +65,14 @@
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
+
setScreenFocused() {
|
|
69
|
+
this._root.setNativeProps({screenFocused: true});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
setScreenBlurred() {
|
|
73
|
+
this._root.setNativeProps({screenFocused: false});
|
|
74
|
+
}
|
|
75
|
+
|
|
68
76
|
handleBackButtonClick() {
|
|
69
77
|
this._root.setNativeProps({backpressCalled: this._propRef++});
|
|
70
78
|
}
|
package/VdoPlayerView.tsx
CHANGED
|
@@ -7,6 +7,9 @@ import { BackHandler, NativeModules, StyleSheet, Dimensions, NativeEventEmitter,
|
|
|
7
7
|
import VdoPlayerSupportView from './VdoPlayerSupportView';
|
|
8
8
|
import VdoPlayerUIView from './VdoPlayerUIView';
|
|
9
9
|
import * as VdoType from './type';
|
|
10
|
+
import { getNavigationContext } from './navigationHelper';
|
|
11
|
+
let NavigationContext: React.Context<any> | null = getNavigationContext();
|
|
12
|
+
|
|
10
13
|
const { TrackSelection, VdoPlayer, VdoEventEmitter } = NativeModules;
|
|
11
14
|
|
|
12
15
|
const VdoViewPropTypes = VdoType.VdoPropTypes;
|
|
@@ -22,6 +25,8 @@ class VdoPlayerView extends Component<MyProps, MyState> {
|
|
|
22
25
|
_vdoPlayerView: any;
|
|
23
26
|
static propTypes: typeof VdoViewPropTypes;
|
|
24
27
|
eventEmitter: NativeEventEmitter;
|
|
28
|
+
focusListener: (() => void) | undefined;
|
|
29
|
+
blurListener: (() => void) | undefined;
|
|
25
30
|
|
|
26
31
|
constructor(props: MyProps) {
|
|
27
32
|
super(props);
|
|
@@ -74,6 +79,10 @@ class VdoPlayerView extends Component<MyProps, MyState> {
|
|
|
74
79
|
this.eventEmitter.addListener('onVdoPlaybackSpeedChanged', (data) => {
|
|
75
80
|
this._onPlaybackSpeedChanged(data);
|
|
76
81
|
})
|
|
82
|
+
|
|
83
|
+
if (Platform.OS == "ios" && !(this.props.showNativeControls === false)) {
|
|
84
|
+
this.addFocusListeners();
|
|
85
|
+
}
|
|
77
86
|
}
|
|
78
87
|
|
|
79
88
|
componentWillUnmount() {
|
|
@@ -89,8 +98,38 @@ class VdoPlayerView extends Component<MyProps, MyState> {
|
|
|
89
98
|
this.eventEmitter.removeAllListeners('onVdoEnterFullscreen');
|
|
90
99
|
this.eventEmitter.removeAllListeners('onVdoExitFullscreen');
|
|
91
100
|
this.eventEmitter.removeAllListeners('onVdoPlaybackSpeedChanged');
|
|
101
|
+
|
|
102
|
+
if (Platform.OS == "ios" && !(this.props.showNativeControls === false)) {
|
|
103
|
+
this.removeFocusListeners();
|
|
104
|
+
}
|
|
92
105
|
}
|
|
93
106
|
|
|
107
|
+
addFocusListeners() {
|
|
108
|
+
|
|
109
|
+
if (NavigationContext) {
|
|
110
|
+
const navigation: any = this.context;
|
|
111
|
+
this.focusListener = navigation.addListener('focus', this.onScreenFocused);
|
|
112
|
+
this.blurListener = navigation.addListener('blur', this.onScreenBlurred);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
removeFocusListeners() {
|
|
117
|
+
this.focusListener && this.focusListener();
|
|
118
|
+
this.blurListener && this.blurListener();
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
onScreenFocused = () => {
|
|
122
|
+
if (this._vdoPlayerView) {
|
|
123
|
+
this._vdoPlayerView.setScreenFocused();
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
onScreenBlurred = () => {
|
|
128
|
+
if (this._vdoPlayerView) {
|
|
129
|
+
this._vdoPlayerView.setScreenBlurred();
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
|
|
94
133
|
handleBackButtonClick() {
|
|
95
134
|
if (!this.state.isInPictureInPictureMode && this.state.fullscreen && !(this.props.showNativeControls === false)) {
|
|
96
135
|
this._vdoPlayerView.handleBackButtonClick();
|
|
@@ -425,6 +464,9 @@ class VdoPlayerView extends Component<MyProps, MyState> {
|
|
|
425
464
|
}
|
|
426
465
|
}
|
|
427
466
|
|
|
467
|
+
if (NavigationContext) {
|
|
468
|
+
VdoPlayerView.contextType = NavigationContext; // Assign the context type only if NavigationContext is available
|
|
469
|
+
}
|
|
428
470
|
VdoPlayerView.propTypes = VdoViewPropTypes;
|
|
429
471
|
|
|
430
472
|
export default VdoPlayerView;
|
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.20.
|
|
22
|
-
def releaseVersionCode =
|
|
21
|
+
def releaseVersionName = "1.20.9"
|
|
22
|
+
def releaseVersionCode = 41
|
|
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.28.4'
|
|
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
|
|
|
@@ -305,7 +308,7 @@ public class ReactVdoPlayerView extends LinearLayout implements LifecycleEventLi
|
|
|
305
308
|
*/
|
|
306
309
|
private void updatePlaybackState(
|
|
307
310
|
@PlaybackStateCompat.State int state, long position, float playBackSpeed) {
|
|
308
|
-
if (mSession == null) return;
|
|
311
|
+
if (mSession == null || mSession.getController() == null || mSession.getController().getPlaybackState() == null) return;
|
|
309
312
|
long actions = mSession.getController().getPlaybackState().getActions();
|
|
310
313
|
updatePlaybackState(state, actions, position, playBackSpeed);
|
|
311
314
|
}
|
|
@@ -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
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
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
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
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
|
}
|
|
@@ -18,9 +18,6 @@ class RCTVdoPlayerView: VdoCipherRNView {
|
|
|
18
18
|
override func setEmbedInfo(_ embedInfo: [String: Any]) {
|
|
19
19
|
super.setEmbedInfo(embedInfo)
|
|
20
20
|
EventEmitter.sharedInstance.dispatch(name: EventName.EVENT_LOADING, params: nil)
|
|
21
|
-
DispatchQueue.main.asyncAfter(deadline: .now() + 0.33 , execute: {
|
|
22
|
-
self.reactViewController().navigationController?.delegate = self
|
|
23
|
-
})
|
|
24
21
|
if embedInfo["offline"] as? Bool == true {
|
|
25
22
|
self.parseOfflineCredentials(fromInfo: embedInfo)
|
|
26
23
|
} else {
|
|
@@ -326,6 +326,10 @@ class VdoCipherRNView: UIView {
|
|
|
326
326
|
|
|
327
327
|
asset.enableAutoAdaptation()
|
|
328
328
|
}
|
|
329
|
+
|
|
330
|
+
@objc func setScreenFocused(_ val: Bool) {
|
|
331
|
+
setPlayWhenReady(val)
|
|
332
|
+
}
|
|
329
333
|
|
|
330
334
|
func setCaptionLanguage(lanCode: String?) -> Bool {
|
|
331
335
|
var isSuccess: Bool = false
|
|
@@ -431,22 +435,6 @@ extension VdoCipherRNView: VdoPlayerViewControllerDelegate {
|
|
|
431
435
|
}
|
|
432
436
|
}
|
|
433
437
|
|
|
434
|
-
extension VdoCipherRNView: UINavigationControllerDelegate {
|
|
435
|
-
// MARK: 'UINavigationControllerDelegate' FUNCTIONS
|
|
436
|
-
func navigationController(_ navigationController: UINavigationController, willShow viewController: UIViewController, animated: Bool) {
|
|
437
|
-
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
func navigationController(_ navigationController: UINavigationController, didShow viewController: UIViewController, animated: Bool) {
|
|
441
|
-
guard let parentController = self.reactViewController() else {return}
|
|
442
|
-
if viewController != parentController {
|
|
443
|
-
player?.pause()
|
|
444
|
-
} else if viewController == parentController {
|
|
445
|
-
player?.rate = targetPlaybackSpeed
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
|
|
450
438
|
enum PlayerState : String {
|
|
451
439
|
case buffering = "buffering",
|
|
452
440
|
ready = "ready",
|
package/ios/VdoDownload.swift
CHANGED
|
@@ -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
|
}
|
|
@@ -30,6 +30,7 @@ RCT_EXPORT_VIEW_PROPERTY(disableCaptions, int)
|
|
|
30
30
|
RCT_EXPORT_VIEW_PROPERTY(videoQuality, NSDictionary *)
|
|
31
31
|
RCT_EXPORT_VIEW_PROPERTY(adaptiveVideo, BOOL)
|
|
32
32
|
RCT_EXPORT_VIEW_PROPERTY(fullscreen, BOOL)
|
|
33
|
+
RCT_EXPORT_VIEW_PROPERTY(screenFocused, BOOL)
|
|
33
34
|
|
|
34
35
|
- (VdoCipherRNView *)view
|
|
35
36
|
{
|
|
@@ -5,7 +5,7 @@ import VdoFramework
|
|
|
5
5
|
@objc(VdocipherRnBridge)
|
|
6
6
|
class VdocipherRnBridge: RCTViewManager {
|
|
7
7
|
|
|
8
|
-
static let vdocipherRnBridgeVersionString = "1.20.
|
|
8
|
+
static let vdocipherRnBridgeVersionString = "1.20.9"
|
|
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.
|
|
3
|
+
"version": "1.20.9",
|
|
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.75"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"deprecated-react-native-prop-types": "^2.3.0",
|
|
@@ -30,7 +30,8 @@
|
|
|
30
30
|
"index.ts",
|
|
31
31
|
"tsconfig.json",
|
|
32
32
|
"type.ts",
|
|
33
|
-
"react-native-vdocipher-rn-bridge.podspec"
|
|
33
|
+
"react-native-vdocipher-rn-bridge.podspec",
|
|
34
|
+
"navigationHelper.ts"
|
|
34
35
|
],
|
|
35
36
|
"devDependencies": {
|
|
36
37
|
"@tsconfig/react-native": "^2.0.3",
|
|
@@ -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.
|
|
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
|