@granite-js/video 1.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/CHANGELOG.md +7 -0
- package/GraniteVideo.podspec +72 -0
- package/android/README.md +232 -0
- package/android/build.gradle +117 -0
- package/android/gradle.properties +8 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/run/granite/video/GraniteVideoModule.kt +70 -0
- package/android/src/main/java/run/granite/video/GraniteVideoPackage.kt +43 -0
- package/android/src/main/java/run/granite/video/GraniteVideoView.kt +384 -0
- package/android/src/main/java/run/granite/video/GraniteVideoViewManager.kt +318 -0
- package/android/src/main/java/run/granite/video/event/GraniteVideoEvents.kt +273 -0
- package/android/src/main/java/run/granite/video/event/VideoEventDispatcher.kt +66 -0
- package/android/src/main/java/run/granite/video/event/VideoEventListenerAdapter.kt +157 -0
- package/android/src/main/java/run/granite/video/provider/GraniteVideoProvider.kt +346 -0
- package/android/src/media3/AndroidManifest.xml +9 -0
- package/android/src/media3/java/run/granite/video/provider/media3/ExoPlayerProvider.kt +386 -0
- package/android/src/media3/java/run/granite/video/provider/media3/Media3ContentProvider.kt +29 -0
- package/android/src/media3/java/run/granite/video/provider/media3/Media3Initializer.kt +25 -0
- package/android/src/media3/java/run/granite/video/provider/media3/factory/ExoPlayerFactory.kt +32 -0
- package/android/src/media3/java/run/granite/video/provider/media3/factory/MediaSourceFactory.kt +61 -0
- package/android/src/media3/java/run/granite/video/provider/media3/factory/TrackSelectorFactory.kt +26 -0
- package/android/src/media3/java/run/granite/video/provider/media3/factory/VideoSurfaceFactory.kt +62 -0
- package/android/src/media3/java/run/granite/video/provider/media3/listener/ExoPlayerEventListener.kt +104 -0
- package/android/src/media3/java/run/granite/video/provider/media3/scheduler/ProgressScheduler.kt +56 -0
- package/android/src/test/java/run/granite/video/GraniteVideoViewRobolectricTest.kt +598 -0
- package/android/src/test/java/run/granite/video/event/VideoEventListenerAdapterTest.kt +319 -0
- package/android/src/test/java/run/granite/video/helpers/FakeGraniteVideoProvider.kt +161 -0
- package/android/src/test/java/run/granite/video/helpers/TestProgressScheduler.kt +42 -0
- package/android/src/test/java/run/granite/video/provider/GraniteVideoRegistryTest.kt +232 -0
- package/android/src/test/java/run/granite/video/provider/ProviderContractTest.kt +174 -0
- package/android/src/test/java/run/granite/video/provider/media3/listener/ExoPlayerEventListenerTest.kt +243 -0
- package/android/src/test/resources/kotest.properties +2 -0
- package/dist/module/GraniteVideo.js +458 -0
- package/dist/module/GraniteVideo.js.map +1 -0
- package/dist/module/GraniteVideoNativeComponent.ts +265 -0
- package/dist/module/index.js +7 -0
- package/dist/module/index.js.map +1 -0
- package/dist/module/package.json +1 -0
- package/dist/module/types.js +4 -0
- package/dist/module/types.js.map +1 -0
- package/dist/typescript/GraniteVideo.d.ts +12 -0
- package/dist/typescript/GraniteVideoNativeComponent.d.ts +189 -0
- package/dist/typescript/index.d.ts +5 -0
- package/dist/typescript/types.d.ts +328 -0
- package/ios/GraniteVideoComponentsProvider.h +10 -0
- package/ios/GraniteVideoProvider.swift +280 -0
- package/ios/GraniteVideoView.h +15 -0
- package/ios/GraniteVideoView.mm +661 -0
- package/ios/Providers/AVPlayerProvider.swift +541 -0
- package/package.json +106 -0
- package/src/GraniteVideo.tsx +575 -0
- package/src/GraniteVideoNativeComponent.ts +265 -0
- package/src/index.ts +8 -0
- package/src/types.ts +464 -0
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import { type ViewProps, type HostComponent, codegenNativeCommands, codegenNativeComponent } from 'react-native';
|
|
2
|
+
import {
|
|
3
|
+
type Int32,
|
|
4
|
+
type Float,
|
|
5
|
+
type Double,
|
|
6
|
+
type DirectEventHandler,
|
|
7
|
+
type WithDefault,
|
|
8
|
+
} from 'react-native/Libraries/Types/CodegenTypes';
|
|
9
|
+
|
|
10
|
+
// ============================================================
|
|
11
|
+
// Native Props Interface
|
|
12
|
+
// ============================================================
|
|
13
|
+
|
|
14
|
+
interface NativeVideoSource {
|
|
15
|
+
uri?: string;
|
|
16
|
+
type?: string;
|
|
17
|
+
startPosition?: Double;
|
|
18
|
+
cropStart?: Double;
|
|
19
|
+
cropEnd?: Double;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface NativeBufferConfig {
|
|
23
|
+
minBufferMs?: Int32;
|
|
24
|
+
maxBufferMs?: Int32;
|
|
25
|
+
bufferForPlaybackMs?: Int32;
|
|
26
|
+
bufferForPlaybackAfterRebufferMs?: Int32;
|
|
27
|
+
backBufferDurationMs?: Int32;
|
|
28
|
+
cacheSizeMB?: Int32;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface NativeSelectedTrack {
|
|
32
|
+
type?: string;
|
|
33
|
+
value?: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
interface NativeSelectedVideoTrack {
|
|
37
|
+
type?: string;
|
|
38
|
+
value?: Int32;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
interface NativeDrmConfig {
|
|
42
|
+
type?: string;
|
|
43
|
+
licenseServer?: string;
|
|
44
|
+
contentId?: string;
|
|
45
|
+
certificateUrl?: string;
|
|
46
|
+
base64Certificate?: boolean;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export type OnVideoLoadStartEvent = Readonly<{
|
|
50
|
+
isNetwork: boolean;
|
|
51
|
+
type: string;
|
|
52
|
+
uri: string;
|
|
53
|
+
}>;
|
|
54
|
+
|
|
55
|
+
export type OnVideoLoadEvent = Readonly<{
|
|
56
|
+
currentTime: Double;
|
|
57
|
+
duration: Double;
|
|
58
|
+
naturalSize: {
|
|
59
|
+
width: Double;
|
|
60
|
+
height: Double;
|
|
61
|
+
orientation: string;
|
|
62
|
+
};
|
|
63
|
+
}>;
|
|
64
|
+
|
|
65
|
+
export type OnVideoErrorEvent = Readonly<{
|
|
66
|
+
error: {
|
|
67
|
+
code: Int32;
|
|
68
|
+
domain: string;
|
|
69
|
+
localizedDescription: string;
|
|
70
|
+
localizedFailureReason: string;
|
|
71
|
+
localizedRecoverySuggestion: string;
|
|
72
|
+
errorString: string;
|
|
73
|
+
};
|
|
74
|
+
}>;
|
|
75
|
+
|
|
76
|
+
export type OnVideoProgressEvent = Readonly<{
|
|
77
|
+
currentTime: Double;
|
|
78
|
+
playableDuration: Double;
|
|
79
|
+
seekableDuration: Double;
|
|
80
|
+
}>;
|
|
81
|
+
|
|
82
|
+
export type OnVideoSeekEvent = Readonly<{
|
|
83
|
+
currentTime: Double;
|
|
84
|
+
seekTime: Double;
|
|
85
|
+
}>;
|
|
86
|
+
|
|
87
|
+
export type OnVideoBufferEvent = Readonly<{
|
|
88
|
+
isBuffering: boolean;
|
|
89
|
+
}>;
|
|
90
|
+
|
|
91
|
+
export type OnVideoBandwidthUpdateEvent = Readonly<{
|
|
92
|
+
bitrate: Double;
|
|
93
|
+
width: Int32;
|
|
94
|
+
height: Int32;
|
|
95
|
+
}>;
|
|
96
|
+
|
|
97
|
+
export type OnVideoPlaybackStateChangedEvent = Readonly<{
|
|
98
|
+
isPlaying: boolean;
|
|
99
|
+
isSeeking: boolean;
|
|
100
|
+
isLooping: boolean;
|
|
101
|
+
}>;
|
|
102
|
+
|
|
103
|
+
export type OnVideoPlaybackRateChangeEvent = Readonly<{
|
|
104
|
+
playbackRate: Float;
|
|
105
|
+
}>;
|
|
106
|
+
|
|
107
|
+
export type OnVideoVolumeChangeEvent = Readonly<{
|
|
108
|
+
volume: Float;
|
|
109
|
+
}>;
|
|
110
|
+
|
|
111
|
+
export type OnVideoAudioFocusChangedEvent = Readonly<{
|
|
112
|
+
hasAudioFocus: boolean;
|
|
113
|
+
}>;
|
|
114
|
+
|
|
115
|
+
export type OnVideoPictureInPictureStatusChangedEvent = Readonly<{
|
|
116
|
+
isActive: boolean;
|
|
117
|
+
}>;
|
|
118
|
+
|
|
119
|
+
export type OnVideoControlsVisibilityChangeEvent = Readonly<{
|
|
120
|
+
isVisible: boolean;
|
|
121
|
+
}>;
|
|
122
|
+
|
|
123
|
+
export type OnVideoExternalPlaybackChangeEvent = Readonly<{
|
|
124
|
+
isExternalPlaybackActive: boolean;
|
|
125
|
+
}>;
|
|
126
|
+
|
|
127
|
+
export type OnVideoAspectRatioEvent = Readonly<{
|
|
128
|
+
width: Double;
|
|
129
|
+
height: Double;
|
|
130
|
+
}>;
|
|
131
|
+
|
|
132
|
+
export type TransferEndEvent = Readonly<{
|
|
133
|
+
uri: string;
|
|
134
|
+
bytesTransferred: Double;
|
|
135
|
+
}>;
|
|
136
|
+
|
|
137
|
+
export interface NativeProps extends ViewProps {
|
|
138
|
+
// Source
|
|
139
|
+
source?: NativeVideoSource;
|
|
140
|
+
|
|
141
|
+
// Poster
|
|
142
|
+
poster?: string;
|
|
143
|
+
posterResizeMode?: WithDefault<string, 'contain'>;
|
|
144
|
+
|
|
145
|
+
// Playback Control
|
|
146
|
+
paused?: boolean;
|
|
147
|
+
muted?: boolean;
|
|
148
|
+
volume?: Float;
|
|
149
|
+
rate?: Float;
|
|
150
|
+
repeat?: boolean;
|
|
151
|
+
playInBackground?: boolean;
|
|
152
|
+
playWhenInactive?: boolean;
|
|
153
|
+
automaticallyWaitsToMinimizeStalling?: boolean;
|
|
154
|
+
shutterColor?: string;
|
|
155
|
+
|
|
156
|
+
// Display
|
|
157
|
+
resizeMode?: WithDefault<string, 'contain'>;
|
|
158
|
+
viewType?: WithDefault<string, 'surface'>;
|
|
159
|
+
useTextureView?: boolean;
|
|
160
|
+
useSecureView?: boolean;
|
|
161
|
+
|
|
162
|
+
// Buffering
|
|
163
|
+
bufferConfig?: NativeBufferConfig;
|
|
164
|
+
minLoadRetryCount?: Int32;
|
|
165
|
+
maxBitRate?: Int32;
|
|
166
|
+
preferredForwardBufferDuration?: Double;
|
|
167
|
+
|
|
168
|
+
// Track Selection
|
|
169
|
+
selectedAudioTrack?: NativeSelectedTrack;
|
|
170
|
+
selectedTextTrack?: NativeSelectedTrack;
|
|
171
|
+
selectedVideoTrack?: NativeSelectedVideoTrack;
|
|
172
|
+
|
|
173
|
+
// DRM
|
|
174
|
+
drm?: NativeDrmConfig;
|
|
175
|
+
localSourceEncryptionKeyScheme?: string;
|
|
176
|
+
|
|
177
|
+
// Ads
|
|
178
|
+
adTagUrl?: string;
|
|
179
|
+
adLanguage?: string;
|
|
180
|
+
|
|
181
|
+
// Controls
|
|
182
|
+
controls?: boolean;
|
|
183
|
+
showNotificationControls?: boolean;
|
|
184
|
+
disableFocus?: boolean;
|
|
185
|
+
disableDisconnectError?: boolean;
|
|
186
|
+
focusable?: boolean;
|
|
187
|
+
hideShutterView?: boolean;
|
|
188
|
+
preventsDisplaySleepDuringVideoPlayback?: boolean;
|
|
189
|
+
|
|
190
|
+
// Fullscreen
|
|
191
|
+
fullscreen?: boolean;
|
|
192
|
+
fullscreenAutorotate?: boolean;
|
|
193
|
+
fullscreenOrientation?: WithDefault<string, 'all'>;
|
|
194
|
+
|
|
195
|
+
// Picture in Picture
|
|
196
|
+
pictureInPicture?: boolean;
|
|
197
|
+
|
|
198
|
+
// Content
|
|
199
|
+
contentStartTime?: Double;
|
|
200
|
+
allowsExternalPlayback?: boolean;
|
|
201
|
+
audioOutput?: WithDefault<string, 'speaker'>;
|
|
202
|
+
ignoreSilentSwitch?: WithDefault<string, 'inherit'>;
|
|
203
|
+
mixWithOthers?: WithDefault<string, 'inherit'>;
|
|
204
|
+
|
|
205
|
+
// Debug
|
|
206
|
+
enableDebug?: boolean;
|
|
207
|
+
enableDebugThread?: boolean;
|
|
208
|
+
|
|
209
|
+
// === Events ===
|
|
210
|
+
onVideoLoadStart?: DirectEventHandler<OnVideoLoadStartEvent>;
|
|
211
|
+
onVideoLoad?: DirectEventHandler<OnVideoLoadEvent>;
|
|
212
|
+
onVideoError?: DirectEventHandler<OnVideoErrorEvent>;
|
|
213
|
+
onVideoProgress?: DirectEventHandler<OnVideoProgressEvent>;
|
|
214
|
+
onVideoSeek?: DirectEventHandler<OnVideoSeekEvent>;
|
|
215
|
+
onVideoEnd?: DirectEventHandler<null>;
|
|
216
|
+
onVideoBuffer?: DirectEventHandler<OnVideoBufferEvent>;
|
|
217
|
+
onVideoBandwidthUpdate?: DirectEventHandler<OnVideoBandwidthUpdateEvent>;
|
|
218
|
+
onVideoPlaybackStateChanged?: DirectEventHandler<OnVideoPlaybackStateChangedEvent>;
|
|
219
|
+
onVideoPlaybackRateChange?: DirectEventHandler<OnVideoPlaybackRateChangeEvent>;
|
|
220
|
+
onVideoVolumeChange?: DirectEventHandler<OnVideoVolumeChangeEvent>;
|
|
221
|
+
onVideoIdle?: DirectEventHandler<null>;
|
|
222
|
+
onVideoReadyForDisplay?: DirectEventHandler<null>;
|
|
223
|
+
onVideoAudioFocusChanged?: DirectEventHandler<OnVideoAudioFocusChangedEvent>;
|
|
224
|
+
onVideoAudioBecomingNoisy?: DirectEventHandler<null>;
|
|
225
|
+
onVideoFullscreenPlayerWillPresent?: DirectEventHandler<null>;
|
|
226
|
+
onVideoFullscreenPlayerDidPresent?: DirectEventHandler<null>;
|
|
227
|
+
onVideoFullscreenPlayerWillDismiss?: DirectEventHandler<null>;
|
|
228
|
+
onVideoFullscreenPlayerDidDismiss?: DirectEventHandler<null>;
|
|
229
|
+
onVideoPictureInPictureStatusChanged?: DirectEventHandler<OnVideoPictureInPictureStatusChangedEvent>;
|
|
230
|
+
onVideoRestoreUserInterfaceForPictureInPictureStop?: DirectEventHandler<null>;
|
|
231
|
+
onVideoControlsVisibilityChange?: DirectEventHandler<OnVideoControlsVisibilityChangeEvent>;
|
|
232
|
+
onVideoExternalPlaybackChange?: DirectEventHandler<OnVideoExternalPlaybackChangeEvent>;
|
|
233
|
+
onVideoAspectRatio?: DirectEventHandler<OnVideoAspectRatioEvent>;
|
|
234
|
+
onTransferEnd?: DirectEventHandler<TransferEndEvent>;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// ============================================================
|
|
238
|
+
// Native Commands Interface
|
|
239
|
+
// ============================================================
|
|
240
|
+
|
|
241
|
+
export interface NativeCommands {
|
|
242
|
+
seek: (viewRef: React.ElementRef<HostComponent<NativeProps>>, time: Double, tolerance: Double) => void;
|
|
243
|
+
adjustVolume: (viewRef: React.ElementRef<HostComponent<NativeProps>>, volume: Float) => void;
|
|
244
|
+
setFullScreen: (viewRef: React.ElementRef<HostComponent<NativeProps>>, fullscreen: boolean) => void;
|
|
245
|
+
loadSource: (viewRef: React.ElementRef<HostComponent<NativeProps>>, uri: string) => void;
|
|
246
|
+
pause: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
|
|
247
|
+
resume: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
|
|
248
|
+
enterPictureInPicture: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
|
|
249
|
+
exitPictureInPicture: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
|
|
253
|
+
supportedCommands: [
|
|
254
|
+
'seek',
|
|
255
|
+
'adjustVolume',
|
|
256
|
+
'setFullScreen',
|
|
257
|
+
'loadSource',
|
|
258
|
+
'pause',
|
|
259
|
+
'resume',
|
|
260
|
+
'enterPictureInPicture',
|
|
261
|
+
'exitPictureInPicture',
|
|
262
|
+
],
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
export default codegenNativeComponent<NativeProps>('GraniteVideoView');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Video","clearCache","getWidevineLevel","isCodecSupported","isHEVCSupported"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,SAASA,KAAK,QAAQ,mBAAgB;AAEtC,SAASA,KAAK,EAAEC,UAAU,EAAEC,gBAAgB,EAAEC,gBAAgB,EAAEC,eAAe,QAAQ,mBAAgB;AAEvG,cAAc,YAAS;AAGvB,eAAeJ,KAAK","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { VideoRef, VideoProps } from './types';
|
|
3
|
+
declare const VideoBase: React.ForwardRefExoticComponent<VideoProps & React.RefAttributes<VideoRef>>;
|
|
4
|
+
type VideoComponent = typeof VideoBase & {
|
|
5
|
+
isAvailable: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare const Video: VideoComponent;
|
|
8
|
+
export declare function clearCache(): Promise<void>;
|
|
9
|
+
export declare function getWidevineLevel(): Promise<number>;
|
|
10
|
+
export declare function isCodecSupported(mimeType: string, width: number, height: number): Promise<boolean>;
|
|
11
|
+
export declare function isHEVCSupported(): Promise<boolean>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { type ViewProps, type HostComponent } from 'react-native';
|
|
2
|
+
import { type Int32, type Float, type Double, type DirectEventHandler, type WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
|
|
3
|
+
interface NativeVideoSource {
|
|
4
|
+
uri?: string;
|
|
5
|
+
type?: string;
|
|
6
|
+
startPosition?: Double;
|
|
7
|
+
cropStart?: Double;
|
|
8
|
+
cropEnd?: Double;
|
|
9
|
+
}
|
|
10
|
+
interface NativeBufferConfig {
|
|
11
|
+
minBufferMs?: Int32;
|
|
12
|
+
maxBufferMs?: Int32;
|
|
13
|
+
bufferForPlaybackMs?: Int32;
|
|
14
|
+
bufferForPlaybackAfterRebufferMs?: Int32;
|
|
15
|
+
backBufferDurationMs?: Int32;
|
|
16
|
+
cacheSizeMB?: Int32;
|
|
17
|
+
}
|
|
18
|
+
interface NativeSelectedTrack {
|
|
19
|
+
type?: string;
|
|
20
|
+
value?: string;
|
|
21
|
+
}
|
|
22
|
+
interface NativeSelectedVideoTrack {
|
|
23
|
+
type?: string;
|
|
24
|
+
value?: Int32;
|
|
25
|
+
}
|
|
26
|
+
interface NativeDrmConfig {
|
|
27
|
+
type?: string;
|
|
28
|
+
licenseServer?: string;
|
|
29
|
+
contentId?: string;
|
|
30
|
+
certificateUrl?: string;
|
|
31
|
+
base64Certificate?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export type OnVideoLoadStartEvent = Readonly<{
|
|
34
|
+
isNetwork: boolean;
|
|
35
|
+
type: string;
|
|
36
|
+
uri: string;
|
|
37
|
+
}>;
|
|
38
|
+
export type OnVideoLoadEvent = Readonly<{
|
|
39
|
+
currentTime: Double;
|
|
40
|
+
duration: Double;
|
|
41
|
+
naturalSize: {
|
|
42
|
+
width: Double;
|
|
43
|
+
height: Double;
|
|
44
|
+
orientation: string;
|
|
45
|
+
};
|
|
46
|
+
}>;
|
|
47
|
+
export type OnVideoErrorEvent = Readonly<{
|
|
48
|
+
error: {
|
|
49
|
+
code: Int32;
|
|
50
|
+
domain: string;
|
|
51
|
+
localizedDescription: string;
|
|
52
|
+
localizedFailureReason: string;
|
|
53
|
+
localizedRecoverySuggestion: string;
|
|
54
|
+
errorString: string;
|
|
55
|
+
};
|
|
56
|
+
}>;
|
|
57
|
+
export type OnVideoProgressEvent = Readonly<{
|
|
58
|
+
currentTime: Double;
|
|
59
|
+
playableDuration: Double;
|
|
60
|
+
seekableDuration: Double;
|
|
61
|
+
}>;
|
|
62
|
+
export type OnVideoSeekEvent = Readonly<{
|
|
63
|
+
currentTime: Double;
|
|
64
|
+
seekTime: Double;
|
|
65
|
+
}>;
|
|
66
|
+
export type OnVideoBufferEvent = Readonly<{
|
|
67
|
+
isBuffering: boolean;
|
|
68
|
+
}>;
|
|
69
|
+
export type OnVideoBandwidthUpdateEvent = Readonly<{
|
|
70
|
+
bitrate: Double;
|
|
71
|
+
width: Int32;
|
|
72
|
+
height: Int32;
|
|
73
|
+
}>;
|
|
74
|
+
export type OnVideoPlaybackStateChangedEvent = Readonly<{
|
|
75
|
+
isPlaying: boolean;
|
|
76
|
+
isSeeking: boolean;
|
|
77
|
+
isLooping: boolean;
|
|
78
|
+
}>;
|
|
79
|
+
export type OnVideoPlaybackRateChangeEvent = Readonly<{
|
|
80
|
+
playbackRate: Float;
|
|
81
|
+
}>;
|
|
82
|
+
export type OnVideoVolumeChangeEvent = Readonly<{
|
|
83
|
+
volume: Float;
|
|
84
|
+
}>;
|
|
85
|
+
export type OnVideoAudioFocusChangedEvent = Readonly<{
|
|
86
|
+
hasAudioFocus: boolean;
|
|
87
|
+
}>;
|
|
88
|
+
export type OnVideoPictureInPictureStatusChangedEvent = Readonly<{
|
|
89
|
+
isActive: boolean;
|
|
90
|
+
}>;
|
|
91
|
+
export type OnVideoControlsVisibilityChangeEvent = Readonly<{
|
|
92
|
+
isVisible: boolean;
|
|
93
|
+
}>;
|
|
94
|
+
export type OnVideoExternalPlaybackChangeEvent = Readonly<{
|
|
95
|
+
isExternalPlaybackActive: boolean;
|
|
96
|
+
}>;
|
|
97
|
+
export type OnVideoAspectRatioEvent = Readonly<{
|
|
98
|
+
width: Double;
|
|
99
|
+
height: Double;
|
|
100
|
+
}>;
|
|
101
|
+
export type TransferEndEvent = Readonly<{
|
|
102
|
+
uri: string;
|
|
103
|
+
bytesTransferred: Double;
|
|
104
|
+
}>;
|
|
105
|
+
export interface NativeProps extends ViewProps {
|
|
106
|
+
source?: NativeVideoSource;
|
|
107
|
+
poster?: string;
|
|
108
|
+
posterResizeMode?: WithDefault<string, 'contain'>;
|
|
109
|
+
paused?: boolean;
|
|
110
|
+
muted?: boolean;
|
|
111
|
+
volume?: Float;
|
|
112
|
+
rate?: Float;
|
|
113
|
+
repeat?: boolean;
|
|
114
|
+
playInBackground?: boolean;
|
|
115
|
+
playWhenInactive?: boolean;
|
|
116
|
+
automaticallyWaitsToMinimizeStalling?: boolean;
|
|
117
|
+
shutterColor?: string;
|
|
118
|
+
resizeMode?: WithDefault<string, 'contain'>;
|
|
119
|
+
viewType?: WithDefault<string, 'surface'>;
|
|
120
|
+
useTextureView?: boolean;
|
|
121
|
+
useSecureView?: boolean;
|
|
122
|
+
bufferConfig?: NativeBufferConfig;
|
|
123
|
+
minLoadRetryCount?: Int32;
|
|
124
|
+
maxBitRate?: Int32;
|
|
125
|
+
preferredForwardBufferDuration?: Double;
|
|
126
|
+
selectedAudioTrack?: NativeSelectedTrack;
|
|
127
|
+
selectedTextTrack?: NativeSelectedTrack;
|
|
128
|
+
selectedVideoTrack?: NativeSelectedVideoTrack;
|
|
129
|
+
drm?: NativeDrmConfig;
|
|
130
|
+
localSourceEncryptionKeyScheme?: string;
|
|
131
|
+
adTagUrl?: string;
|
|
132
|
+
adLanguage?: string;
|
|
133
|
+
controls?: boolean;
|
|
134
|
+
showNotificationControls?: boolean;
|
|
135
|
+
disableFocus?: boolean;
|
|
136
|
+
disableDisconnectError?: boolean;
|
|
137
|
+
focusable?: boolean;
|
|
138
|
+
hideShutterView?: boolean;
|
|
139
|
+
preventsDisplaySleepDuringVideoPlayback?: boolean;
|
|
140
|
+
fullscreen?: boolean;
|
|
141
|
+
fullscreenAutorotate?: boolean;
|
|
142
|
+
fullscreenOrientation?: WithDefault<string, 'all'>;
|
|
143
|
+
pictureInPicture?: boolean;
|
|
144
|
+
contentStartTime?: Double;
|
|
145
|
+
allowsExternalPlayback?: boolean;
|
|
146
|
+
audioOutput?: WithDefault<string, 'speaker'>;
|
|
147
|
+
ignoreSilentSwitch?: WithDefault<string, 'inherit'>;
|
|
148
|
+
mixWithOthers?: WithDefault<string, 'inherit'>;
|
|
149
|
+
enableDebug?: boolean;
|
|
150
|
+
enableDebugThread?: boolean;
|
|
151
|
+
onVideoLoadStart?: DirectEventHandler<OnVideoLoadStartEvent>;
|
|
152
|
+
onVideoLoad?: DirectEventHandler<OnVideoLoadEvent>;
|
|
153
|
+
onVideoError?: DirectEventHandler<OnVideoErrorEvent>;
|
|
154
|
+
onVideoProgress?: DirectEventHandler<OnVideoProgressEvent>;
|
|
155
|
+
onVideoSeek?: DirectEventHandler<OnVideoSeekEvent>;
|
|
156
|
+
onVideoEnd?: DirectEventHandler<null>;
|
|
157
|
+
onVideoBuffer?: DirectEventHandler<OnVideoBufferEvent>;
|
|
158
|
+
onVideoBandwidthUpdate?: DirectEventHandler<OnVideoBandwidthUpdateEvent>;
|
|
159
|
+
onVideoPlaybackStateChanged?: DirectEventHandler<OnVideoPlaybackStateChangedEvent>;
|
|
160
|
+
onVideoPlaybackRateChange?: DirectEventHandler<OnVideoPlaybackRateChangeEvent>;
|
|
161
|
+
onVideoVolumeChange?: DirectEventHandler<OnVideoVolumeChangeEvent>;
|
|
162
|
+
onVideoIdle?: DirectEventHandler<null>;
|
|
163
|
+
onVideoReadyForDisplay?: DirectEventHandler<null>;
|
|
164
|
+
onVideoAudioFocusChanged?: DirectEventHandler<OnVideoAudioFocusChangedEvent>;
|
|
165
|
+
onVideoAudioBecomingNoisy?: DirectEventHandler<null>;
|
|
166
|
+
onVideoFullscreenPlayerWillPresent?: DirectEventHandler<null>;
|
|
167
|
+
onVideoFullscreenPlayerDidPresent?: DirectEventHandler<null>;
|
|
168
|
+
onVideoFullscreenPlayerWillDismiss?: DirectEventHandler<null>;
|
|
169
|
+
onVideoFullscreenPlayerDidDismiss?: DirectEventHandler<null>;
|
|
170
|
+
onVideoPictureInPictureStatusChanged?: DirectEventHandler<OnVideoPictureInPictureStatusChangedEvent>;
|
|
171
|
+
onVideoRestoreUserInterfaceForPictureInPictureStop?: DirectEventHandler<null>;
|
|
172
|
+
onVideoControlsVisibilityChange?: DirectEventHandler<OnVideoControlsVisibilityChangeEvent>;
|
|
173
|
+
onVideoExternalPlaybackChange?: DirectEventHandler<OnVideoExternalPlaybackChangeEvent>;
|
|
174
|
+
onVideoAspectRatio?: DirectEventHandler<OnVideoAspectRatioEvent>;
|
|
175
|
+
onTransferEnd?: DirectEventHandler<TransferEndEvent>;
|
|
176
|
+
}
|
|
177
|
+
export interface NativeCommands {
|
|
178
|
+
seek: (viewRef: React.ElementRef<HostComponent<NativeProps>>, time: Double, tolerance: Double) => void;
|
|
179
|
+
adjustVolume: (viewRef: React.ElementRef<HostComponent<NativeProps>>, volume: Float) => void;
|
|
180
|
+
setFullScreen: (viewRef: React.ElementRef<HostComponent<NativeProps>>, fullscreen: boolean) => void;
|
|
181
|
+
loadSource: (viewRef: React.ElementRef<HostComponent<NativeProps>>, uri: string) => void;
|
|
182
|
+
pause: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
|
|
183
|
+
resume: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
|
|
184
|
+
enterPictureInPicture: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
|
|
185
|
+
exitPictureInPicture: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
|
|
186
|
+
}
|
|
187
|
+
export declare const Commands: NativeCommands;
|
|
188
|
+
declare const _default: HostComponent<NativeProps>;
|
|
189
|
+
export default _default;
|