expo-libvlc-player 7.0.6 → 7.0.8
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/README.md +17 -9
- package/build/LibVlcPlayer.types.d.ts +26 -19
- package/build/LibVlcPlayer.types.d.ts.map +1 -1
- package/build/LibVlcPlayer.types.js.map +1 -1
- package/build/LibVlcPlayerModule.d.ts +1 -1
- package/build/LibVlcPlayerModule.d.ts.map +1 -1
- package/build/LibVlcPlayerModule.js.map +1 -1
- package/build/LibVlcPlayerView.d.ts +2 -2
- package/build/LibVlcPlayerView.d.ts.map +1 -1
- package/build/LibVlcPlayerView.js +3 -3
- package/build/LibVlcPlayerView.js.map +1 -1
- package/build/utils/aspect.d.ts +1 -1
- package/build/utils/aspect.d.ts.map +1 -1
- package/build/utils/aspect.js.map +1 -1
- package/build/utils/assets.d.ts +2 -1
- package/build/utils/assets.d.ts.map +1 -1
- package/build/utils/assets.js.map +1 -1
- package/build/utils/events.d.ts +1 -1
- package/build/utils/events.d.ts.map +1 -1
- package/build/utils/events.js.map +1 -1
- package/package.json +13 -17
- package/plugin/build/withExpoLibVlcPlayer.js +4 -2
- package/plugin/src/withExpoLibVlcPlayer.ts +2 -1
- package/plugin/tsconfig.json +8 -1
- package/src/LibVlcPlayer.types.ts +32 -16
- package/src/LibVlcPlayerModule.ts +1 -1
- package/src/LibVlcPlayerView.tsx +7 -8
- package/src/utils/aspect.ts +1 -1
- package/src/utils/assets.ts +3 -1
- package/src/utils/events.ts +1 -1
- package/tsconfig.json +19 -1
package/README.md
CHANGED
|
@@ -125,10 +125,10 @@ See the [Example App](example/App.tsx) for additional usage.
|
|
|
125
125
|
| `play()` | Starts playback of the current player | `Promise<void>` |
|
|
126
126
|
| `pause()` | Pauses playback of the current player | `Promise<void>` |
|
|
127
127
|
| `stop()` | Stops playback of the current player | `Promise<void>` |
|
|
128
|
-
| `seek(value: number, type?: "time" \| "position")` | Sets the time or position of the current player. Must be
|
|
129
|
-
| `record(path?: string)` | Starts or stops recording the current media. Must be a valid directory path
|
|
130
|
-
| `snapshot(path: string)` | Takes a snapshot of the current media. Must be a valid directory path
|
|
131
|
-
| `postAction(action:
|
|
128
|
+
| `seek(value: number, type?: "time" \| "position")` | Sets the time or position of the current player. Must be an integer equal or greater than `0`, type defaults to `"time"` | `Promise<void>` |
|
|
129
|
+
| `record(path?: string)` | Starts or stops recording the current media. Must be a valid directory path or `undefined` to stop recording | `Promise<void>` |
|
|
130
|
+
| `snapshot(path: string)` | Takes a snapshot of the current media. Must be a valid directory path | `Promise<void>` |
|
|
131
|
+
| `postAction(action: 1 \| 2)` | Posts an answer to a [`Dialog`](#dialog). Must be either `1` or `2` | `Promise<void>` |
|
|
132
132
|
| `postLogin(username: string, password: string, store?: boolean)` | Posts a username and password to a login [`Dialog`](#dialog). Username can't be empty, password can be empty and if `true`, store the credentials | `Promise<void>` |
|
|
133
133
|
| `dismiss()` | Dismisses a [`Dialog`](#dialog) | `Promise<void>` |
|
|
134
134
|
| `startPictureInPicture()` | Enters Picture-in-Picture (PiP) mode. Config plugin has to be configured for Picture-in-Picture (PiP) to work | `Promise<void>` |
|
|
@@ -145,7 +145,7 @@ The `LibVlcPlayerView` extends React Native `ViewProps` and implements the follo
|
|
|
145
145
|
| `tracks` | Sets the player audio, video and subtitle tracks. See [`Tracks`](#tracks) for more | `undefined` |
|
|
146
146
|
| `slaves` | Sets the player audio and subtitle slaves. See [`Slave`](#slave) for more | `[]` |
|
|
147
147
|
| `scale` | Sets the player scaling factor. Must be a float equal or greater than `0` | `0` |
|
|
148
|
-
| `aspectRatio` | Sets the container aspect ratio. Must be a valid ratio
|
|
148
|
+
| `aspectRatio` | Sets the container aspect ratio. Must be a valid ratio, float or `"auto"` | `undefined` |
|
|
149
149
|
| `contentFit` | Sets how the video should be scaled to fit in the container | `"contain"` |
|
|
150
150
|
| `rate` | Sets the player rate. Must be a float equal or greater than `1` | `1` |
|
|
151
151
|
| `time` | Sets the initial player time. Must be an integer in milliseconds | `0` |
|
|
@@ -182,25 +182,33 @@ The `LibVlcPlayerView` extends React Native `ViewProps` and implements the follo
|
|
|
182
182
|
#### `Error`
|
|
183
183
|
|
|
184
184
|
```ts
|
|
185
|
-
|
|
185
|
+
interface Error {
|
|
186
|
+
message: string;
|
|
187
|
+
}
|
|
186
188
|
```
|
|
187
189
|
|
|
188
190
|
#### `Time`
|
|
189
191
|
|
|
190
192
|
```ts
|
|
191
|
-
|
|
193
|
+
interface Time {
|
|
194
|
+
value: number;
|
|
195
|
+
}
|
|
192
196
|
```
|
|
193
197
|
|
|
194
198
|
#### `Position`
|
|
195
199
|
|
|
196
200
|
```ts
|
|
197
|
-
|
|
201
|
+
interface Position {
|
|
202
|
+
value: number;
|
|
203
|
+
}
|
|
198
204
|
```
|
|
199
205
|
|
|
200
206
|
#### `Snapshot`
|
|
201
207
|
|
|
202
208
|
```ts
|
|
203
|
-
|
|
209
|
+
interface Snapshot {
|
|
210
|
+
path: string;
|
|
211
|
+
}
|
|
204
212
|
```
|
|
205
213
|
|
|
206
214
|
#### `Tracks`
|
|
@@ -22,7 +22,7 @@ export interface LibVlcPlayerViewRef {
|
|
|
22
22
|
/**
|
|
23
23
|
* Sets the time or position of the current player
|
|
24
24
|
*
|
|
25
|
-
* @param value - Must be
|
|
25
|
+
* @param value - Must be an integer equal or greater than `0`
|
|
26
26
|
* @param type - Defaults to `"time"`
|
|
27
27
|
*
|
|
28
28
|
* @returns A promise which resolves to `void`
|
|
@@ -31,7 +31,7 @@ export interface LibVlcPlayerViewRef {
|
|
|
31
31
|
/**
|
|
32
32
|
* Starts or stops recording the current media
|
|
33
33
|
*
|
|
34
|
-
* @param path - Must be a valid directory path
|
|
34
|
+
* @param path - Must be a valid directory path or `undefined` to stop recording
|
|
35
35
|
*
|
|
36
36
|
* @returns A promise which resolves to `void`
|
|
37
37
|
*/
|
|
@@ -39,7 +39,7 @@ export interface LibVlcPlayerViewRef {
|
|
|
39
39
|
/**
|
|
40
40
|
* Takes a snapshot of the current media
|
|
41
41
|
*
|
|
42
|
-
* @param path - Must be a valid directory path
|
|
42
|
+
* @param path - Must be a valid directory path
|
|
43
43
|
*
|
|
44
44
|
* @returns A promise which resolves to `void`
|
|
45
45
|
*/
|
|
@@ -47,7 +47,7 @@ export interface LibVlcPlayerViewRef {
|
|
|
47
47
|
/**
|
|
48
48
|
* Posts an answer to a `Dialog`
|
|
49
49
|
*
|
|
50
|
-
* @param action - Must be
|
|
50
|
+
* @param action - Must be either `1` or `2`
|
|
51
51
|
*
|
|
52
52
|
* @returns A promise which resolves to `void`
|
|
53
53
|
*/
|
|
@@ -86,17 +86,18 @@ export interface LibVlcPlayerViewRef {
|
|
|
86
86
|
readonly stopPictureInPicture: () => Promise<void>;
|
|
87
87
|
}
|
|
88
88
|
export type LibVlcSource = string | number | null;
|
|
89
|
+
export type LibVlcSlaveSource = string | number;
|
|
89
90
|
export interface Tracks {
|
|
90
91
|
audio?: number;
|
|
91
92
|
video?: number;
|
|
92
93
|
subtitle?: number;
|
|
93
94
|
}
|
|
94
95
|
export interface Slave {
|
|
95
|
-
source:
|
|
96
|
+
source: LibVlcSlaveSource;
|
|
96
97
|
type: "audio" | "subtitle";
|
|
97
98
|
selected?: boolean;
|
|
98
99
|
}
|
|
99
|
-
export type VideoAspectRatio = "auto" | string | number;
|
|
100
|
+
export type VideoAspectRatio = "auto" | (string & {}) | number;
|
|
100
101
|
export type VideoContentFit = "contain" | "cover" | "fill";
|
|
101
102
|
export type AudioMixingMode = "mixWithOthers" | "duckOthers" | "auto" | "doNotMix";
|
|
102
103
|
export interface NativeEventProps {
|
|
@@ -106,18 +107,18 @@ export interface NativeEvent<T> {
|
|
|
106
107
|
nativeEvent: T & NativeEventProps;
|
|
107
108
|
}
|
|
108
109
|
export type LibVlcEvent<T> = Omit<T & NativeEventProps, "target">;
|
|
109
|
-
export
|
|
110
|
+
export interface Error {
|
|
110
111
|
message: string;
|
|
111
|
-
}
|
|
112
|
-
export
|
|
112
|
+
}
|
|
113
|
+
export interface Time {
|
|
113
114
|
value: number;
|
|
114
|
-
}
|
|
115
|
-
export
|
|
115
|
+
}
|
|
116
|
+
export interface Position {
|
|
116
117
|
value: number;
|
|
117
|
-
}
|
|
118
|
-
export
|
|
118
|
+
}
|
|
119
|
+
export interface Snapshot {
|
|
119
120
|
path: string;
|
|
120
|
-
}
|
|
121
|
+
}
|
|
121
122
|
export interface Dialog {
|
|
122
123
|
title: string;
|
|
123
124
|
text: string;
|
|
@@ -247,6 +248,14 @@ export interface LibVlcPlayerViewNativeProps extends ViewProps {
|
|
|
247
248
|
onPictureInPictureStop?: PictureInPictureStopListener;
|
|
248
249
|
}
|
|
249
250
|
export interface LibVlcPlayerViewProps extends ViewProps {
|
|
251
|
+
/**
|
|
252
|
+
* Allows getting a ref to the component instance.
|
|
253
|
+
*
|
|
254
|
+
* Once the component unmounts, React will set `ref.current` to `null`
|
|
255
|
+
*
|
|
256
|
+
* @see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs}
|
|
257
|
+
*/
|
|
258
|
+
ref: React.RefObject<LibVlcPlayerViewRef | null>;
|
|
250
259
|
/**
|
|
251
260
|
* Sets the source of the media to be played. Set to `null` to release the player
|
|
252
261
|
*
|
|
@@ -261,11 +270,9 @@ export interface LibVlcPlayerViewProps extends ViewProps {
|
|
|
261
270
|
*/
|
|
262
271
|
source: LibVlcSource;
|
|
263
272
|
/**
|
|
264
|
-
* Sets the options to initialize the media with
|
|
265
|
-
*
|
|
266
|
-
* See the VideoLAN Wiki for more:
|
|
273
|
+
* Sets the options to initialize the media with
|
|
267
274
|
*
|
|
268
|
-
* https://wiki.videolan.org/VLC_command-line_help/
|
|
275
|
+
* @see {@link https://wiki.videolan.org/VLC_command-line_help/ VideoLAN Wiki}
|
|
269
276
|
*
|
|
270
277
|
* @example
|
|
271
278
|
*
|
|
@@ -332,7 +339,7 @@ export interface LibVlcPlayerViewProps extends ViewProps {
|
|
|
332
339
|
*/
|
|
333
340
|
scale?: number;
|
|
334
341
|
/**
|
|
335
|
-
* Sets the container aspect ratio. Must be a valid ratio
|
|
342
|
+
* Sets the container aspect ratio. Must be a valid ratio, float or `"auto"`
|
|
336
343
|
*
|
|
337
344
|
* @example "16:9"
|
|
338
345
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LibVlcPlayer.types.d.ts","sourceRoot":"","sources":["../src/LibVlcPlayer.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG9C,MAAM,MAAM,wBAAwB,GAAG,EAAE,CAAC;AAE1C,MAAM,WAAW,mBAAmB;IAClC;;;;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;;;;;;;OAOG;IACH,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5E;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAClD;;;;;;OAMG;IACH,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD;;;;;;OAMG;IACH,QAAQ,CAAC,UAAU,EAAE,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtD;;;;;;;;OAQG;IACH,QAAQ,CAAC,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,EAA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AC,EAAE,MAAM,IAAI,CAAC;IACzB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB;;OAEG;IACH,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAC5C;;OAEG;IACH,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,KAAK,IAAI,CAAC;IACtC;;OAEG;IACH,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC9C;;OAEG;IACH,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IACzC;;OAEG;IACH,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;IAC7C;;OAEG;IACH,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC5C;;OAEG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;IACzC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B;;OAEG;IACH,uBAAuB,CAAC,EAAE,MAAM,IAAI,CAAC;IACrC;;OAEG;IACH,sBAAsB,CAAC,EAAE,MAAM,IAAI,CAAC;CACrC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LibVlcPlayer.types.js","sourceRoot":"","sources":["../src/LibVlcPlayer.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ViewProps } from \"react-native\";\n\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport type LibVlcPlayerModuleEvents = {};\n\nexport interface LibVlcPlayerViewRef {\n /**\n * Starts playback of the current player\n *\n * @returns A promise which resolves to `void`\n */\n readonly play: () => Promise<void>;\n /**\n * Pauses playback of the current player\n *\n * @returns A promise which resolves to `void`\n */\n readonly pause: () => Promise<void>;\n /**\n * Stops playback of the current player\n *\n * @returns A promise which resolves to `void`\n */\n readonly stop: () => Promise<void>;\n /**\n * Sets the time or position of the current player\n *\n * @param value - Must be a number equal or greater than `0`\n * @param type - Defaults to `\"time\"`\n *\n * @returns A promise which resolves to `void`\n */\n readonly seek: (value: number, type?: \"time\" | \"position\") => Promise<void>;\n /**\n * Starts or stops recording the current media\n *\n * @param path - Must be a valid directory path string or `undefined` to stop recording\n *\n * @returns A promise which resolves to `void`\n */\n readonly record: (path?: string) => Promise<void>;\n /**\n * Takes a snapshot of the current media\n *\n * @param path - Must be a valid directory path string\n *\n * @returns A promise which resolves to `void`\n */\n readonly snapshot: (path: string) => Promise<void>;\n /**\n * Posts an answer to a `Dialog`\n *\n * @param action - Must be an integer of `1` or `2`\n *\n * @returns A promise which resolves to `void`\n */\n readonly postAction: (action: 1 | 2) => Promise<void>;\n /**\n * Posts a username and password to a login `Dialog`\n *\n * @param username - Must be a valid username, can't be empty\n * @param password - Must be a valid password, can be empty\n * @param store - If `true`, store the credentials\n *\n * @returns A promise which resolves to `void`\n */\n readonly postLogin: (username: string, password: string, store?: boolean) => Promise<void>;\n /**\n * Dismisses a `Dialog`\n *\n * @returns A promise which resolves to `void`\n */\n readonly dismiss: () => Promise<void>;\n /**\n * Enters Picture-in-Picture (PiP) mode\n *\n * @note Config plugin has to be configured for Picture-in-Picture (PiP) to work\n *\n * @returns A promise which resolves to `void`\n */\n readonly startPictureInPicture: () => Promise<void>;\n /**\n * Exits Picture-in-Picture (PiP) mode\n *\n * @platform ios\n *\n * @returns A promise which resolves to `void`\n */\n readonly stopPictureInPicture: () => Promise<void>;\n}\n\nexport type LibVlcSource = string | number | null;\n\nexport interface Tracks {\n audio?: number;\n video?: number;\n subtitle?: number;\n}\n\nexport interface Slave {\n source: NonNullable<LibVlcSource>;\n type: \"audio\" | \"subtitle\";\n selected?: boolean;\n}\n\nexport type VideoAspectRatio = \"auto\" | string | number;\n\nexport type VideoContentFit = \"contain\" | \"cover\" | \"fill\";\n\nexport type AudioMixingMode = \"mixWithOthers\" | \"duckOthers\" | \"auto\" | \"doNotMix\";\n\nexport interface NativeEventProps {\n target: number;\n}\n\nexport interface NativeEvent<T> {\n nativeEvent: T & NativeEventProps;\n}\n\nexport type LibVlcEvent<T> = Omit<T & NativeEventProps, \"target\">;\n\nexport type Error = { message: string };\n\nexport type Time = { value: number };\n\nexport type Position = { value: number };\n\nexport type Snapshot = { path: string };\n\nexport interface Dialog {\n title: string;\n text: string;\n type: \"error\" | \"login\" | \"question\";\n cancelText?: string;\n action1Text?: string;\n action2Text?: string;\n}\n\nexport interface Recording {\n path: string | null;\n isRecording: boolean;\n}\n\nexport interface Track {\n id: number;\n name: string;\n}\n\nexport interface MediaTracks {\n audio: Track[];\n video: Track[];\n subtitle: Track[];\n}\n\nexport interface MediaInfo {\n width: number;\n height: number;\n length: number;\n seekable: boolean;\n}\n\n/**\n * @hidden\n */\ntype BufferingListener = () => void;\n\n/**\n * @hidden\n */\ntype PlayingListener = () => void;\n\n/**\n * @hidden\n */\ntype PausedListener = () => void;\n\n/**\n * @hidden\n */\ntype StoppedListener = () => void;\n\n/**\n * @hidden\n */\ntype EncounteredErrorListener = (event: NativeEvent<Error>) => void;\n\n/**\n * @hidden\n */\ntype TimeChangedListener = (event: NativeEvent<Time>) => void;\n\n/**\n * @hidden\n */\ntype PositionChangedListener = (event: NativeEvent<Position>) => void;\n\n/**\n * @hidden\n */\ntype ESAddedListener = (event: NativeEvent<MediaTracks>) => void;\n\n/**\n * @hidden\n */\ntype RecordChangedListener = (event: NativeEvent<Recording>) => void;\n\n/**\n * @hidden\n */\ntype SnapshotTakenListener = (event: NativeEvent<Snapshot>) => void;\n\n/**\n * @hidden\n */\ntype DialogDisplayListener = (event: NativeEvent<Dialog>) => void;\n\n/**\n * @hidden\n */\ntype FirstPlayListener = (event: NativeEvent<MediaInfo>) => void;\n\n/**\n * @hidden\n */\ntype ForegroundListener = () => void;\n\n/**\n * @hidden\n */\ntype BackgroundListener = () => void;\n\n/**\n * @hidden\n */\ntype PictureInPictureStartListener = () => void;\n\n/**\n * @hidden\n */\ntype PictureInPictureStopListener = () => void;\n\n/**\n * @hidden\n */\nexport interface LibVlcPlayerViewNativeProps extends ViewProps {\n ref?: React.Ref<LibVlcPlayerViewRef>;\n source?: LibVlcSource;\n options?: string[];\n tracks?: Tracks;\n slaves?: Slave[];\n scale?: number;\n aspectRatio?: VideoAspectRatio;\n contentFit?: VideoContentFit;\n rate?: number;\n time?: number;\n volume?: number;\n mute?: boolean;\n audioMixingMode?: AudioMixingMode;\n repeat?: boolean;\n autoplay?: boolean;\n pictureInPicture?: boolean;\n onBuffering?: BufferingListener;\n onPlaying?: PlayingListener;\n onPaused?: PausedListener;\n onStopped?: StoppedListener;\n onEncounteredError?: EncounteredErrorListener;\n onDialogDisplay?: DialogDisplayListener;\n onTimeChanged?: TimeChangedListener;\n onPositionChanged?: PositionChangedListener;\n onESAdded?: ESAddedListener;\n onRecordChanged?: RecordChangedListener;\n onSnapshotTaken?: SnapshotTakenListener;\n onFirstPlay?: FirstPlayListener;\n onForeground?: ForegroundListener;\n onBackground?: BackgroundListener;\n onPictureInPictureStart?: PictureInPictureStartListener;\n onPictureInPictureStop?: PictureInPictureStopListener;\n}\n\nexport interface LibVlcPlayerViewProps extends ViewProps {\n /**\n * Sets the source of the media to be played. Set to `null` to release the player\n *\n * @example\n *\n * ```tsx\n * const BIG_BUCK_BUNNY =\n * \"https://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_720p_h264.mov\";\n *\n * <LibVlcPlayerView source={BIG_BUCK_BUNNY} />\n * ```\n */\n source: LibVlcSource;\n /**\n * Sets the options to initialize the media with.\n *\n * See the VideoLAN Wiki for more:\n *\n * https://wiki.videolan.org/VLC_command-line_help/\n *\n * @example\n *\n * ```tsx\n * const options = [\"--network-caching=1000\"];\n *\n * <LibVlcPlayerView\n * source={BIG_BUCK_BUNNY}\n * options={options}\n * />\n * ```\n *\n * @default []\n */\n options?: string[];\n /**\n * Sets the player audio, video and subtitle tracks\n *\n * @example\n *\n * ```tsx\n * const tracks = {\n * audio: -1,\n * video: 1,\n * subtitle: 1,\n * };\n *\n * <LibVlcPlayerView\n * source={BIG_BUCK_BUNNY}\n * tracks={tracks}\n * />\n * ```\n *\n * @default undefined\n */\n tracks?: Tracks;\n /**\n * Sets the player audio and subtitle slaves\n *\n * @example\n *\n * ```tsx\n * const slaves = [\n * {\n * source: \"file://path/to/subtitle.srt\",\n * type: \"subtitle\",\n * selected: true,\n * },\n * ];\n *\n * <LibVlcPlayerView\n * source={BIG_BUCK_BUNNY}\n * slaves={slaves}\n * />\n * ```\n *\n * @default []\n */\n slaves?: Slave[];\n /**\n * Sets the player scaling factor. Must be a float equal or greater than `0`\n *\n * @default 0\n */\n scale?: number;\n /**\n * Sets the container aspect ratio. Must be a valid ratio string or number\n *\n * @example \"16:9\"\n *\n * @default undefined\n */\n aspectRatio?: VideoAspectRatio;\n /**\n * Sets how the video should be scaled to fit in the container\n *\n * @example \"cover\"\n *\n * @default \"contain\"\n */\n contentFit?: VideoContentFit;\n /**\n * Sets the player rate. Must be a float equal or greater than `1`\n *\n * @default 1\n */\n rate?: number;\n /**\n * Sets the initial player time. Must be an integer in milliseconds\n *\n * @default 0\n */\n time?: number;\n /**\n * Sets the player volume. Must be an integer between `0` and `100`\n *\n * @default 100\n */\n volume?: number;\n /**\n * Sets the player volume to `0` when `true`. Previous value is set when `false`\n *\n * @default false\n */\n mute?: boolean;\n /**\n * Determines how the player will interact with other audio playing in the system\n *\n * @example \"doNotMix\"\n *\n * @default \"auto\"\n */\n audioMixingMode?: AudioMixingMode;\n /**\n * Determines whether the media should repeat once ended\n *\n * @default false\n */\n repeat?: boolean;\n /**\n * Determines whether the media should autoplay once created\n *\n * @default true\n */\n autoplay?: boolean;\n /**\n * Determines whether the player should allow Picture-in-Picture (PiP) mode\n *\n * @default false\n */\n pictureInPicture?: boolean;\n /**\n * Called after the `Buffering` player event\n */\n onBuffering?: () => void;\n /**\n * Called after the `Playing` player event\n */\n onPlaying?: () => void;\n /**\n * Called after the `Paused` player event\n */\n onPaused?: () => void;\n /**\n * Called after the `Stopped` player event\n */\n onStopped?: () => void;\n /**\n * Called after the `EncounteredError` player event\n */\n onEncounteredError?: (event: Error) => void;\n /**\n * Called after a `Dialog` needs to be displayed\n */\n onDialogDisplay?: (event: Dialog) => void;\n /**\n * Called after the `TimeChanged` player event\n */\n onTimeChanged?: (event: Time) => void;\n /**\n * Called after the `PositionChanged` player event\n */\n onPositionChanged?: (event: Position) => void;\n /**\n * Called after the `ESAdded` player event\n */\n onESAdded?: (event: MediaTracks) => void;\n /**\n * Called after the `RecordChanged` player event\n */\n onRecordChanged?: (event: Recording) => void;\n /**\n * Called after a media snapshot is taken\n */\n onSnapshotTaken?: (event: Snapshot) => void;\n /**\n * Called after the player first playing event\n */\n onFirstPlay?: (event: MediaInfo) => void;\n /**\n * Called after the player enters the foreground\n */\n onForeground?: () => void;\n /**\n * Called after the player enters the background\n */\n onBackground?: () => void;\n /**\n * Called after the player enters Picture-in-Picture (PiP) mode\n */\n onPictureInPictureStart?: () => void;\n /**\n * Called after the player exits Picture-in-Picture (PiP) mode\n */\n onPictureInPictureStop?: () => void;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"LibVlcPlayer.types.js","sourceRoot":"","sources":["../src/LibVlcPlayer.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ViewProps } from \"react-native\";\n\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type, @typescript-eslint/consistent-type-definitions\nexport type LibVlcPlayerModuleEvents = {};\n\nexport interface LibVlcPlayerViewRef {\n /**\n * Starts playback of the current player\n *\n * @returns A promise which resolves to `void`\n */\n readonly play: () => Promise<void>;\n /**\n * Pauses playback of the current player\n *\n * @returns A promise which resolves to `void`\n */\n readonly pause: () => Promise<void>;\n /**\n * Stops playback of the current player\n *\n * @returns A promise which resolves to `void`\n */\n readonly stop: () => Promise<void>;\n /**\n * Sets the time or position of the current player\n *\n * @param value - Must be an integer equal or greater than `0`\n * @param type - Defaults to `\"time\"`\n *\n * @returns A promise which resolves to `void`\n */\n readonly seek: (value: number, type?: \"time\" | \"position\") => Promise<void>;\n /**\n * Starts or stops recording the current media\n *\n * @param path - Must be a valid directory path or `undefined` to stop recording\n *\n * @returns A promise which resolves to `void`\n */\n readonly record: (path?: string) => Promise<void>;\n /**\n * Takes a snapshot of the current media\n *\n * @param path - Must be a valid directory path\n *\n * @returns A promise which resolves to `void`\n */\n readonly snapshot: (path: string) => Promise<void>;\n /**\n * Posts an answer to a `Dialog`\n *\n * @param action - Must be either `1` or `2`\n *\n * @returns A promise which resolves to `void`\n */\n readonly postAction: (action: 1 | 2) => Promise<void>;\n /**\n * Posts a username and password to a login `Dialog`\n *\n * @param username - Must be a valid username, can't be empty\n * @param password - Must be a valid password, can be empty\n * @param store - If `true`, store the credentials\n *\n * @returns A promise which resolves to `void`\n */\n readonly postLogin: (username: string, password: string, store?: boolean) => Promise<void>;\n /**\n * Dismisses a `Dialog`\n *\n * @returns A promise which resolves to `void`\n */\n readonly dismiss: () => Promise<void>;\n /**\n * Enters Picture-in-Picture (PiP) mode\n *\n * @note Config plugin has to be configured for Picture-in-Picture (PiP) to work\n *\n * @returns A promise which resolves to `void`\n */\n readonly startPictureInPicture: () => Promise<void>;\n /**\n * Exits Picture-in-Picture (PiP) mode\n *\n * @platform ios\n *\n * @returns A promise which resolves to `void`\n */\n readonly stopPictureInPicture: () => Promise<void>;\n}\n\nexport type LibVlcSource = string | number | null;\n\nexport type LibVlcSlaveSource = string | number;\n\nexport interface Tracks {\n audio?: number;\n video?: number;\n subtitle?: number;\n}\n\nexport interface Slave {\n source: LibVlcSlaveSource;\n type: \"audio\" | \"subtitle\";\n selected?: boolean;\n}\n\nexport type VideoAspectRatio = \"auto\" | (string & {}) | number;\n\nexport type VideoContentFit = \"contain\" | \"cover\" | \"fill\";\n\nexport type AudioMixingMode = \"mixWithOthers\" | \"duckOthers\" | \"auto\" | \"doNotMix\";\n\nexport interface NativeEventProps {\n target: number;\n}\n\nexport interface NativeEvent<T> {\n nativeEvent: T & NativeEventProps;\n}\n\nexport type LibVlcEvent<T> = Omit<T & NativeEventProps, \"target\">;\n\nexport interface Error {\n message: string;\n}\n\nexport interface Time {\n value: number;\n}\n\nexport interface Position {\n value: number;\n}\n\nexport interface Snapshot {\n path: string;\n}\n\nexport interface Dialog {\n title: string;\n text: string;\n type: \"error\" | \"login\" | \"question\";\n cancelText?: string;\n action1Text?: string;\n action2Text?: string;\n}\n\nexport interface Recording {\n path: string | null;\n isRecording: boolean;\n}\n\nexport interface Track {\n id: number;\n name: string;\n}\n\nexport interface MediaTracks {\n audio: Track[];\n video: Track[];\n subtitle: Track[];\n}\n\nexport interface MediaInfo {\n width: number;\n height: number;\n length: number;\n seekable: boolean;\n}\n\n/**\n * @hidden\n */\ntype BufferingListener = () => void;\n\n/**\n * @hidden\n */\ntype PlayingListener = () => void;\n\n/**\n * @hidden\n */\ntype PausedListener = () => void;\n\n/**\n * @hidden\n */\ntype StoppedListener = () => void;\n\n/**\n * @hidden\n */\ntype EncounteredErrorListener = (event: NativeEvent<Error>) => void;\n\n/**\n * @hidden\n */\ntype TimeChangedListener = (event: NativeEvent<Time>) => void;\n\n/**\n * @hidden\n */\ntype PositionChangedListener = (event: NativeEvent<Position>) => void;\n\n/**\n * @hidden\n */\ntype ESAddedListener = (event: NativeEvent<MediaTracks>) => void;\n\n/**\n * @hidden\n */\ntype RecordChangedListener = (event: NativeEvent<Recording>) => void;\n\n/**\n * @hidden\n */\ntype SnapshotTakenListener = (event: NativeEvent<Snapshot>) => void;\n\n/**\n * @hidden\n */\ntype DialogDisplayListener = (event: NativeEvent<Dialog>) => void;\n\n/**\n * @hidden\n */\ntype FirstPlayListener = (event: NativeEvent<MediaInfo>) => void;\n\n/**\n * @hidden\n */\ntype ForegroundListener = () => void;\n\n/**\n * @hidden\n */\ntype BackgroundListener = () => void;\n\n/**\n * @hidden\n */\ntype PictureInPictureStartListener = () => void;\n\n/**\n * @hidden\n */\ntype PictureInPictureStopListener = () => void;\n\n/**\n * @hidden\n */\nexport interface LibVlcPlayerViewNativeProps extends ViewProps {\n ref?: React.Ref<LibVlcPlayerViewRef>;\n source?: LibVlcSource;\n options?: string[];\n tracks?: Tracks;\n slaves?: Slave[];\n scale?: number;\n aspectRatio?: VideoAspectRatio;\n contentFit?: VideoContentFit;\n rate?: number;\n time?: number;\n volume?: number;\n mute?: boolean;\n audioMixingMode?: AudioMixingMode;\n repeat?: boolean;\n autoplay?: boolean;\n pictureInPicture?: boolean;\n onBuffering?: BufferingListener;\n onPlaying?: PlayingListener;\n onPaused?: PausedListener;\n onStopped?: StoppedListener;\n onEncounteredError?: EncounteredErrorListener;\n onDialogDisplay?: DialogDisplayListener;\n onTimeChanged?: TimeChangedListener;\n onPositionChanged?: PositionChangedListener;\n onESAdded?: ESAddedListener;\n onRecordChanged?: RecordChangedListener;\n onSnapshotTaken?: SnapshotTakenListener;\n onFirstPlay?: FirstPlayListener;\n onForeground?: ForegroundListener;\n onBackground?: BackgroundListener;\n onPictureInPictureStart?: PictureInPictureStartListener;\n onPictureInPictureStop?: PictureInPictureStopListener;\n}\n\nexport interface LibVlcPlayerViewProps extends ViewProps {\n /**\n * Allows getting a ref to the component instance.\n *\n * Once the component unmounts, React will set `ref.current` to `null`\n *\n * @see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs}\n */\n ref: React.RefObject<LibVlcPlayerViewRef | null>;\n /**\n * Sets the source of the media to be played. Set to `null` to release the player\n *\n * @example\n *\n * ```tsx\n * const BIG_BUCK_BUNNY =\n * \"https://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_720p_h264.mov\";\n *\n * <LibVlcPlayerView source={BIG_BUCK_BUNNY} />\n * ```\n */\n source: LibVlcSource;\n /**\n * Sets the options to initialize the media with\n *\n * @see {@link https://wiki.videolan.org/VLC_command-line_help/ VideoLAN Wiki}\n *\n * @example\n *\n * ```tsx\n * const options = [\"--network-caching=1000\"];\n *\n * <LibVlcPlayerView\n * source={BIG_BUCK_BUNNY}\n * options={options}\n * />\n * ```\n *\n * @default []\n */\n options?: string[];\n /**\n * Sets the player audio, video and subtitle tracks\n *\n * @example\n *\n * ```tsx\n * const tracks = {\n * audio: -1,\n * video: 1,\n * subtitle: 1,\n * };\n *\n * <LibVlcPlayerView\n * source={BIG_BUCK_BUNNY}\n * tracks={tracks}\n * />\n * ```\n *\n * @default undefined\n */\n tracks?: Tracks;\n /**\n * Sets the player audio and subtitle slaves\n *\n * @example\n *\n * ```tsx\n * const slaves = [\n * {\n * source: \"file://path/to/subtitle.srt\",\n * type: \"subtitle\",\n * selected: true,\n * },\n * ];\n *\n * <LibVlcPlayerView\n * source={BIG_BUCK_BUNNY}\n * slaves={slaves}\n * />\n * ```\n *\n * @default []\n */\n slaves?: Slave[];\n /**\n * Sets the player scaling factor. Must be a float equal or greater than `0`\n *\n * @default 0\n */\n scale?: number;\n /**\n * Sets the container aspect ratio. Must be a valid ratio, float or `\"auto\"`\n *\n * @example \"16:9\"\n *\n * @default undefined\n */\n aspectRatio?: VideoAspectRatio;\n /**\n * Sets how the video should be scaled to fit in the container\n *\n * @example \"cover\"\n *\n * @default \"contain\"\n */\n contentFit?: VideoContentFit;\n /**\n * Sets the player rate. Must be a float equal or greater than `1`\n *\n * @default 1\n */\n rate?: number;\n /**\n * Sets the initial player time. Must be an integer in milliseconds\n *\n * @default 0\n */\n time?: number;\n /**\n * Sets the player volume. Must be an integer between `0` and `100`\n *\n * @default 100\n */\n volume?: number;\n /**\n * Sets the player volume to `0` when `true`. Previous value is set when `false`\n *\n * @default false\n */\n mute?: boolean;\n /**\n * Determines how the player will interact with other audio playing in the system\n *\n * @example \"doNotMix\"\n *\n * @default \"auto\"\n */\n audioMixingMode?: AudioMixingMode;\n /**\n * Determines whether the media should repeat once ended\n *\n * @default false\n */\n repeat?: boolean;\n /**\n * Determines whether the media should autoplay once created\n *\n * @default true\n */\n autoplay?: boolean;\n /**\n * Determines whether the player should allow Picture-in-Picture (PiP) mode\n *\n * @default false\n */\n pictureInPicture?: boolean;\n /**\n * Called after the `Buffering` player event\n */\n onBuffering?: () => void;\n /**\n * Called after the `Playing` player event\n */\n onPlaying?: () => void;\n /**\n * Called after the `Paused` player event\n */\n onPaused?: () => void;\n /**\n * Called after the `Stopped` player event\n */\n onStopped?: () => void;\n /**\n * Called after the `EncounteredError` player event\n */\n onEncounteredError?: (event: Error) => void;\n /**\n * Called after a `Dialog` needs to be displayed\n */\n onDialogDisplay?: (event: Dialog) => void;\n /**\n * Called after the `TimeChanged` player event\n */\n onTimeChanged?: (event: Time) => void;\n /**\n * Called after the `PositionChanged` player event\n */\n onPositionChanged?: (event: Position) => void;\n /**\n * Called after the `ESAdded` player event\n */\n onESAdded?: (event: MediaTracks) => void;\n /**\n * Called after the `RecordChanged` player event\n */\n onRecordChanged?: (event: Recording) => void;\n /**\n * Called after a media snapshot is taken\n */\n onSnapshotTaken?: (event: Snapshot) => void;\n /**\n * Called after the player first playing event\n */\n onFirstPlay?: (event: MediaInfo) => void;\n /**\n * Called after the player enters the foreground\n */\n onForeground?: () => void;\n /**\n * Called after the player enters the background\n */\n onBackground?: () => void;\n /**\n * Called after the player enters Picture-in-Picture (PiP) mode\n */\n onPictureInPictureStart?: () => void;\n /**\n * Called after the player exits Picture-in-Picture (PiP) mode\n */\n onPictureInPictureStop?: () => void;\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NativeModule } from "expo";
|
|
2
|
-
import { LibVlcPlayerModuleEvents } from "./LibVlcPlayer.types";
|
|
2
|
+
import { type LibVlcPlayerModuleEvents } from "./LibVlcPlayer.types";
|
|
3
3
|
declare class LibVlcPlayerModule extends NativeModule<LibVlcPlayerModuleEvents> {
|
|
4
4
|
/** Attempts to trigger the local network privacy alert
|
|
5
5
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LibVlcPlayerModule.d.ts","sourceRoot":"","sources":["../src/LibVlcPlayerModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAuB,MAAM,MAAM,CAAC;AAEzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"LibVlcPlayerModule.d.ts","sourceRoot":"","sources":["../src/LibVlcPlayerModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAuB,MAAM,MAAM,CAAC;AAEzD,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAErE,OAAO,OAAO,kBAAmB,SAAQ,YAAY,CAAC,wBAAwB,CAAC;IAC7E;;;;;OAKG;IACH,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IACpC;;;;OAIG;IACH,2BAA2B,IAAI,OAAO;CACvC;;AAED,wBAA2E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LibVlcPlayerModule.js","sourceRoot":"","sources":["../src/LibVlcPlayerModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAoBzD,eAAe,mBAAmB,CAAqB,kBAAkB,CAAC,CAAC","sourcesContent":["import { NativeModule, requireNativeModule } from \"expo\";\n\nimport { LibVlcPlayerModuleEvents } from \"./LibVlcPlayer.types\";\n\ndeclare class LibVlcPlayerModule extends NativeModule<LibVlcPlayerModuleEvents> {\n /** Attempts to trigger the local network privacy alert\n *\n * @returns A promise which resolves to `void`\n *\n * @platform ios\n */\n triggerNetworkAlert(): Promise<void>;\n /**\n * Checks whether the device supports Picture-in-Picture (PiP)\n *\n * @returns A `boolean` indicating Picture-in-Picture (PiP) support\n */\n isPictureInPictureSupported(): boolean;\n}\n\nexport default requireNativeModule<LibVlcPlayerModule>(\"ExpoLibVlcPlayer\");\n"]}
|
|
1
|
+
{"version":3,"file":"LibVlcPlayerModule.js","sourceRoot":"","sources":["../src/LibVlcPlayerModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAoBzD,eAAe,mBAAmB,CAAqB,kBAAkB,CAAC,CAAC","sourcesContent":["import { NativeModule, requireNativeModule } from \"expo\";\n\nimport { type LibVlcPlayerModuleEvents } from \"./LibVlcPlayer.types\";\n\ndeclare class LibVlcPlayerModule extends NativeModule<LibVlcPlayerModuleEvents> {\n /** Attempts to trigger the local network privacy alert\n *\n * @returns A promise which resolves to `void`\n *\n * @platform ios\n */\n triggerNetworkAlert(): Promise<void>;\n /**\n * Checks whether the device supports Picture-in-Picture (PiP)\n *\n * @returns A `boolean` indicating Picture-in-Picture (PiP) support\n */\n isPictureInPictureSupported(): boolean;\n}\n\nexport default requireNativeModule<LibVlcPlayerModule>(\"ExpoLibVlcPlayer\");\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LibVlcPlayerViewProps
|
|
2
|
-
declare const LibVlcPlayerView:
|
|
1
|
+
import { type LibVlcPlayerViewProps } from "./LibVlcPlayer.types";
|
|
2
|
+
declare const LibVlcPlayerView: ({ ref, ...props }: LibVlcPlayerViewProps) => import("react").JSX.Element;
|
|
3
3
|
export default LibVlcPlayerView;
|
|
4
4
|
//# sourceMappingURL=LibVlcPlayerView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LibVlcPlayerView.d.ts","sourceRoot":"","sources":["../src/LibVlcPlayerView.tsx"],"names":[],"mappings":"AAIA,OAAO,EAEL,qBAAqB,
|
|
1
|
+
{"version":3,"file":"LibVlcPlayerView.d.ts","sourceRoot":"","sources":["../src/LibVlcPlayerView.tsx"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,qBAAqB,EAW3B,MAAM,sBAAsB,CAAC;AAe9B,QAAA,MAAM,gBAAgB,GAAI,mBAAmB,qBAAqB,gCAqGjE,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { requireNativeView } from "expo";
|
|
2
|
-
import {
|
|
2
|
+
import { useRef } from "react";
|
|
3
3
|
import { View } from "react-native";
|
|
4
4
|
import { convertAspectRatio } from "./utils/aspect";
|
|
5
5
|
import { parseNativeSource } from "./utils/assets";
|
|
@@ -8,7 +8,7 @@ const NativeView = requireNativeView("ExpoLibVlcPlayer");
|
|
|
8
8
|
const RENDERING_CHILDREN_WARNING = "The <LibVlcPlayerView> component does not support children. This may lead to inconsistent behaviour or crashes. If you want to render content on top of the LibVlcPlayer, consider using absolute positioning.";
|
|
9
9
|
let loggedRenderingChildrenWarning = false;
|
|
10
10
|
const FALLBACK_RATIO = 16 / 9;
|
|
11
|
-
const LibVlcPlayerView =
|
|
11
|
+
const LibVlcPlayerView = ({ ref, ...props }) => {
|
|
12
12
|
const defaultRatio = useRef(FALLBACK_RATIO);
|
|
13
13
|
if (props.children && !loggedRenderingChildrenWarning) {
|
|
14
14
|
console.warn(RENDERING_CHILDREN_WARNING);
|
|
@@ -73,6 +73,6 @@ const LibVlcPlayerView = forwardRef((props, ref) => {
|
|
|
73
73
|
source: parseNativeSource(slave.source),
|
|
74
74
|
}))} onEncounteredError={onEncounteredError} onDialogDisplay={onDialogDisplay} onTimeChanged={onTimeChanged} onPositionChanged={onPositionChanged} onESAdded={onESAdded} onRecordChanged={onRecordChanged} onSnapshotTaken={onSnapshotTaken} onFirstPlay={onFirstPlay}/>
|
|
75
75
|
</View>);
|
|
76
|
-
}
|
|
76
|
+
};
|
|
77
77
|
export default LibVlcPlayerView;
|
|
78
78
|
//# sourceMappingURL=LibVlcPlayerView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LibVlcPlayerView.js","sourceRoot":"","sources":["../src/LibVlcPlayerView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"LibVlcPlayerView.js","sourceRoot":"","sources":["../src/LibVlcPlayerView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EAAE,MAAM,EAAsB,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAgBpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEpD,MAAM,UAAU,GACd,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;AAExC,MAAM,0BAA0B,GAC9B,gNAAgN,CAAC;AAEnN,IAAI,8BAA8B,GAAG,KAAK,CAAC;AAE3C,MAAM,cAAc,GAAG,EAAE,GAAG,CAAC,CAAC;AAE9B,MAAM,gBAAgB,GAAG,CAAC,EAAE,GAAG,EAAE,GAAG,KAAK,EAAyB,EAAE,EAAE;IACpE,MAAM,YAAY,GAAG,MAAM,CAAmB,cAAc,CAAC,CAAC;IAE9D,IAAI,KAAK,CAAC,QAAQ,IAAI,CAAC,8BAA8B,EAAE,CAAC;QACtD,OAAO,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;QACzC,8BAA8B,GAAG,IAAI,CAAC;IACxC,CAAC;IAED,MAAM,kBAAkB,GAAG,CAAC,KAAyB,EAAE,EAAE;QACvD,MAAM,WAAW,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAE9C,IAAI,KAAK,CAAC,kBAAkB,EAAE,CAAC;YAC7B,KAAK,CAAC,kBAAkB,CAAC,WAAW,C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YACR,MAAM,EAAE,iBAAiB,CAAC,KAAK,CAAC,MAAM,CAAC;SACxC,CAAC,CAAC,CAAC,CACJ,kBAAkB,CAAC,CAAC,kBAAkB,CAAC,CACvC,eAAe,CAAC,CAAC,eAAe,CAAC,CACjC,aAAa,CAAC,CAAC,aAAa,CAAC,CAC7B,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,eAAe,CAAC,CAAC,eAAe,CAAC,CACjC,eAAe,CAAC,CAAC,eAAe,CAAC,CACjC,WAAW,CAAC,CAAC,WAAW,CAAC,EAE7B;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["import { requireNativeView } from \"expo\";\nimport { useRef, type ComponentType } from \"react\";\nimport { View } from \"react-native\";\n\nimport {\n type LibVlcPlayerViewNativeProps,\n type LibVlcPlayerViewProps,\n type Dialog,\n type Error,\n type MediaInfo,\n type MediaTracks,\n type NativeEvent,\n type Position,\n type Recording,\n type Snapshot,\n type Time,\n type VideoAspectRatio,\n} from \"./LibVlcPlayer.types\";\nimport { convertAspectRatio } from \"./utils/aspect\";\nimport { parseNativeSource } from \"./utils/assets\";\nimport { convertNativeEvent } from \"./utils/events\";\n\nconst NativeView: ComponentType<LibVlcPlayerViewNativeProps> =\n requireNativeView(\"ExpoLibVlcPlayer\");\n\nconst RENDERING_CHILDREN_WARNING =\n \"The <LibVlcPlayerView> component does not support children. This may lead to inconsistent behaviour or crashes. If you want to render content on top of the LibVlcPlayer, consider using absolute positioning.\";\n\nlet loggedRenderingChildrenWarning = false;\n\nconst FALLBACK_RATIO = 16 / 9;\n\nconst LibVlcPlayerView = ({ ref, ...props }: LibVlcPlayerViewProps) => {\n const defaultRatio = useRef<VideoAspectRatio>(FALLBACK_RATIO);\n\n if (props.children && !loggedRenderingChildrenWarning) {\n console.warn(RENDERING_CHILDREN_WARNING);\n loggedRenderingChildrenWarning = true;\n }\n\n const onEncounteredError = (event: NativeEvent<Error>) => {\n const nativeEvent = convertNativeEvent(event);\n\n if (props.onEncounteredError) {\n props.onEncounteredError(nativeEvent);\n }\n };\n\n const onDialogDisplay = (event: NativeEvent<Dialog>) => {\n const nativeEvent = convertNativeEvent(event);\n\n if (props.onDialogDisplay) {\n props.onDialogDisplay(nativeEvent);\n }\n };\n\n const onTimeChanged = (event: NativeEvent<Time>) => {\n const nativeEvent = convertNativeEvent(event);\n\n if (props.onTimeChanged) {\n props.onTimeChanged(nativeEvent);\n }\n };\n\n const onPositionChanged = (event: NativeEvent<Position>) => {\n const nativeEvent = convertNativeEvent(event);\n\n if (props.onPositionChanged) {\n props.onPositionChanged(nativeEvent);\n }\n };\n\n const onESAdded = (event: NativeEvent<MediaTracks>) => {\n const nativeEvent = convertNativeEvent(event);\n\n if (props.onESAdded) {\n props.onESAdded(nativeEvent);\n }\n };\n\n const onRecordChanged = (event: NativeEvent<Recording>) => {\n const nativeEvent = convertNativeEvent(event);\n\n if (props.onRecordChanged) {\n props.onRecordChanged(nativeEvent);\n }\n };\n\n const onSnapshotTaken = (event: NativeEvent<Snapshot>) => {\n const nativeEvent = convertNativeEvent(event);\n\n if (props.onSnapshotTaken) {\n props.onSnapshotTaken(nativeEvent);\n }\n };\n\n const onFirstPlay = (event: NativeEvent<MediaInfo>) => {\n const nativeEvent = convertNativeEvent(event);\n const mediaRatio = nativeEvent.width / nativeEvent.height;\n\n if (props.onFirstPlay) {\n props.onFirstPlay(nativeEvent);\n }\n\n defaultRatio.current = mediaRatio || FALLBACK_RATIO;\n };\n\n const propRatio = props.aspectRatio;\n const aspectRatio = propRatio === \"auto\" ? defaultRatio.current : propRatio;\n const nativeRatio = convertAspectRatio(aspectRatio);\n\n return (\n <View style={[props.style, { aspectRatio: nativeRatio }]}>\n <NativeView\n {...props}\n ref={ref}\n style={[props.style, { height: \"100%\" }]}\n source={parseNativeSource(props.source)}\n slaves={props.slaves?.map((slave) => ({\n ...slave,\n source: parseNativeSource(slave.source),\n }))}\n onEncounteredError={onEncounteredError}\n onDialogDisplay={onDialogDisplay}\n onTimeChanged={onTimeChanged}\n onPositionChanged={onPositionChanged}\n onESAdded={onESAdded}\n onRecordChanged={onRecordChanged}\n onSnapshotTaken={onSnapshotTaken}\n onFirstPlay={onFirstPlay}\n />\n </View>\n );\n};\n\nexport default LibVlcPlayerView;\n"]}
|
package/build/utils/aspect.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aspect.d.ts","sourceRoot":"","sources":["../../src/utils/aspect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"aspect.d.ts","sourceRoot":"","sources":["../../src/utils/aspect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,wBAAgB,kBAAkB,CAAC,KAAK,CAAC,EAAE,gBAAgB,GAAG,gBAAgB,GAAG,SAAS,CAgBzF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aspect.js","sourceRoot":"","sources":["../../src/utils/aspect.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,kBAAkB,CAAC,KAAwB;IACzD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAEjC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzB,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YAE5C,MAAM,YAAY,GAAG,KAAK,GAAG,CAAC,IAAI,MAAM,GAAG,CAAC,CAAC;YAE7C,IAAI,YAAY,EAAE,CAAC;gBACjB,OAAO,KAAK,GAAG,MAAM,CAAC;YACxB,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import { VideoAspectRatio } from \"../LibVlcPlayer.types\";\n\nexport function convertAspectRatio(ratio?: VideoAspectRatio): VideoAspectRatio | undefined {\n if (typeof ratio === \"string\") {\n const numbers = ratio.split(\":\");\n\n if (numbers.length === 2) {\n const [width, height] = numbers.map(Number);\n\n const hasVideoSize = width > 0 && height > 0;\n\n if (hasVideoSize) {\n return width / height;\n }\n }\n }\n\n return ratio;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"aspect.js","sourceRoot":"","sources":["../../src/utils/aspect.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,kBAAkB,CAAC,KAAwB;IACzD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAEjC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzB,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YAE5C,MAAM,YAAY,GAAG,KAAK,GAAG,CAAC,IAAI,MAAM,GAAG,CAAC,CAAC;YAE7C,IAAI,YAAY,EAAE,CAAC;gBACjB,OAAO,KAAK,GAAG,MAAM,CAAC;YACxB,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import { type VideoAspectRatio } from \"../LibVlcPlayer.types\";\n\nexport function convertAspectRatio(ratio?: VideoAspectRatio): VideoAspectRatio | undefined {\n if (typeof ratio === \"string\") {\n const numbers = ratio.split(\":\");\n\n if (numbers.length === 2) {\n const [width, height] = numbers.map(Number);\n\n const hasVideoSize = width > 0 && height > 0;\n\n if (hasVideoSize) {\n return width / height;\n }\n }\n }\n\n return ratio;\n}\n"]}
|
package/build/utils/assets.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { LibVlcSource } from "../LibVlcPlayer.types";
|
|
1
|
+
import { type LibVlcSlaveSource, type LibVlcSource } from "../LibVlcPlayer.types";
|
|
2
|
+
export declare function parseNativeSource(source: LibVlcSlaveSource): LibVlcSlaveSource;
|
|
2
3
|
export declare function parseNativeSource(source: LibVlcSource): LibVlcSource;
|
|
3
4
|
//# sourceMappingURL=assets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../src/utils/assets.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../src/utils/assets.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAElF,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,GAAG,iBAAiB,CAAC;AAChF,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,GAAG,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assets.js","sourceRoot":"","sources":["../../src/utils/assets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"assets.js","sourceRoot":"","sources":["../../src/utils/assets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAMrC,MAAM,UAAU,iBAAiB,CAAC,MAAoB;IACpD,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC;IAC9C,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { Image } from \"react-native\";\n\nimport { type LibVlcSlaveSource, type LibVlcSource } from \"../LibVlcPlayer.types\";\n\nexport function parseNativeSource(source: LibVlcSlaveSource): LibVlcSlaveSource;\nexport function parseNativeSource(source: LibVlcSource): LibVlcSource;\nexport function parseNativeSource(source: LibVlcSource): LibVlcSource {\n if (typeof source === \"number\") {\n return Image.resolveAssetSource(source).uri;\n }\n\n return source;\n}\n"]}
|
package/build/utils/events.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/utils/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/utils/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAE3E,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAG3E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/utils/events.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,kBAAkB,CAAI,KAAqB;IACzD,MAAM,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE,GAAG,KAAK,CAAC,WAAW,CAAC;IACrD,OAAO,WAAW,CAAC;AACrB,CAAC","sourcesContent":["import { LibVlcEvent, NativeEvent } from \"../LibVlcPlayer.types\";\n\nexport function convertNativeEvent<T>(event: NativeEvent<T>): LibVlcEvent<T> {\n const { target, ...nativeEvent } = event.nativeEvent;\n return nativeEvent;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/utils/events.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,kBAAkB,CAAI,KAAqB;IACzD,MAAM,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE,GAAG,KAAK,CAAC,WAAW,CAAC;IACrD,OAAO,WAAW,CAAC;AACrB,CAAC","sourcesContent":["import { type LibVlcEvent, type NativeEvent } from \"../LibVlcPlayer.types\";\n\nexport function convertNativeEvent<T>(event: NativeEvent<T>): LibVlcEvent<T> {\n const { target, ...nativeEvent } = event.nativeEvent;\n return nativeEvent;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-libvlc-player",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.8",
|
|
4
4
|
"description": "LibVLC Player for Expo",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"build": "
|
|
9
|
-
"clean": "
|
|
10
|
-
"lint": "
|
|
11
|
-
"prepare": "
|
|
12
|
-
"
|
|
13
|
-
"open:
|
|
14
|
-
"open:android": "open -a \"Android Studio\" example/android"
|
|
8
|
+
"build": "node internal/module_scripts/build.js",
|
|
9
|
+
"clean": "node internal/module_scripts/clean.js",
|
|
10
|
+
"lint": "eslint src/",
|
|
11
|
+
"prepare": "node internal/module_scripts/prepare.js",
|
|
12
|
+
"open:ios": "node internal/module_scripts/open-ios.js",
|
|
13
|
+
"open:android": "node internal/module_scripts/open-android.js"
|
|
15
14
|
},
|
|
16
15
|
"keywords": [
|
|
17
16
|
"react-native",
|
|
@@ -32,21 +31,18 @@
|
|
|
32
31
|
"author": "David Cornejo <davidcornejo1@live.com> (https://github.com/cornejobarraza)",
|
|
33
32
|
"license": "MIT",
|
|
34
33
|
"homepage": "https://github.com/cornejobarraza/expo-libvlc-player#readme",
|
|
35
|
-
"dependencies": {},
|
|
36
34
|
"devDependencies": {
|
|
37
|
-
"@eslint/compat": "^1.4.1",
|
|
38
|
-
"@eslint/eslintrc": "^3.3.5",
|
|
39
|
-
"@eslint/js": "^9.39.4",
|
|
40
35
|
"@types/react": "~19.2.10",
|
|
41
36
|
"eslint": "^9.39.4",
|
|
37
|
+
"eslint-config-prettier": "^10.1.8",
|
|
38
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
42
39
|
"expo": "~55.0.15",
|
|
43
|
-
"expo-module-scripts": "^55.0.2",
|
|
44
|
-
"globals": "^16.5.0",
|
|
45
40
|
"husky": "^9.1.7",
|
|
46
|
-
"lint-staged": "^16.
|
|
47
|
-
"prettier": "^3.8.
|
|
41
|
+
"lint-staged": "^16.4.0",
|
|
42
|
+
"prettier": "^3.8.3",
|
|
48
43
|
"react-native": "0.83.6",
|
|
49
|
-
"typescript": "^5.9.3"
|
|
44
|
+
"typescript": "^5.9.3",
|
|
45
|
+
"typescript-eslint": "^8.59.0"
|
|
50
46
|
},
|
|
51
47
|
"peerDependencies": {
|
|
52
48
|
"expo": "*",
|
|
@@ -4,7 +4,9 @@ const config_plugins_1 = require("expo/config-plugins");
|
|
|
4
4
|
const LOCAL_NETWORK_USAGE = "Allow $(PRODUCT_NAME) to access your local network";
|
|
5
5
|
const AUDIO_BACKGROUND_MODE = "audio";
|
|
6
6
|
const PICTURE_CONFIG_MANIFEST = "android:supportsPictureInPicture";
|
|
7
|
-
const withExpoLibVlcPlayer = (config,
|
|
7
|
+
const withExpoLibVlcPlayer = (config,
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-useless-default-assignment
|
|
9
|
+
{ localNetworkPermission, supportsPictureInPicture } = {}) => {
|
|
8
10
|
config_plugins_1.IOSConfig.Permissions.createPermissionsPlugin({
|
|
9
11
|
NSLocalNetworkUsageDescription: LOCAL_NETWORK_USAGE,
|
|
10
12
|
})(config, {
|
|
@@ -32,7 +34,7 @@ const withExpoLibVlcPlayer = (config, { localNetworkPermission, supportsPictureI
|
|
|
32
34
|
activity.$[PICTURE_CONFIG_MANIFEST] = "true";
|
|
33
35
|
}
|
|
34
36
|
else {
|
|
35
|
-
|
|
37
|
+
Reflect.deleteProperty(activity.$, PICTURE_CONFIG_MANIFEST);
|
|
36
38
|
}
|
|
37
39
|
}
|
|
38
40
|
return config;
|
|
@@ -17,6 +17,7 @@ const PICTURE_CONFIG_MANIFEST = "android:supportsPictureInPicture";
|
|
|
17
17
|
|
|
18
18
|
const withExpoLibVlcPlayer: ConfigPlugin<WithExpoLibVlcPlayerProps> = (
|
|
19
19
|
config,
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-useless-default-assignment
|
|
20
21
|
{ localNetworkPermission, supportsPictureInPicture } = {}
|
|
21
22
|
) => {
|
|
22
23
|
IOSConfig.Permissions.createPermissionsPlugin({
|
|
@@ -51,7 +52,7 @@ const withExpoLibVlcPlayer: ConfigPlugin<WithExpoLibVlcPlayerProps> = (
|
|
|
51
52
|
if (supportsPictureInPicture) {
|
|
52
53
|
activity.$[PICTURE_CONFIG_MANIFEST] = "true";
|
|
53
54
|
} else {
|
|
54
|
-
|
|
55
|
+
Reflect.deleteProperty(activity.$, PICTURE_CONFIG_MANIFEST);
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
58
|
|
package/plugin/tsconfig.json
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
{
|
|
2
|
-
"extends": "expo-module-scripts/tsconfig.plugin",
|
|
3
2
|
"compilerOptions": {
|
|
3
|
+
"lib": ["es2023"],
|
|
4
|
+
"module": "node16",
|
|
5
|
+
"target": "es2022",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"moduleResolution": "node16",
|
|
10
|
+
"declaration": true,
|
|
4
11
|
"rootDir": "src",
|
|
5
12
|
"outDir": "build"
|
|
6
13
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ViewProps } from "react-native";
|
|
2
2
|
|
|
3
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type, @typescript-eslint/consistent-type-definitions
|
|
4
4
|
export type LibVlcPlayerModuleEvents = {};
|
|
5
5
|
|
|
6
6
|
export interface LibVlcPlayerViewRef {
|
|
@@ -25,7 +25,7 @@ export interface LibVlcPlayerViewRef {
|
|
|
25
25
|
/**
|
|
26
26
|
* Sets the time or position of the current player
|
|
27
27
|
*
|
|
28
|
-
* @param value - Must be
|
|
28
|
+
* @param value - Must be an integer equal or greater than `0`
|
|
29
29
|
* @param type - Defaults to `"time"`
|
|
30
30
|
*
|
|
31
31
|
* @returns A promise which resolves to `void`
|
|
@@ -34,7 +34,7 @@ export interface LibVlcPlayerViewRef {
|
|
|
34
34
|
/**
|
|
35
35
|
* Starts or stops recording the current media
|
|
36
36
|
*
|
|
37
|
-
* @param path - Must be a valid directory path
|
|
37
|
+
* @param path - Must be a valid directory path or `undefined` to stop recording
|
|
38
38
|
*
|
|
39
39
|
* @returns A promise which resolves to `void`
|
|
40
40
|
*/
|
|
@@ -42,7 +42,7 @@ export interface LibVlcPlayerViewRef {
|
|
|
42
42
|
/**
|
|
43
43
|
* Takes a snapshot of the current media
|
|
44
44
|
*
|
|
45
|
-
* @param path - Must be a valid directory path
|
|
45
|
+
* @param path - Must be a valid directory path
|
|
46
46
|
*
|
|
47
47
|
* @returns A promise which resolves to `void`
|
|
48
48
|
*/
|
|
@@ -50,7 +50,7 @@ export interface LibVlcPlayerViewRef {
|
|
|
50
50
|
/**
|
|
51
51
|
* Posts an answer to a `Dialog`
|
|
52
52
|
*
|
|
53
|
-
* @param action - Must be
|
|
53
|
+
* @param action - Must be either `1` or `2`
|
|
54
54
|
*
|
|
55
55
|
* @returns A promise which resolves to `void`
|
|
56
56
|
*/
|
|
@@ -91,6 +91,8 @@ export interface LibVlcPlayerViewRef {
|
|
|
91
91
|
|
|
92
92
|
export type LibVlcSource = string | number | null;
|
|
93
93
|
|
|
94
|
+
export type LibVlcSlaveSource = string | number;
|
|
95
|
+
|
|
94
96
|
export interface Tracks {
|
|
95
97
|
audio?: number;
|
|
96
98
|
video?: number;
|
|
@@ -98,12 +100,12 @@ export interface Tracks {
|
|
|
98
100
|
}
|
|
99
101
|
|
|
100
102
|
export interface Slave {
|
|
101
|
-
source:
|
|
103
|
+
source: LibVlcSlaveSource;
|
|
102
104
|
type: "audio" | "subtitle";
|
|
103
105
|
selected?: boolean;
|
|
104
106
|
}
|
|
105
107
|
|
|
106
|
-
export type VideoAspectRatio = "auto" | string | number;
|
|
108
|
+
export type VideoAspectRatio = "auto" | (string & {}) | number;
|
|
107
109
|
|
|
108
110
|
export type VideoContentFit = "contain" | "cover" | "fill";
|
|
109
111
|
|
|
@@ -119,13 +121,21 @@ export interface NativeEvent<T> {
|
|
|
119
121
|
|
|
120
122
|
export type LibVlcEvent<T> = Omit<T & NativeEventProps, "target">;
|
|
121
123
|
|
|
122
|
-
export
|
|
124
|
+
export interface Error {
|
|
125
|
+
message: string;
|
|
126
|
+
}
|
|
123
127
|
|
|
124
|
-
export
|
|
128
|
+
export interface Time {
|
|
129
|
+
value: number;
|
|
130
|
+
}
|
|
125
131
|
|
|
126
|
-
export
|
|
132
|
+
export interface Position {
|
|
133
|
+
value: number;
|
|
134
|
+
}
|
|
127
135
|
|
|
128
|
-
export
|
|
136
|
+
export interface Snapshot {
|
|
137
|
+
path: string;
|
|
138
|
+
}
|
|
129
139
|
|
|
130
140
|
export interface Dialog {
|
|
131
141
|
title: string;
|
|
@@ -278,6 +288,14 @@ export interface LibVlcPlayerViewNativeProps extends ViewProps {
|
|
|
278
288
|
}
|
|
279
289
|
|
|
280
290
|
export interface LibVlcPlayerViewProps extends ViewProps {
|
|
291
|
+
/**
|
|
292
|
+
* Allows getting a ref to the component instance.
|
|
293
|
+
*
|
|
294
|
+
* Once the component unmounts, React will set `ref.current` to `null`
|
|
295
|
+
*
|
|
296
|
+
* @see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs}
|
|
297
|
+
*/
|
|
298
|
+
ref: React.RefObject<LibVlcPlayerViewRef | null>;
|
|
281
299
|
/**
|
|
282
300
|
* Sets the source of the media to be played. Set to `null` to release the player
|
|
283
301
|
*
|
|
@@ -292,11 +310,9 @@ export interface LibVlcPlayerViewProps extends ViewProps {
|
|
|
292
310
|
*/
|
|
293
311
|
source: LibVlcSource;
|
|
294
312
|
/**
|
|
295
|
-
* Sets the options to initialize the media with
|
|
296
|
-
*
|
|
297
|
-
* See the VideoLAN Wiki for more:
|
|
313
|
+
* Sets the options to initialize the media with
|
|
298
314
|
*
|
|
299
|
-
* https://wiki.videolan.org/VLC_command-line_help/
|
|
315
|
+
* @see {@link https://wiki.videolan.org/VLC_command-line_help/ VideoLAN Wiki}
|
|
300
316
|
*
|
|
301
317
|
* @example
|
|
302
318
|
*
|
|
@@ -363,7 +379,7 @@ export interface LibVlcPlayerViewProps extends ViewProps {
|
|
|
363
379
|
*/
|
|
364
380
|
scale?: number;
|
|
365
381
|
/**
|
|
366
|
-
* Sets the container aspect ratio. Must be a valid ratio
|
|
382
|
+
* Sets the container aspect ratio. Must be a valid ratio, float or `"auto"`
|
|
367
383
|
*
|
|
368
384
|
* @example "16:9"
|
|
369
385
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NativeModule, requireNativeModule } from "expo";
|
|
2
2
|
|
|
3
|
-
import { LibVlcPlayerModuleEvents } from "./LibVlcPlayer.types";
|
|
3
|
+
import { type LibVlcPlayerModuleEvents } from "./LibVlcPlayer.types";
|
|
4
4
|
|
|
5
5
|
declare class LibVlcPlayerModule extends NativeModule<LibVlcPlayerModuleEvents> {
|
|
6
6
|
/** Attempts to trigger the local network privacy alert
|
package/src/LibVlcPlayerView.tsx
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { requireNativeView } from "expo";
|
|
2
|
-
import {
|
|
2
|
+
import { useRef, type ComponentType } from "react";
|
|
3
3
|
import { View } from "react-native";
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
|
-
LibVlcPlayerViewNativeProps,
|
|
7
|
-
LibVlcPlayerViewProps,
|
|
8
|
-
LibVlcPlayerViewRef,
|
|
6
|
+
type LibVlcPlayerViewNativeProps,
|
|
7
|
+
type LibVlcPlayerViewProps,
|
|
9
8
|
type Dialog,
|
|
10
9
|
type Error,
|
|
11
10
|
type MediaInfo,
|
|
@@ -27,11 +26,11 @@ const NativeView: ComponentType<LibVlcPlayerViewNativeProps> =
|
|
|
27
26
|
const RENDERING_CHILDREN_WARNING =
|
|
28
27
|
"The <LibVlcPlayerView> component does not support children. This may lead to inconsistent behaviour or crashes. If you want to render content on top of the LibVlcPlayer, consider using absolute positioning.";
|
|
29
28
|
|
|
30
|
-
let loggedRenderingChildrenWarning
|
|
29
|
+
let loggedRenderingChildrenWarning = false;
|
|
31
30
|
|
|
32
31
|
const FALLBACK_RATIO = 16 / 9;
|
|
33
32
|
|
|
34
|
-
const LibVlcPlayerView =
|
|
33
|
+
const LibVlcPlayerView = ({ ref, ...props }: LibVlcPlayerViewProps) => {
|
|
35
34
|
const defaultRatio = useRef<VideoAspectRatio>(FALLBACK_RATIO);
|
|
36
35
|
|
|
37
36
|
if (props.children && !loggedRenderingChildrenWarning) {
|
|
@@ -119,7 +118,7 @@ const LibVlcPlayerView = forwardRef<LibVlcPlayerViewRef, LibVlcPlayerViewProps>(
|
|
|
119
118
|
source={parseNativeSource(props.source)}
|
|
120
119
|
slaves={props.slaves?.map((slave) => ({
|
|
121
120
|
...slave,
|
|
122
|
-
source: parseNativeSource(slave.source)
|
|
121
|
+
source: parseNativeSource(slave.source),
|
|
123
122
|
}))}
|
|
124
123
|
onEncounteredError={onEncounteredError}
|
|
125
124
|
onDialogDisplay={onDialogDisplay}
|
|
@@ -132,6 +131,6 @@ const LibVlcPlayerView = forwardRef<LibVlcPlayerViewRef, LibVlcPlayerViewProps>(
|
|
|
132
131
|
/>
|
|
133
132
|
</View>
|
|
134
133
|
);
|
|
135
|
-
}
|
|
134
|
+
};
|
|
136
135
|
|
|
137
136
|
export default LibVlcPlayerView;
|
package/src/utils/aspect.ts
CHANGED
package/src/utils/assets.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Image } from "react-native";
|
|
2
2
|
|
|
3
|
-
import { LibVlcSource } from "../LibVlcPlayer.types";
|
|
3
|
+
import { type LibVlcSlaveSource, type LibVlcSource } from "../LibVlcPlayer.types";
|
|
4
4
|
|
|
5
|
+
export function parseNativeSource(source: LibVlcSlaveSource): LibVlcSlaveSource;
|
|
6
|
+
export function parseNativeSource(source: LibVlcSource): LibVlcSource;
|
|
5
7
|
export function parseNativeSource(source: LibVlcSource): LibVlcSource {
|
|
6
8
|
if (typeof source === "number") {
|
|
7
9
|
return Image.resolveAssetSource(source).uri;
|
package/src/utils/events.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LibVlcEvent, NativeEvent } from "../LibVlcPlayer.types";
|
|
1
|
+
import { type LibVlcEvent, type NativeEvent } from "../LibVlcPlayer.types";
|
|
2
2
|
|
|
3
3
|
export function convertNativeEvent<T>(event: NativeEvent<T>): LibVlcEvent<T> {
|
|
4
4
|
const { target, ...nativeEvent } = event.nativeEvent;
|
package/tsconfig.json
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
{
|
|
2
|
-
"extends": "expo-module-scripts/tsconfig.base",
|
|
3
2
|
"compilerOptions": {
|
|
3
|
+
"lib": ["dom", "DOM.Iterable", "esnext"],
|
|
4
|
+
"typeRoots": ["./ts-declarations", "./node_modules/@types"],
|
|
5
|
+
"jsx": "react-native",
|
|
6
|
+
"target": "esnext",
|
|
7
|
+
"moduleResolution": "bundler",
|
|
8
|
+
"module": "esnext",
|
|
9
|
+
"moduleDetection": "force",
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"sourceMap": true,
|
|
12
|
+
"declaration": true,
|
|
13
|
+
"declarationMap": true,
|
|
14
|
+
"inlineSources": true,
|
|
15
|
+
"skipLibCheck": true,
|
|
16
|
+
"strict": true,
|
|
17
|
+
"noFallthroughCasesInSwitch": true,
|
|
18
|
+
"noPropertyAccessFromIndexSignature": false,
|
|
19
|
+
"noImplicitReturns": true,
|
|
20
|
+
"noUnusedLocals": true,
|
|
21
|
+
"noUnusedParameters": false,
|
|
4
22
|
"rootDir": "./src",
|
|
5
23
|
"outDir": "./build"
|
|
6
24
|
},
|