vdocipher-rn-bridge 1.22.7 → 2.0.0
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/VdoPlayerSupportView.tsx +12 -70
- package/VdoPlayerUIView.tsx +29 -90
- package/VdoPlayerView.tsx +36 -73
- package/android/build.gradle +23 -4
- package/android/src/main/AndroidManifest.xml +1 -2
- package/android/src/main/java/com/vdocipher/rnbridge/PlayerViewRegistry.java +34 -0
- package/android/src/main/java/com/vdocipher/rnbridge/ReactVdoPlayerUIView.java +7 -11
- package/android/src/main/java/com/vdocipher/rnbridge/{ReactVdoPlayerUIViewManager.java → ReactVdoPlayerUIViewManagerImpl.java} +66 -80
- package/android/src/main/java/com/vdocipher/rnbridge/ReactVdoPlayerView.java +8 -12
- package/android/src/main/java/com/vdocipher/rnbridge/{ReactVdoPlayerViewManager.java → ReactVdoPlayerViewManagerImpl.java} +61 -75
- package/android/src/main/java/com/vdocipher/rnbridge/TrackSelectionModuleImpl.java +64 -0
- package/android/src/main/java/com/vdocipher/rnbridge/Utils.java +27 -0
- package/android/src/main/java/com/vdocipher/rnbridge/{VdoDownloadModule.java → VdoDownloadModuleImpl.java} +23 -50
- package/android/src/main/java/com/vdocipher/rnbridge/VdoEventEmitter.java +51 -17
- package/android/src/main/java/com/vdocipher/rnbridge/VdoPlayerModuleImpl.java +28 -0
- package/android/src/main/java/com/vdocipher/rnbridge/{VdoPlayerSettingsModule.java → VdoPlayerSettingsModuleImpl.java} +3 -8
- package/android/src/main/java/com/vdocipher/rnbridge/{VdoPreCacheManagerModule.java → VdoPreCacheManagerModuleImpl.java} +3 -10
- package/android/src/main/java/com/vdocipher/rnbridge/{VdocipherRnBridgeModule.java → VdocipherRnBridgeModuleImpl.java} +5 -16
- package/android/src/main/java/com/vdocipher/rnbridge/VdocipherRnBridgePackage.java +13 -27
- package/android/src/newarch/java/com/vdocipher/rnbridge/ReactVdoPlayerUIViewManager.java +195 -0
- package/android/src/newarch/java/com/vdocipher/rnbridge/ReactVdoPlayerViewManager.java +174 -0
- package/android/src/newarch/java/com/vdocipher/rnbridge/TrackSelectionModule.java +61 -0
- package/android/src/newarch/java/com/vdocipher/rnbridge/VdoDownloadModule.java +129 -0
- package/android/src/newarch/java/com/vdocipher/rnbridge/VdoPlayerModule.java +29 -0
- package/android/src/newarch/java/com/vdocipher/rnbridge/VdoPlayerSettingsModule.java +42 -0
- package/android/src/newarch/java/com/vdocipher/rnbridge/VdoPreCacheManagerModule.java +43 -0
- package/android/src/newarch/java/com/vdocipher/rnbridge/VdocipherRnBridgeModule.java +44 -0
- package/android/src/oldarch/java/com/vdocipher/rnbridge/ReactVdoPlayerUIViewManager.java +114 -0
- package/android/src/oldarch/java/com/vdocipher/rnbridge/ReactVdoPlayerViewManager.java +109 -0
- package/android/src/oldarch/java/com/vdocipher/rnbridge/TrackSelectionModule.java +59 -0
- package/android/src/oldarch/java/com/vdocipher/rnbridge/VdoDownloadModule.java +132 -0
- package/android/src/oldarch/java/com/vdocipher/rnbridge/VdoPlayerModule.java +29 -0
- package/android/src/oldarch/java/com/vdocipher/rnbridge/VdoPlayerSettingsModule.java +40 -0
- package/android/src/oldarch/java/com/vdocipher/rnbridge/VdoPreCacheManagerModule.java +40 -0
- package/android/src/oldarch/java/com/vdocipher/rnbridge/VdocipherRnBridgeModule.java +40 -0
- package/downloads.ts +5 -5
- package/ios/RCTVdoPlayerUIView.h +4 -4
- package/ios/RCTVdoPlayerUIView.swift +2 -1
- package/ios/RCTVdoPlayerUIViewComponentView.mm +127 -0
- package/ios/RCTVdoPlayerView.swift +1 -0
- package/ios/RCTVdoPlayerViewComponentView.mm +127 -0
- package/ios/VdoCipherRNView.h +16 -3
- package/ios/VdoCipherRNView.swift +44 -8
- package/ios/VdoPlayerCommandDispatch.h +52 -0
- package/ios/VdoPreCacheManager.swift +1 -1
- package/ios/VdocipherRnBridgeViewManager.mm +234 -0
- package/ios/VdocipherRnBridgeViewManager.swift +4 -4
- package/package.json +46 -3
- package/react-native-vdocipher-rn-bridge.podspec +1 -1
- package/specs/NativeTrackSelection.ts +38 -0
- package/specs/NativeVdoDownload.ts +76 -0
- package/specs/NativeVdoEventEmitter.ts +12 -0
- package/specs/NativeVdoPlayer.ts +11 -0
- package/specs/NativeVdoPlayerSettings.ts +13 -0
- package/specs/NativeVdoPreCacheManager.ts +12 -0
- package/specs/NativeVdocipherRnBridge.ts +11 -0
- package/specs/RCTVdoPlayerUIViewNativeComponent.ts +93 -0
- package/specs/RCTVdoPlayerViewNativeComponent.ts +84 -0
- package/tsconfig.json +1 -1
- package/type.ts +84 -90
- package/android/src/main/java/com/vdocipher/rnbridge/TrackSelectionModule.java +0 -126
- package/android/src/main/java/com/vdocipher/rnbridge/VdoPlayerModule.java +0 -54
- package/ios/VdocipherRnBridgeViewManager.m +0 -126
package/type.ts
CHANGED
|
@@ -1,32 +1,19 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
+
import { StyleProp, ViewProps, ViewStyle } from 'react-native';
|
|
2
3
|
|
|
3
|
-
export type EmbedInfo = OtpEmbedInfo | TokenEmbedInfo |ExternalEmbedInfo;
|
|
4
|
+
export type EmbedInfo = OtpEmbedInfo | TokenEmbedInfo | ExternalEmbedInfo;
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
otp: string;
|
|
7
|
-
playbackInfo: string;
|
|
8
|
-
/**
|
|
9
|
-
* Not supported in iOS
|
|
10
|
-
*/
|
|
11
|
-
forceLowestBitrate?: boolean | null;
|
|
12
|
-
/**
|
|
13
|
-
* Not supported in iOS
|
|
14
|
-
*/
|
|
15
|
-
forceHighestSupportedBitrate?: boolean | null;
|
|
16
|
-
/**
|
|
17
|
-
* Not supported in iOS
|
|
18
|
-
*/
|
|
19
|
-
maxVideoBitrateKbps?: number | null;
|
|
6
|
+
interface BaseEmbedInfo {
|
|
20
7
|
enableAutoResume?: boolean | null;
|
|
21
8
|
preferredCaptionsLanguage?: string | null;
|
|
22
9
|
/**
|
|
23
|
-
* @deprecated
|
|
10
|
+
* @deprecated
|
|
24
11
|
* Use {@link customPlayerId} instead.
|
|
25
12
|
*/
|
|
26
13
|
playerConfig?: string | null;
|
|
27
14
|
customPlayerId?: string | null;
|
|
28
15
|
/**
|
|
29
|
-
* @deprecated
|
|
16
|
+
* @deprecated
|
|
30
17
|
* This property is no longer required to enable PIP mode.
|
|
31
18
|
* Use {@link https://developer.android.com/reference/android/app/Activity#enterPictureInPictureMode(android.app.PictureInPictureParams)} at activity level instead.
|
|
32
19
|
*/
|
|
@@ -36,15 +23,16 @@ export interface OtpEmbedInfo {
|
|
|
36
23
|
* Not supported in iOS
|
|
37
24
|
*/
|
|
38
25
|
allowAdbDebugging?: boolean;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
interface ClippableEmbedInfo extends BaseEmbedInfo {
|
|
39
29
|
clipStartInMs?: number | null;
|
|
40
30
|
clipEndInMs?: number | null;
|
|
41
31
|
clipped?: boolean | null;
|
|
42
32
|
clipMarkerColor?: string | null;
|
|
43
33
|
}
|
|
44
34
|
|
|
45
|
-
|
|
46
|
-
token: string;
|
|
47
|
-
mediaId: string;
|
|
35
|
+
interface AndroidBitrateOptions {
|
|
48
36
|
/**
|
|
49
37
|
* Not supported in iOS
|
|
50
38
|
*/
|
|
@@ -57,81 +45,34 @@ export interface TokenEmbedInfo {
|
|
|
57
45
|
* Not supported in iOS
|
|
58
46
|
*/
|
|
59
47
|
maxVideoBitrateKbps?: number | null;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
* This property is no longer required to enable PIP mode.
|
|
71
|
-
* Use {@link https://developer.android.com/reference/android/app/Activity#enterPictureInPictureMode(android.app.PictureInPictureParams)} at activity level instead.
|
|
72
|
-
*/
|
|
73
|
-
setPictureInPictureSupport?: boolean | null;
|
|
74
|
-
resumeTimeMs?: number | null;
|
|
75
|
-
/**
|
|
76
|
-
* Not supported in iOS
|
|
77
|
-
*/
|
|
78
|
-
allowAdbDebugging?: boolean;
|
|
79
|
-
clipStartInMs?: number | null;
|
|
80
|
-
clipEndInMs?: number | null;
|
|
81
|
-
clipped?: boolean | null;
|
|
82
|
-
clipMarkerColor?: string | null;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface OtpEmbedInfo extends ClippableEmbedInfo, AndroidBitrateOptions {
|
|
51
|
+
otp: string;
|
|
52
|
+
playbackInfo: string;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface TokenEmbedInfo extends ClippableEmbedInfo, AndroidBitrateOptions {
|
|
56
|
+
token: string;
|
|
57
|
+
mediaId: string;
|
|
83
58
|
}
|
|
84
59
|
|
|
85
60
|
/**
|
|
86
61
|
* Not supported in iOS
|
|
87
62
|
*/
|
|
88
|
-
export interface ExternalEmbedInfo {
|
|
63
|
+
export interface ExternalEmbedInfo extends BaseEmbedInfo, AndroidBitrateOptions {
|
|
89
64
|
mediaUrl: string;
|
|
90
65
|
licenseUrl?: string | null;
|
|
91
|
-
forceLowestBitrate?: boolean | null;
|
|
92
|
-
forceHighestSupportedBitrate?: boolean | null;
|
|
93
|
-
maxVideoBitrateKbps?: number | null;
|
|
94
|
-
enableAutoResume?: boolean | null;
|
|
95
|
-
preferredCaptionsLanguage?: string | null;
|
|
96
|
-
customPlayerId?: string | null;
|
|
97
|
-
resumeTimeMs?: number | null;
|
|
98
|
-
allowAdbDebugging?: boolean;
|
|
99
66
|
}
|
|
100
67
|
|
|
101
|
-
export
|
|
68
|
+
export interface OfflineEmbedInfo extends ClippableEmbedInfo {
|
|
102
69
|
offline: boolean;
|
|
103
70
|
mediaId: string;
|
|
104
|
-
enableAutoResume?: boolean | null;
|
|
105
|
-
preferredCaptionsLanguage?: string | null;
|
|
106
|
-
/**
|
|
107
|
-
* @deprecated
|
|
108
|
-
* This id will be ignored and the customPlayerId passed while downloading will be used
|
|
109
|
-
*/
|
|
110
|
-
playerConfig?: string | null;
|
|
111
|
-
/**
|
|
112
|
-
* @deprecated
|
|
113
|
-
* This property is no longer required to enable PIP mode.
|
|
114
|
-
* Use {@link https://developer.android.com/reference/android/app/Activity#enterPictureInPictureMode(android.app.PictureInPictureParams)} at activity level instead.
|
|
115
|
-
*/
|
|
116
|
-
setPictureInPictureSupport?: boolean | null;
|
|
117
|
-
resumeTimeMs?: number | null;
|
|
118
|
-
/**
|
|
119
|
-
* Not supported in iOS
|
|
120
|
-
*/
|
|
121
|
-
allowAdbDebugging?: boolean;
|
|
122
|
-
clipStartInMs?: number | null;
|
|
123
|
-
clipEndInMs?: number | null;
|
|
124
|
-
clipped?: boolean | null;
|
|
125
|
-
clipMarkerColor?: string | null;
|
|
126
71
|
}
|
|
127
72
|
|
|
128
|
-
export type OfflineOptionParams =
|
|
129
|
-
otp: string;
|
|
130
|
-
|
|
131
|
-
token: string;
|
|
132
|
-
mediaId: string;
|
|
133
|
-
customPlayerId?: string;
|
|
134
|
-
}
|
|
73
|
+
export type OfflineOptionParams =
|
|
74
|
+
| { otp: string; playbackInfo: string; customPlayerId?: string; }
|
|
75
|
+
| { token: string; mediaId: string; customPlayerId?: string; };
|
|
135
76
|
|
|
136
77
|
export interface MediaInfo {
|
|
137
78
|
mediaId: string;
|
|
@@ -170,6 +111,20 @@ export interface DownloadStatus {
|
|
|
170
111
|
lastModifiedTimestamp: number;
|
|
171
112
|
}
|
|
172
113
|
|
|
114
|
+
export interface QueryFilters {
|
|
115
|
+
mediaId: Array<string>;
|
|
116
|
+
status: Array<string>;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface EnqueueSelections {
|
|
120
|
+
selections: Array<number>;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export interface DownloadOptionsResult {
|
|
124
|
+
downloadOptions: DownloadOptions;
|
|
125
|
+
enqueue: (selections: EnqueueSelections) => Promise<void>;
|
|
126
|
+
}
|
|
127
|
+
|
|
173
128
|
export interface VideoQuality {
|
|
174
129
|
id: number;
|
|
175
130
|
bitrate: number;
|
|
@@ -208,6 +163,51 @@ export interface PreCacheSettings {
|
|
|
208
163
|
cacheSize?: number;
|
|
209
164
|
}
|
|
210
165
|
|
|
166
|
+
export interface ErrorDescription {
|
|
167
|
+
errorCode: number;
|
|
168
|
+
errorMsg: string;
|
|
169
|
+
httpStatusCode: number;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export interface VdoPlayerProps extends ViewProps {
|
|
173
|
+
embedInfo: EmbedInfo | OfflineEmbedInfo;
|
|
174
|
+
showNativeControls?: boolean;
|
|
175
|
+
autoPlay?: boolean;
|
|
176
|
+
style?: StyleProp<ViewStyle & { resizeMode?: string }>;
|
|
177
|
+
// Native view callbacks (internal plumbing, overridden by VdoPlayerView)
|
|
178
|
+
onInitSuccess?: (event: any) => void;
|
|
179
|
+
onInitFailure?: (event: any) => void;
|
|
180
|
+
onVdoLoading?: (event: any) => void;
|
|
181
|
+
onVdoLoaded?: (event: any) => void;
|
|
182
|
+
onVdoLoadError?: (event: any) => void;
|
|
183
|
+
onVdoPlayerStateChanged?: (event: any) => void;
|
|
184
|
+
onVdoProgress?: (event: any) => void;
|
|
185
|
+
onVdoBufferUpdate?: (event: any) => void;
|
|
186
|
+
onVdoPlaybackSpeedChanged?: (event: any) => void;
|
|
187
|
+
onVdoTracksChanged?: (event: any) => void;
|
|
188
|
+
onVdoMediaEnded?: (event: any) => void;
|
|
189
|
+
onVdoError?: (event: any) => void;
|
|
190
|
+
onVdoEnterFullscreen?: (event: any) => void;
|
|
191
|
+
onVdoExitFullscreen?: (event: any) => void;
|
|
192
|
+
onVdoPictureInPictureModeChanged?: (event: any) => void;
|
|
193
|
+
// Wrapper-level callbacks (public API)
|
|
194
|
+
onInitializationSuccess?: (event: { restored: boolean }) => void;
|
|
195
|
+
onInitializationFailure?: (event: { errorDescription: ErrorDescription }) => void;
|
|
196
|
+
onLoading?: (event: { embedInfo: EmbedInfo | OfflineEmbedInfo }) => void;
|
|
197
|
+
onLoaded?: (event: { embedInfo: EmbedInfo | OfflineEmbedInfo; mediaInfo: MediaInfo }) => void;
|
|
198
|
+
onLoadError?: (event: { embedInfo: EmbedInfo | OfflineEmbedInfo; errorDescription: ErrorDescription }) => void;
|
|
199
|
+
onPlayerStateChanged?: (event: { playWhenReady: boolean; playerState: string }) => void;
|
|
200
|
+
onProgress?: (event: { currentTime: number }) => void;
|
|
201
|
+
onBufferUpdate?: (event: { bufferTime: number }) => void;
|
|
202
|
+
onPlaybackSpeedChanged?: (playbackSpeed: number) => void;
|
|
203
|
+
onTracksChanged?: (event: { availableTracks: Array<Track>; selectedTracks: Array<Track> }) => void;
|
|
204
|
+
onMediaEnded?: (event: { embedInfo: EmbedInfo | OfflineEmbedInfo }) => void;
|
|
205
|
+
onError?: (event: { embedInfo: EmbedInfo | OfflineEmbedInfo; errorDescription: ErrorDescription }) => void;
|
|
206
|
+
onEnterFullscreen?: () => void;
|
|
207
|
+
onExitFullscreen?: () => void;
|
|
208
|
+
onPictureInPictureModeChanged?: (event: { isInPictureInPictureMode: boolean }) => void;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
211
|
export const VdoPropTypes = {
|
|
212
212
|
/* Native only */
|
|
213
213
|
onInitSuccess: PropTypes.func,
|
|
@@ -222,10 +222,6 @@ export const VdoPropTypes = {
|
|
|
222
222
|
onVdoTracksChanged: PropTypes.func,
|
|
223
223
|
onVdoMediaEnded: PropTypes.func,
|
|
224
224
|
onVdoError: PropTypes.func,
|
|
225
|
-
playbackProperties: PropTypes.number,
|
|
226
|
-
onVdoPlaybackProperties: PropTypes.func,
|
|
227
|
-
seek: PropTypes.number,
|
|
228
|
-
fullscreen: PropTypes.bool,
|
|
229
225
|
onVdoEnterFullscreen: PropTypes.func,
|
|
230
226
|
onVdoExitFullscreen: PropTypes.func,
|
|
231
227
|
onVdoPictureInPictureModeChanged: PropTypes.func,
|
|
@@ -298,8 +294,7 @@ export const VdoPropTypes = {
|
|
|
298
294
|
resizeMode: PropTypes.string,
|
|
299
295
|
}),
|
|
300
296
|
showNativeControls: PropTypes.bool,
|
|
301
|
-
|
|
302
|
-
playbackSpeed: PropTypes.number,
|
|
297
|
+
autoPlay: PropTypes.bool,
|
|
303
298
|
onInitializationSuccess: PropTypes.func,
|
|
304
299
|
onInitializationFailure: PropTypes.func,
|
|
305
300
|
onLoading: PropTypes.func,
|
|
@@ -312,7 +307,6 @@ export const VdoPropTypes = {
|
|
|
312
307
|
onTracksChanged: PropTypes.func,
|
|
313
308
|
onMediaEnded: PropTypes.func,
|
|
314
309
|
onError: PropTypes.func,
|
|
315
|
-
onPlaybackProperties: PropTypes.func,
|
|
316
310
|
onEnterFullscreen: PropTypes.func,
|
|
317
311
|
onExitFullscreen: PropTypes.func,
|
|
318
312
|
onPictureInPictureModeChanged: PropTypes.func,
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
package com.vdocipher.rnbridge;
|
|
2
|
-
|
|
3
|
-
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
4
|
-
import com.facebook.react.bridge.ReactApplicationContext;
|
|
5
|
-
import com.facebook.react.bridge.ReactMethod;
|
|
6
|
-
import com.facebook.react.bridge.ReadableMap;
|
|
7
|
-
import com.facebook.react.bridge.Callback;
|
|
8
|
-
import android.util.Log;
|
|
9
|
-
import com.facebook.react.uimanager.annotations.ReactProp;
|
|
10
|
-
|
|
11
|
-
public class TrackSelectionModule extends ReactContextBaseJavaModule implements ReactVdoPlayerViewManager.Listener, ReactVdoPlayerUIViewManager.Listener {
|
|
12
|
-
private static final String TAG = "TrackSelectionModule";
|
|
13
|
-
|
|
14
|
-
private ReactVdoPlayerView vdoPlayerView;
|
|
15
|
-
private ReactVdoPlayerUIView vdoPlayerUIView;
|
|
16
|
-
|
|
17
|
-
@Override
|
|
18
|
-
public String getName() {
|
|
19
|
-
return "TrackSelection";
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
public TrackSelectionModule(ReactApplicationContext reactContext, ReactVdoPlayerViewManager vdoPlayerViewManager, ReactVdoPlayerUIViewManager vdoPlayerUIViewManager) {
|
|
23
|
-
super(reactContext);
|
|
24
|
-
if (vdoPlayerViewManager != null) {
|
|
25
|
-
vdoPlayerViewManager.addListener(this);
|
|
26
|
-
}
|
|
27
|
-
if (vdoPlayerUIViewManager != null) {
|
|
28
|
-
vdoPlayerUIViewManager.addListener(this);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
@ReactMethod
|
|
33
|
-
public void isAdaptive(com.facebook.react.bridge.Callback callback) {
|
|
34
|
-
if (vdoPlayerView == null && vdoPlayerUIView == null) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
if (vdoPlayerView != null) {
|
|
38
|
-
vdoPlayerView.isAdaptive(callback);
|
|
39
|
-
} else {
|
|
40
|
-
vdoPlayerUIView.isAdaptive(callback);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
@ReactMethod
|
|
45
|
-
public void getVideoQualities(com.facebook.react.bridge.Callback callback) {
|
|
46
|
-
if (vdoPlayerView == null && vdoPlayerUIView == null) {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
if (vdoPlayerView != null) {
|
|
50
|
-
vdoPlayerView.getVideoQualities(callback);
|
|
51
|
-
} else {
|
|
52
|
-
vdoPlayerUIView.getVideoQualities(callback);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
@ReactMethod
|
|
57
|
-
public void getSelectedVideoQuality(com.facebook.react.bridge.Callback callback) {
|
|
58
|
-
if (vdoPlayerView == null && vdoPlayerUIView == null) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
if (vdoPlayerView != null) {
|
|
62
|
-
vdoPlayerView.getSelectedVideoQuality(callback);
|
|
63
|
-
} else {
|
|
64
|
-
vdoPlayerUIView.getSelectedVideoQuality(callback);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
@ReactMethod
|
|
69
|
-
public void getSelectedAudioQuality(com.facebook.react.bridge.Callback callback) {
|
|
70
|
-
if (vdoPlayerView == null && vdoPlayerUIView == null) {
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
if (vdoPlayerView != null) {
|
|
74
|
-
vdoPlayerView.getSelectedAudioQuality(callback);
|
|
75
|
-
} else {
|
|
76
|
-
vdoPlayerUIView.getSelectedAudioQuality(callback);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
@ReactMethod
|
|
81
|
-
public void getCaptionLanguages(com.facebook.react.bridge.Callback callback) {
|
|
82
|
-
if (vdoPlayerView == null && vdoPlayerUIView == null) {
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
if (vdoPlayerView != null) {
|
|
86
|
-
vdoPlayerView.getCaptionLanguages(callback);
|
|
87
|
-
} else {
|
|
88
|
-
vdoPlayerUIView.getCaptionLanguages(callback);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
@ReactMethod
|
|
93
|
-
public void getSelectedCaptionLanguage(com.facebook.react.bridge.Callback callback) {
|
|
94
|
-
if (vdoPlayerView == null && vdoPlayerUIView == null) {
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
if (vdoPlayerView != null) {
|
|
98
|
-
vdoPlayerView.getSelectedCaptionLanguage(callback);
|
|
99
|
-
} else {
|
|
100
|
-
vdoPlayerUIView.getSelectedCaptionLanguage(callback);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
@ReactMethod()
|
|
105
|
-
public void getDuration(com.facebook.react.bridge.Callback callback) {
|
|
106
|
-
if (vdoPlayerView == null && vdoPlayerUIView == null) {
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
if (vdoPlayerView != null) {
|
|
110
|
-
vdoPlayerView.getDuration(callback);
|
|
111
|
-
} else {
|
|
112
|
-
vdoPlayerUIView.getDuration(callback);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
@Override
|
|
117
|
-
public void onVideoPlayerViewInitialised(ReactVdoPlayerView vdoPlayerView) {
|
|
118
|
-
this.vdoPlayerView = vdoPlayerView;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
@Override
|
|
122
|
-
public void onVideoPlayerViewInitialised(ReactVdoPlayerUIView vdoPlayerUIView) {
|
|
123
|
-
this.vdoPlayerUIView = vdoPlayerUIView;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
package com.vdocipher.rnbridge;
|
|
2
|
-
|
|
3
|
-
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
4
|
-
import com.facebook.react.bridge.ReactApplicationContext;
|
|
5
|
-
import com.facebook.react.bridge.ReactMethod;
|
|
6
|
-
import com.facebook.react.bridge.ReadableMap;
|
|
7
|
-
import com.facebook.react.bridge.Callback;
|
|
8
|
-
import android.util.Log;
|
|
9
|
-
import com.facebook.react.uimanager.annotations.ReactProp;
|
|
10
|
-
|
|
11
|
-
public class VdoPlayerModule extends ReactContextBaseJavaModule implements ReactVdoPlayerViewManager.Listener, ReactVdoPlayerUIViewManager.Listener {
|
|
12
|
-
private static final String TAG = "VdoPlayerModule";
|
|
13
|
-
|
|
14
|
-
private ReactVdoPlayerView vdoPlayerView;
|
|
15
|
-
private ReactVdoPlayerUIView vdoPlayerUIView;
|
|
16
|
-
|
|
17
|
-
@Override
|
|
18
|
-
public String getName() {
|
|
19
|
-
return "VdoPlayer";
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
public VdoPlayerModule(ReactApplicationContext reactContext, ReactVdoPlayerViewManager vdoPlayerViewManager, ReactVdoPlayerUIViewManager vdoPlayerUIViewManager) {
|
|
23
|
-
super(reactContext);
|
|
24
|
-
if (vdoPlayerViewManager != null) {
|
|
25
|
-
vdoPlayerViewManager.addListener(this);
|
|
26
|
-
}
|
|
27
|
-
if (vdoPlayerUIViewManager != null) {
|
|
28
|
-
vdoPlayerUIViewManager.addListener(this);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
@ReactMethod()
|
|
33
|
-
public void getPlaybackPropertiesV2(com.facebook.react.bridge.Callback callback) {
|
|
34
|
-
if (vdoPlayerView == null && vdoPlayerUIView == null) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
if (vdoPlayerView != null) {
|
|
38
|
-
vdoPlayerView.getPlaybackPropertiesV2(callback);
|
|
39
|
-
} else {
|
|
40
|
-
vdoPlayerUIView.getPlaybackPropertiesV2(callback);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
@Override
|
|
45
|
-
public void onVideoPlayerViewInitialised(ReactVdoPlayerView vdoPlayerView) {
|
|
46
|
-
this.vdoPlayerView = vdoPlayerView;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
@Override
|
|
50
|
-
public void onVideoPlayerViewInitialised(ReactVdoPlayerUIView vdoPlayerUIView) {
|
|
51
|
-
this.vdoPlayerUIView = vdoPlayerUIView;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
#import <React/RCTViewManager.h>
|
|
2
|
-
#import <React/RCTUIManager.h>
|
|
3
|
-
#import <React/RCTLog.h>
|
|
4
|
-
#import <React/RCTEventEmitter.h>
|
|
5
|
-
#import "RCTVdoPlayerUIView.h"
|
|
6
|
-
#import "RCTVdoPlayerView.h"
|
|
7
|
-
#import "VdoPlaybackProperties.h"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
@interface RCT_EXTERN_MODULE(VdocipherRnBridge, RCTViewManager)
|
|
11
|
-
|
|
12
|
-
RCT_EXTERN_METHOD(startVideoScreen: (NSDictionary *) embedInfo setPictureInPictureSupport: (BOOL))
|
|
13
|
-
|
|
14
|
-
@end
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
@interface ReactVdoPlayerUIViewManager : RCTViewManager
|
|
18
|
-
@end
|
|
19
|
-
|
|
20
|
-
@implementation ReactVdoPlayerUIViewManager
|
|
21
|
-
|
|
22
|
-
RCT_EXPORT_MODULE(RCTVdoPlayerUIView)
|
|
23
|
-
RCT_EXPORT_VIEW_PROPERTY(embedInfo, NSDictionary *)
|
|
24
|
-
RCT_EXPORT_VIEW_PROPERTY(resizeMode, NSString *)
|
|
25
|
-
RCT_EXPORT_VIEW_PROPERTY(playWhenReady, BOOL)
|
|
26
|
-
RCT_EXPORT_VIEW_PROPERTY(playbackSpeed, float)
|
|
27
|
-
RCT_EXPORT_VIEW_PROPERTY(seek, int)
|
|
28
|
-
RCT_EXPORT_VIEW_PROPERTY(captionLanguage, NSDictionary *)
|
|
29
|
-
RCT_EXPORT_VIEW_PROPERTY(disableCaptions, int)
|
|
30
|
-
RCT_EXPORT_VIEW_PROPERTY(videoQuality, NSDictionary *)
|
|
31
|
-
RCT_EXPORT_VIEW_PROPERTY(adaptiveVideo, BOOL)
|
|
32
|
-
RCT_EXPORT_VIEW_PROPERTY(fullscreen, BOOL)
|
|
33
|
-
RCT_EXPORT_VIEW_PROPERTY(screenFocused, BOOL)
|
|
34
|
-
|
|
35
|
-
- (VdoCipherRNView *)view
|
|
36
|
-
{
|
|
37
|
-
return [[RCTVdoPlayerUIView alloc] init];
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
@end
|
|
41
|
-
|
|
42
|
-
@interface ReactVdoPlayerViewManager : RCTViewManager
|
|
43
|
-
@end
|
|
44
|
-
|
|
45
|
-
@implementation ReactVdoPlayerViewManager
|
|
46
|
-
|
|
47
|
-
RCT_EXPORT_MODULE(RCTVdoPlayerView)
|
|
48
|
-
RCT_EXPORT_VIEW_PROPERTY(embedInfo, NSDictionary *)
|
|
49
|
-
RCT_EXPORT_VIEW_PROPERTY(resizeMode, NSString *)
|
|
50
|
-
RCT_EXPORT_VIEW_PROPERTY(playWhenReady, BOOL)
|
|
51
|
-
RCT_EXPORT_VIEW_PROPERTY(playbackSpeed, float)
|
|
52
|
-
RCT_EXPORT_VIEW_PROPERTY(seek, int)
|
|
53
|
-
RCT_EXPORT_VIEW_PROPERTY(captionLanguage, NSDictionary *)
|
|
54
|
-
RCT_EXPORT_VIEW_PROPERTY(disableCaptions, int)
|
|
55
|
-
RCT_EXPORT_VIEW_PROPERTY(videoQuality, NSDictionary *)
|
|
56
|
-
RCT_EXPORT_VIEW_PROPERTY(adaptiveVideo, BOOL)
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
- (VdoCipherRNView *)view
|
|
60
|
-
{
|
|
61
|
-
return [[RCTVdoPlayerView alloc] init];
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
@end
|
|
65
|
-
|
|
66
|
-
@interface RCT_EXTERN_MODULE(VdoEventEmitter, RCTEventEmitter)
|
|
67
|
-
|
|
68
|
-
RCT_EXTERN_METHOD(supportedEvents)
|
|
69
|
-
|
|
70
|
-
@end
|
|
71
|
-
|
|
72
|
-
@interface RCT_EXTERN_MODULE(VdoDownload, RCTEventEmitter)
|
|
73
|
-
|
|
74
|
-
RCT_EXTERN_METHOD(supportedEvents)
|
|
75
|
-
RCT_EXTERN_METHOD(query: (NSDictionary *) queryFilters errorCallback: (RCTResponseSenderBlock) errorCallback successCallback: (RCTResponseSenderBlock) successCallback)
|
|
76
|
-
RCT_EXTERN_METHOD(getDownloadOptions: (NSDictionary *) optionParams errorCallback: (RCTResponseSenderBlock) errorCallback successCallback: (RCTResponseSenderBlock) successCallback)
|
|
77
|
-
RCT_EXTERN_METHOD(enqueueDownload: (NSString *) nativeId requestOptions: (NSDictionary *) requestOptions errorCallback: (RCTResponseSenderBlock) errorCallback successCallback: (RCTResponseSenderBlock) successCallback)
|
|
78
|
-
RCT_EXTERN_METHOD(remove: (NSArray *) mediaIds errorCallback: (RCTResponseSenderBlock) errorCallback successCallback: (RCTResponseSenderBlock) successCallback)
|
|
79
|
-
RCT_EXTERN_METHOD(stop: (NSArray *) mediaId errorCallback: (RCTResponseSenderBlock) errorCallback successCallback: (RCTResponseSenderBlock) successCallback)
|
|
80
|
-
RCT_EXTERN_METHOD(resume: (NSArray *) mediaId errorCallback: (RCTResponseSenderBlock) errorCallback successCallback: (RCTResponseSenderBlock) successCallback)
|
|
81
|
-
@end
|
|
82
|
-
|
|
83
|
-
@interface RCT_EXTERN_MODULE(VdoPlayer, NSObject)
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
@end
|
|
87
|
-
|
|
88
|
-
@implementation VdoPlayer
|
|
89
|
-
|
|
90
|
-
RCT_EXPORT_METHOD(getPlaybackPropertiesV2: (RCTResponseSenderBlock) callback)
|
|
91
|
-
{
|
|
92
|
-
NSDictionary *playbackProperties = VdoPlaybackProperties.getPlaybackProperties;
|
|
93
|
-
printf(@"Playback properties sent are = %@", playbackProperties);
|
|
94
|
-
callback(@[playbackProperties]);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
@end
|
|
98
|
-
|
|
99
|
-
@interface RCT_EXTERN_MODULE(TrackSelection, NSObject)
|
|
100
|
-
|
|
101
|
-
RCT_EXTERN_METHOD(getCaptionLanguages: (RCTResponseSenderBlock) callback)
|
|
102
|
-
RCT_EXTERN_METHOD(getSelectedCaptionLanguage: (RCTResponseSenderBlock) callback)
|
|
103
|
-
RCT_EXTERN_METHOD(getDuration: (RCTResponseSenderBlock) callback)
|
|
104
|
-
RCT_EXTERN_METHOD(getVideoQualities: (RCTResponseSenderBlock) callback)
|
|
105
|
-
RCT_EXTERN_METHOD(getSelectedVideoQuality: (RCTResponseSenderBlock) callback)
|
|
106
|
-
RCT_EXTERN_METHOD(isAdaptive: (RCTResponseSenderBlock) callback)
|
|
107
|
-
|
|
108
|
-
+ (BOOL)requiresMainQueueSetup
|
|
109
|
-
{
|
|
110
|
-
return YES;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
@end
|
|
114
|
-
|
|
115
|
-
@interface RCT_EXTERN_MODULE(VdoPlayerSettings, NSObject)
|
|
116
|
-
|
|
117
|
-
RCT_EXTERN_METHOD(applySettings: (NSDictionary *) playerSettings)
|
|
118
|
-
|
|
119
|
-
@end
|
|
120
|
-
|
|
121
|
-
@interface RCT_EXTERN_MODULE(VdoPreCacheManager, NSObject)
|
|
122
|
-
|
|
123
|
-
RCT_EXTERN_METHOD(cacheVideo: (NSDictionary *) preCacheSettings)
|
|
124
|
-
RCT_EXTERN_METHOD(clearCache)
|
|
125
|
-
|
|
126
|
-
@end
|