expo-libvlc-player 0.1.8 → 0.1.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/.eslintrc.js +2 -0
- package/android/build.gradle +2 -2
- package/build/VlcPlayer.types.d.ts +291 -0
- package/build/VlcPlayer.types.d.ts.map +1 -0
- package/build/VlcPlayer.types.js +2 -0
- package/build/VlcPlayer.types.js.map +1 -0
- package/build/VlcPlayerModule.d.ts +6 -0
- package/build/VlcPlayerModule.d.ts.map +1 -0
- package/build/VlcPlayerModule.js +4 -0
- package/build/VlcPlayerModule.js.map +1 -0
- package/build/VlcPlayerView.d.ts +4 -0
- package/build/VlcPlayerView.d.ts.map +1 -0
- package/build/VlcPlayerView.js +41 -0
- package/build/VlcPlayerView.js.map +1 -0
- package/build/index.d.ts +4 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +5 -0
- package/build/index.js.map +1 -0
- package/build/utils/props.d.ts +3 -0
- package/build/utils/props.d.ts.map +1 -0
- package/build/utils/props.js +13 -0
- package/build/utils/props.js.map +1 -0
- package/package.json +2 -2
- package/plugin/tsconfig.tsbuildinfo +1 -0
package/.eslintrc.js
ADDED
package/android/build.gradle
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
apply plugin: 'com.android.library'
|
|
2
2
|
|
|
3
3
|
group = 'expo.modules.libvlcplayer'
|
|
4
|
-
version = '0.1.
|
|
4
|
+
version = '0.1.8'
|
|
5
5
|
|
|
6
6
|
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
7
7
|
apply from: expoModulesCorePlugin
|
|
@@ -35,7 +35,7 @@ android {
|
|
|
35
35
|
namespace "expo.modules.libvlcplayer"
|
|
36
36
|
defaultConfig {
|
|
37
37
|
versionCode 1
|
|
38
|
-
versionName "0.1.
|
|
38
|
+
versionName "0.1.8"
|
|
39
39
|
consumerProguardFiles("proguard-rules.pro")
|
|
40
40
|
}
|
|
41
41
|
lintOptions {
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import type { ViewProps } from "react-native";
|
|
2
|
+
export interface VLCPlayerViewRef {
|
|
3
|
+
/**
|
|
4
|
+
* Starts playback for the current player
|
|
5
|
+
*
|
|
6
|
+
* @returns A promise which resolves to `void`
|
|
7
|
+
*/
|
|
8
|
+
readonly play: () => Promise<void>;
|
|
9
|
+
/**
|
|
10
|
+
* Pauses playback for the current player
|
|
11
|
+
*
|
|
12
|
+
* @returns A promise which resolves to `void`
|
|
13
|
+
*/
|
|
14
|
+
readonly pause: () => Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Stops playback for the current player
|
|
17
|
+
*
|
|
18
|
+
* @returns A promise which resolves to `void`
|
|
19
|
+
*/
|
|
20
|
+
readonly stop: () => Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Sets position of the current player
|
|
23
|
+
*
|
|
24
|
+
* @param position - Must be a float number between `0` and `1`
|
|
25
|
+
*
|
|
26
|
+
* @returns void
|
|
27
|
+
*/
|
|
28
|
+
readonly seek: (position: number) => Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* @hidden
|
|
32
|
+
*/
|
|
33
|
+
export type BufferingListener = () => void;
|
|
34
|
+
/**
|
|
35
|
+
* @hidden
|
|
36
|
+
*/
|
|
37
|
+
export type PlayingListener = () => void;
|
|
38
|
+
/**
|
|
39
|
+
* @hidden
|
|
40
|
+
*/
|
|
41
|
+
export type PausedListener = (event: {
|
|
42
|
+
nativeEvent: Paused;
|
|
43
|
+
}) => void;
|
|
44
|
+
export type Paused = {
|
|
45
|
+
background: boolean;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* @hidden
|
|
49
|
+
*/
|
|
50
|
+
export type StoppedListener = () => void;
|
|
51
|
+
/**
|
|
52
|
+
* @hidden
|
|
53
|
+
*/
|
|
54
|
+
export type EndedListener = () => void;
|
|
55
|
+
/**
|
|
56
|
+
* @hidden
|
|
57
|
+
*/
|
|
58
|
+
export type RepeatListener = () => void;
|
|
59
|
+
/**
|
|
60
|
+
* @hidden
|
|
61
|
+
*/
|
|
62
|
+
export type WarnListener = (event: {
|
|
63
|
+
nativeEvent: Warn;
|
|
64
|
+
}) => void;
|
|
65
|
+
export type Warn = {
|
|
66
|
+
warn: string;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* @hidden
|
|
70
|
+
*/
|
|
71
|
+
export type ErrorListener = (event: {
|
|
72
|
+
nativeEvent: Error;
|
|
73
|
+
}) => void;
|
|
74
|
+
export type Error = {
|
|
75
|
+
error: string;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* @hidden
|
|
79
|
+
*/
|
|
80
|
+
export type PositionChangedListener = (event: {
|
|
81
|
+
nativeEvent: PositionChanged;
|
|
82
|
+
}) => void;
|
|
83
|
+
export type PositionChanged = {
|
|
84
|
+
position: number;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* @hidden
|
|
88
|
+
*/
|
|
89
|
+
export type LoadListener = (event: {
|
|
90
|
+
nativeEvent: VideoInfo;
|
|
91
|
+
}) => void;
|
|
92
|
+
export interface Track {
|
|
93
|
+
id: number;
|
|
94
|
+
name: string;
|
|
95
|
+
}
|
|
96
|
+
export interface VideoTracks {
|
|
97
|
+
audio: Track[];
|
|
98
|
+
subtitle: Track[];
|
|
99
|
+
}
|
|
100
|
+
export interface VideoInfo {
|
|
101
|
+
width: number;
|
|
102
|
+
height: number;
|
|
103
|
+
aspectRatio: string | null;
|
|
104
|
+
duration: number;
|
|
105
|
+
tracks: VideoTracks;
|
|
106
|
+
seekable: boolean;
|
|
107
|
+
}
|
|
108
|
+
export interface Subtitle {
|
|
109
|
+
uri: string;
|
|
110
|
+
enable: boolean;
|
|
111
|
+
}
|
|
112
|
+
export interface TracksOptions {
|
|
113
|
+
audio: number;
|
|
114
|
+
subtitle: number;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* @hidden
|
|
118
|
+
*/
|
|
119
|
+
export interface VlcPlayerViewNativeProps {
|
|
120
|
+
ref?: React.Ref<VLCPlayerViewRef>;
|
|
121
|
+
uri?: string;
|
|
122
|
+
subtitle?: Subtitle;
|
|
123
|
+
options?: string[];
|
|
124
|
+
volume?: number;
|
|
125
|
+
mute?: boolean;
|
|
126
|
+
rate?: number;
|
|
127
|
+
tracks?: TracksOptions;
|
|
128
|
+
time?: number;
|
|
129
|
+
repeat?: boolean;
|
|
130
|
+
aspectRatio?: string;
|
|
131
|
+
audioMixingMode?: AudioMixingMode;
|
|
132
|
+
playInBackground?: boolean;
|
|
133
|
+
autoplay?: boolean;
|
|
134
|
+
onBuffering?: BufferingListener;
|
|
135
|
+
onPlaying?: PlayingListener;
|
|
136
|
+
onPaused?: PausedListener;
|
|
137
|
+
onStopped?: StoppedListener;
|
|
138
|
+
onEnded?: EndedListener;
|
|
139
|
+
onRepeat?: RepeatListener;
|
|
140
|
+
onWarn?: WarnListener;
|
|
141
|
+
onError?: ErrorListener;
|
|
142
|
+
onPositionChanged?: PositionChangedListener;
|
|
143
|
+
onLoad?: LoadListener;
|
|
144
|
+
}
|
|
145
|
+
export type AudioMixingMode = "mixWithOthers" | "duckOthers" | "auto" | "doNotMix";
|
|
146
|
+
export interface VlcPlayerViewProps extends ViewProps {
|
|
147
|
+
/**
|
|
148
|
+
* Sets the URI of the media to be played
|
|
149
|
+
*/
|
|
150
|
+
uri: string;
|
|
151
|
+
/**
|
|
152
|
+
* Sets subtitle URI and enabled state
|
|
153
|
+
*
|
|
154
|
+
* @example
|
|
155
|
+
* ```tsx
|
|
156
|
+
* <VLCPlayerView
|
|
157
|
+
* subtitle={{
|
|
158
|
+
* uri: "file://",
|
|
159
|
+
* enable: false,
|
|
160
|
+
* }}
|
|
161
|
+
* />
|
|
162
|
+
* ```
|
|
163
|
+
*/
|
|
164
|
+
subtitle?: Subtitle;
|
|
165
|
+
/**
|
|
166
|
+
* https://wiki.videolan.org/VLC_command-line_help/
|
|
167
|
+
*
|
|
168
|
+
* Sets the VLC options to initialize the player with
|
|
169
|
+
*
|
|
170
|
+
* @example ["--network-caching=1000"]
|
|
171
|
+
*
|
|
172
|
+
* @default []
|
|
173
|
+
*
|
|
174
|
+
*/
|
|
175
|
+
options?: string[];
|
|
176
|
+
/**
|
|
177
|
+
* Controls the player volume. Must be an integer number between `0` and `100`
|
|
178
|
+
*
|
|
179
|
+
* @default 100
|
|
180
|
+
*
|
|
181
|
+
*/
|
|
182
|
+
volume?: number;
|
|
183
|
+
/**
|
|
184
|
+
* Sets the player volume to `0`
|
|
185
|
+
*
|
|
186
|
+
* @default false
|
|
187
|
+
*
|
|
188
|
+
*/
|
|
189
|
+
mute?: boolean;
|
|
190
|
+
/**
|
|
191
|
+
* Controls the player rate. Must be a float number
|
|
192
|
+
*
|
|
193
|
+
* @default 1
|
|
194
|
+
*
|
|
195
|
+
*/
|
|
196
|
+
rate?: number;
|
|
197
|
+
/**
|
|
198
|
+
* Sets the player audio and subtitle tracks, see `VideoInfo` for tracks type
|
|
199
|
+
*
|
|
200
|
+
* @example
|
|
201
|
+
* ```tsx
|
|
202
|
+
* <VLCPlayerView
|
|
203
|
+
* tracks={{
|
|
204
|
+
* audio: 1,
|
|
205
|
+
* subtitle: 2,
|
|
206
|
+
* }}
|
|
207
|
+
* />
|
|
208
|
+
* ```
|
|
209
|
+
*/
|
|
210
|
+
tracks?: TracksOptions;
|
|
211
|
+
/**
|
|
212
|
+
* Controls the player time once created. Must be an integer number in milliseconds
|
|
213
|
+
*
|
|
214
|
+
* @default 0
|
|
215
|
+
*
|
|
216
|
+
*/
|
|
217
|
+
time?: number;
|
|
218
|
+
/**
|
|
219
|
+
* Repeats media once playback is ended
|
|
220
|
+
*
|
|
221
|
+
* @default false
|
|
222
|
+
*
|
|
223
|
+
*/
|
|
224
|
+
repeat?: boolean;
|
|
225
|
+
/**
|
|
226
|
+
* Sets the player aspect ratio. Must be a valid string
|
|
227
|
+
*
|
|
228
|
+
* @example "16:9"
|
|
229
|
+
*/
|
|
230
|
+
aspectRatio?: string;
|
|
231
|
+
/**
|
|
232
|
+
* Determines how the player will interact with other audio playing in the system
|
|
233
|
+
*
|
|
234
|
+
* @default "auto"
|
|
235
|
+
*/
|
|
236
|
+
audioMixingMode?: AudioMixingMode;
|
|
237
|
+
/**
|
|
238
|
+
* Determines whether the player should continue playing after the app enters the background
|
|
239
|
+
*
|
|
240
|
+
* @default false
|
|
241
|
+
*/
|
|
242
|
+
playInBackground?: boolean;
|
|
243
|
+
/**
|
|
244
|
+
* Autoplays media once player is created
|
|
245
|
+
*
|
|
246
|
+
* @default true
|
|
247
|
+
*
|
|
248
|
+
*/
|
|
249
|
+
autoplay?: boolean;
|
|
250
|
+
/**
|
|
251
|
+
* Event that fires when player buffers
|
|
252
|
+
*/
|
|
253
|
+
onBuffering?: () => void;
|
|
254
|
+
/**
|
|
255
|
+
* Event that fires when player plays
|
|
256
|
+
*/
|
|
257
|
+
onPlaying?: () => void;
|
|
258
|
+
/**
|
|
259
|
+
* Event that fires when player pauses
|
|
260
|
+
*/
|
|
261
|
+
onPaused?: (event: Paused) => void;
|
|
262
|
+
/**
|
|
263
|
+
* Event that fires when player stops
|
|
264
|
+
*/
|
|
265
|
+
onStopped?: () => void;
|
|
266
|
+
/**
|
|
267
|
+
* Event that fires when player reaches an end
|
|
268
|
+
*/
|
|
269
|
+
onEnded?: () => void;
|
|
270
|
+
/**
|
|
271
|
+
* Event that fires when player repeats
|
|
272
|
+
*/
|
|
273
|
+
onRepeat?: () => void;
|
|
274
|
+
/**
|
|
275
|
+
* Event that fires when player emits a warning
|
|
276
|
+
*/
|
|
277
|
+
onWarn?: (event: Warn) => void;
|
|
278
|
+
/**
|
|
279
|
+
* Event that fires when player encounters an error
|
|
280
|
+
*/
|
|
281
|
+
onError?: (event: Error) => void;
|
|
282
|
+
/**
|
|
283
|
+
* Event that fires when player position changes
|
|
284
|
+
*/
|
|
285
|
+
onPositionChanged?: (event: PositionChanged) => void;
|
|
286
|
+
/**
|
|
287
|
+
* Event that fires when player loads
|
|
288
|
+
*/
|
|
289
|
+
onLoad?: (event: VideoInfo) => void;
|
|
290
|
+
}
|
|
291
|
+
//# sourceMappingURL=VlcPlayer.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VlcPlayer.types.d.ts","sourceRoot":"","sources":["../src/VlcPlayer.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC;;;;;;OAMG;IACH,QAAQ,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACpD;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,IAAI,CAAC;AAE3C;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC;AAEzC;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,KAAK,IAAI,CAAC;AAEtE,MAAM,MAAM,MAAM,GAAG;IAAE,UAAU,EAAE,OAAO,CAAA;CAAE,CAAC;AAE7C;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC;AAEzC;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC;AAEvC;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC;AAExC;;GAE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AI,CAAC;CACrC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VlcPlayer.types.js","sourceRoot":"","sources":["../src/VlcPlayer.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ViewProps } from \"react-native\";\n\nexport interface VLCPlayerViewRef {\n /**\n * Starts playback for the current player\n *\n * @returns A promise which resolves to `void`\n */\n readonly play: () => Promise<void>;\n /**\n * Pauses playback for the current player\n *\n * @returns A promise which resolves to `void`\n */\n readonly pause: () => Promise<void>;\n /**\n * Stops playback for the current player\n *\n * @returns A promise which resolves to `void`\n */\n readonly stop: () => Promise<void>;\n /**\n * Sets position of the current player\n *\n * @param position - Must be a float number between `0` and `1`\n *\n * @returns void\n */\n readonly seek: (position: number) => Promise<void>;\n}\n\n/**\n * @hidden\n */\nexport type BufferingListener = () => void;\n\n/**\n * @hidden\n */\nexport type PlayingListener = () => void;\n\n/**\n * @hidden\n */\nexport type PausedListener = (event: { nativeEvent: Paused }) => void;\n\nexport type Paused = { background: boolean };\n\n/**\n * @hidden\n */\nexport type StoppedListener = () => void;\n\n/**\n * @hidden\n */\nexport type EndedListener = () => void;\n\n/**\n * @hidden\n */\nexport type RepeatListener = () => void;\n\n/**\n * @hidden\n */\nexport type WarnListener = (event: { nativeEvent: Warn }) => void;\n\nexport type Warn = { warn: string };\n\n/**\n * @hidden\n */\nexport type ErrorListener = (event: { nativeEvent: Error }) => void;\n\nexport type Error = { error: string };\n\n/**\n * @hidden\n */\nexport type PositionChangedListener = (event: {\n nativeEvent: PositionChanged;\n}) => void;\n\nexport type PositionChanged = { position: number };\n\n/**\n * @hidden\n */\nexport type LoadListener = (event: { nativeEvent: VideoInfo }) => void;\n\nexport interface Track {\n id: number;\n name: string;\n}\n\nexport interface VideoTracks {\n audio: Track[];\n subtitle: Track[];\n}\n\nexport interface VideoInfo {\n width: number;\n height: number;\n aspectRatio: string | null;\n duration: number;\n tracks: VideoTracks;\n seekable: boolean;\n}\n\nexport interface Subtitle {\n uri: string;\n enable: boolean;\n}\n\nexport interface TracksOptions {\n audio: number;\n subtitle: number;\n}\n\n/**\n * @hidden\n */\nexport interface VlcPlayerViewNativeProps {\n ref?: React.Ref<VLCPlayerViewRef>;\n uri?: string;\n subtitle?: Subtitle;\n options?: string[];\n volume?: number;\n mute?: boolean;\n rate?: number;\n tracks?: TracksOptions;\n time?: number;\n repeat?: boolean;\n aspectRatio?: string;\n audioMixingMode?: AudioMixingMode;\n playInBackground?: boolean;\n autoplay?: boolean;\n onBuffering?: BufferingListener;\n onPlaying?: PlayingListener;\n onPaused?: PausedListener;\n onStopped?: StoppedListener;\n onEnded?: EndedListener;\n onRepeat?: RepeatListener;\n onWarn?: WarnListener;\n onError?: ErrorListener;\n onPositionChanged?: PositionChangedListener;\n onLoad?: LoadListener;\n}\n\nexport type AudioMixingMode =\n | \"mixWithOthers\"\n | \"duckOthers\"\n | \"auto\"\n | \"doNotMix\";\n\nexport interface VlcPlayerViewProps extends ViewProps {\n /**\n * Sets the URI of the media to be played\n */\n uri: string;\n /**\n * Sets subtitle URI and enabled state\n *\n * @example\n * ```tsx\n * <VLCPlayerView\n * subtitle={{\n * uri: \"file://\",\n * enable: false,\n * }}\n * />\n * ```\n */\n subtitle?: Subtitle;\n /**\n * https://wiki.videolan.org/VLC_command-line_help/\n *\n * Sets the VLC options to initialize the player with\n *\n * @example [\"--network-caching=1000\"]\n *\n * @default []\n *\n */\n options?: string[];\n /**\n * Controls the player volume. Must be an integer number between `0` and `100`\n *\n * @default 100\n *\n */\n volume?: number;\n /**\n * Sets the player volume to `0`\n *\n * @default false\n *\n */\n mute?: boolean;\n /**\n * Controls the player rate. Must be a float number\n *\n * @default 1\n *\n */\n rate?: number;\n /**\n * Sets the player audio and subtitle tracks, see `VideoInfo` for tracks type\n *\n * @example\n * ```tsx\n * <VLCPlayerView\n * tracks={{\n * audio: 1,\n * subtitle: 2,\n * }}\n * />\n * ```\n */\n tracks?: TracksOptions;\n /**\n * Controls the player time once created. Must be an integer number in milliseconds\n *\n * @default 0\n *\n */\n time?: number;\n /**\n * Repeats media once playback is ended\n *\n * @default false\n *\n */\n repeat?: boolean;\n /**\n * Sets the player aspect ratio. Must be a valid string\n *\n * @example \"16:9\"\n */\n aspectRatio?: string;\n /**\n * Determines how the player will interact with other audio playing in the system\n *\n * @default \"auto\"\n */\n audioMixingMode?: AudioMixingMode;\n /**\n * Determines whether the player should continue playing after the app enters the background\n *\n * @default false\n */\n playInBackground?: boolean;\n /**\n * Autoplays media once player is created\n *\n * @default true\n *\n */\n autoplay?: boolean;\n /**\n * Event that fires when player buffers\n */\n onBuffering?: () => void;\n /**\n * Event that fires when player plays\n */\n onPlaying?: () => void;\n /**\n * Event that fires when player pauses\n */\n onPaused?: (event: Paused) => void;\n /**\n * Event that fires when player stops\n */\n onStopped?: () => void;\n /**\n * Event that fires when player reaches an end\n */\n onEnded?: () => void;\n /**\n * Event that fires when player repeats\n */\n onRepeat?: () => void;\n /**\n * Event that fires when player emits a warning\n */\n onWarn?: (event: Warn) => void;\n /**\n * Event that fires when player encounters an error\n */\n onError?: (event: Error) => void;\n /**\n * Event that fires when player position changes\n */\n onPositionChanged?: (event: PositionChanged) => void;\n /**\n * Event that fires when player loads\n */\n onLoad?: (event: VideoInfo) => void;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VlcPlayerModule.d.ts","sourceRoot":"","sources":["../src/VlcPlayerModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAuB,MAAM,MAAM,CAAC;AAGzD,OAAO,OAAO,eAAgB,SAAQ,YAAY,CAAC,EAAE,CAAC;CAAG;;AAGzD,wBAAwE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VlcPlayerModule.js","sourceRoot":"","sources":["../src/VlcPlayerModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAKzD,yDAAyD;AACzD,eAAe,mBAAmB,CAAkB,kBAAkB,CAAC,CAAC","sourcesContent":["import { NativeModule, requireNativeModule } from \"expo\";\n\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\ndeclare class VlcPlayerModule extends NativeModule<{}> {}\n\n// This call loads the native module object from the JSI.\nexport default requireNativeModule<VlcPlayerModule>(\"ExpoLibVlcPlayer\");\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { VlcPlayerViewProps, VLCPlayerViewRef } from "./VlcPlayer.types";
|
|
2
|
+
declare const VlcPlayerView: import("react").ForwardRefExoticComponent<VlcPlayerViewProps & import("react").RefAttributes<VLCPlayerViewRef>>;
|
|
3
|
+
export default VlcPlayerView;
|
|
4
|
+
//# sourceMappingURL=VlcPlayerView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VlcPlayerView.d.ts","sourceRoot":"","sources":["../src/VlcPlayerView.tsx"],"names":[],"mappings":"AAGA,OAAO,EAEL,kBAAkB,EAClB,gBAAgB,EAMjB,MAAM,mBAAmB,CAAC;AAQ3B,QAAA,MAAM,aAAa,iHA0DlB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { requireNativeView } from "expo";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { convertNativeProps } from "./utils/props";
|
|
4
|
+
const NativeView = requireNativeView("ExpoLibVlcPlayer");
|
|
5
|
+
let loggedRenderingChildrenWarning = false;
|
|
6
|
+
const VlcPlayerView = forwardRef((props, ref) => {
|
|
7
|
+
const nativeProps = convertNativeProps(props);
|
|
8
|
+
// @ts-expect-error
|
|
9
|
+
if (nativeProps.children && !loggedRenderingChildrenWarning) {
|
|
10
|
+
console.warn("The <VLCPlayerView> component does not support children. This may lead to inconsistent behaviour or crashes. If you want to render content on top of the VLCPlayer, consider using absolute positioning.");
|
|
11
|
+
loggedRenderingChildrenWarning = true;
|
|
12
|
+
}
|
|
13
|
+
const onPaused = ({ nativeEvent }) => {
|
|
14
|
+
if (props.onPaused) {
|
|
15
|
+
props.onPaused(nativeEvent);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
const onWarn = ({ nativeEvent }) => {
|
|
19
|
+
if (props.onWarn) {
|
|
20
|
+
props.onWarn(nativeEvent);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
const onError = ({ nativeEvent }) => {
|
|
24
|
+
if (props.onError) {
|
|
25
|
+
props.onError(nativeEvent);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
const onPositionChanged = ({ nativeEvent, }) => {
|
|
29
|
+
if (props.onPositionChanged) {
|
|
30
|
+
props.onPositionChanged(nativeEvent);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const onLoad = ({ nativeEvent }) => {
|
|
34
|
+
if (props.onLoad) {
|
|
35
|
+
props.onLoad(nativeEvent);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
return (<NativeView {...nativeProps} ref={ref} onPaused={onPaused} onWarn={onWarn} onError={onError} onPositionChanged={onPositionChanged} onLoad={onLoad}/>);
|
|
39
|
+
});
|
|
40
|
+
export default VlcPlayerView;
|
|
41
|
+
//# sourceMappingURL=VlcPlayerView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VlcPlayerView.js","sourceRoot":"","sources":["../src/VlcPlayerView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EAAE,UAAU,EAAsB,MAAM,OAAO,CAAC;AAYvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD,MAAM,UAAU,GACd,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;AAExC,IAAI,8BAA8B,GAAG,KAAK,CAAC;AAE3C,MAAM,aAAa,GAAG,UAAU,CAC9B,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACb,MAAM,WAAW,GAAG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C,CAAC,QAAQ,CAAC,CACnB,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,MAAM,CAAC,CAAC,MAAM,CAAC,EACf,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { requireNativeView } from \"expo\";\nimport { forwardRef, type ComponentType } from \"react\";\n\nimport {\n VlcPlayerViewNativeProps,\n VlcPlayerViewProps,\n VLCPlayerViewRef,\n type Paused,\n type Warn,\n type Error,\n type PositionChanged,\n type VideoInfo,\n} from \"./VlcPlayer.types\";\nimport { convertNativeProps } from \"./utils/props\";\n\nconst NativeView: ComponentType<VlcPlayerViewNativeProps> =\n requireNativeView(\"ExpoLibVlcPlayer\");\n\nlet loggedRenderingChildrenWarning = false;\n\nconst VlcPlayerView = forwardRef<VLCPlayerViewRef, VlcPlayerViewProps>(\n (props, ref) => {\n const nativeProps = convertNativeProps(props);\n\n // @ts-expect-error\n if (nativeProps.children && !loggedRenderingChildrenWarning) {\n console.warn(\n \"The <VLCPlayerView> component does not support children. This may lead to inconsistent behaviour or crashes. If you want to render content on top of the VLCPlayer, consider using absolute positioning.\",\n );\n loggedRenderingChildrenWarning = true;\n }\n\n const onPaused = ({ nativeEvent }: { nativeEvent: Paused }) => {\n if (props.onPaused) {\n props.onPaused(nativeEvent);\n }\n };\n\n const onWarn = ({ nativeEvent }: { nativeEvent: Warn }) => {\n if (props.onWarn) {\n props.onWarn(nativeEvent);\n }\n };\n\n const onError = ({ nativeEvent }: { nativeEvent: Error }) => {\n if (props.onError) {\n props.onError(nativeEvent);\n }\n };\n\n const onPositionChanged = ({\n nativeEvent,\n }: {\n nativeEvent: PositionChanged;\n }) => {\n if (props.onPositionChanged) {\n props.onPositionChanged(nativeEvent);\n }\n };\n\n const onLoad = ({ nativeEvent }: { nativeEvent: VideoInfo }) => {\n if (props.onLoad) {\n props.onLoad(nativeEvent);\n }\n };\n\n return (\n <NativeView\n {...nativeProps}\n ref={ref}\n onPaused={onPaused}\n onWarn={onWarn}\n onError={onError}\n onPositionChanged={onPositionChanged}\n onLoad={onLoad}\n />\n );\n },\n);\n\nexport default VlcPlayerView;\n"]}
|
package/build/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,cAAc,mBAAmB,CAAC"}
|
package/build/index.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// Reexport the native module. On native platforms, it will be resolved to VlcPlayerModule.ts
|
|
2
|
+
export { default } from "./VlcPlayerModule";
|
|
3
|
+
export { default as VLCPlayerView } from "./VlcPlayerView";
|
|
4
|
+
export * from "./VlcPlayer.types";
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,cAAc,mBAAmB,CAAC","sourcesContent":["// Reexport the native module. On native platforms, it will be resolved to VlcPlayerModule.ts\nexport { default } from \"./VlcPlayerModule\";\nexport { default as VLCPlayerView } from \"./VlcPlayerView\";\nexport * from \"./VlcPlayer.types\";\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/utils/props.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAE5B,wBAAgB,kBAAkB,CAChC,KAAK,CAAC,EAAE,kBAAkB,GACzB,wBAAwB,CAc1B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export function convertNativeProps(props) {
|
|
2
|
+
if (!props || typeof props !== "object") {
|
|
3
|
+
return {};
|
|
4
|
+
}
|
|
5
|
+
const nativeProps = {};
|
|
6
|
+
for (const [key, value] of Object.entries(props)) {
|
|
7
|
+
if (key in {}) {
|
|
8
|
+
nativeProps[key] = value;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return nativeProps;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=props.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.js","sourceRoot":"","sources":["../../src/utils/props.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,kBAAkB,CAChC,KAA0B;IAE1B,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACxC,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,WAAW,GAA6B,EAAE,CAAC;IAEjD,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACjD,IAAI,GAAG,IAAK,EAA+B,EAAE,CAAC;YAC3C,WAAmB,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACpC,CAAC;IACH,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC","sourcesContent":["import {\n VlcPlayerViewNativeProps,\n VlcPlayerViewProps,\n} from \"../VlcPlayer.types\";\n\nexport function convertNativeProps(\n props?: VlcPlayerViewProps,\n): VlcPlayerViewNativeProps {\n if (!props || typeof props !== \"object\") {\n return {};\n }\n\n const nativeProps: VlcPlayerViewNativeProps = {};\n\n for (const [key, value] of Object.entries(props)) {\n if (key in ({} as VlcPlayerViewNativeProps)) {\n (nativeProps as any)[key] = value;\n }\n }\n\n return nativeProps;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-libvlc-player",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "LibVLC Player for Expo",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"clean": "expo-module clean",
|
|
10
10
|
"lint": "expo-module lint",
|
|
11
11
|
"test": "expo-module test",
|
|
12
|
-
"prepare": "husky",
|
|
12
|
+
"prepare": "husky && expo-module prepare",
|
|
13
13
|
"prepublishOnly": "expo-module prepublishOnly",
|
|
14
14
|
"expo-module": "expo-module",
|
|
15
15
|
"open:ios": "xed example/ios",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"root":["./src/withExpoLibVlcPlayer.ts"],"version":"5.8.3"}
|