expo-libvlc-player 6.2.2 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -11
- package/android/src/main/java/expo/modules/libvlcplayer/LibVlcPlayerView.kt +8 -8
- package/build/LibVlcPlayer.types.d.ts +12 -12
- package/build/LibVlcPlayer.types.d.ts.map +1 -1
- package/build/LibVlcPlayer.types.js.map +1 -1
- package/ios/LibVlcPlayerView.swift +8 -8
- package/package.json +1 -1
- package/src/LibVlcPlayer.types.ts +8 -8
package/README.md
CHANGED
|
@@ -164,13 +164,13 @@ The `LibVlcPlayerView` extends React Native `ViewProps` and implements the follo
|
|
|
164
164
|
| `onPlaying` | Called after the `Playing` player event | |
|
|
165
165
|
| `onPaused` | Called after the `Paused` player event | |
|
|
166
166
|
| `onStopped` | Called after the `Stopped` player event | |
|
|
167
|
-
| `onEncounteredError` | Called after the `EncounteredError` player event | `
|
|
167
|
+
| `onEncounteredError` | Called after the `EncounteredError` player event | [`Error`](#error) |
|
|
168
168
|
| `onDialogDisplay` | Called after a `Dialog` needs to be displayed | [`Dialog`](#dialog) |
|
|
169
|
-
| `onTimeChanged` | Called after the `TimeChanged` player event | `
|
|
170
|
-
| `onPositionChanged` | Called after the `PositionChanged` player event | `
|
|
169
|
+
| `onTimeChanged` | Called after the `TimeChanged` player event | [`Time`](#time) |
|
|
170
|
+
| `onPositionChanged` | Called after the `PositionChanged` player event | [`Position`](#position) |
|
|
171
171
|
| `onESAdded` | Called after the `ESAdded` player event | [`MediaTracks`](#mediatracks) |
|
|
172
172
|
| `onRecordChanged` | Called after the `RecordChanged` player event | [`Recording`](#recording) |
|
|
173
|
-
| `onSnapshotTaken` | Called after a media snapshot is taken | `
|
|
173
|
+
| `onSnapshotTaken` | Called after a media snapshot is taken | [`Snapshot`](#snapshot) |
|
|
174
174
|
| `onFirstPlay` | Called after the player first playing event | [`MediaInfo`](#mediainfo) |
|
|
175
175
|
| `onForeground` | Called after the player enters the foreground | |
|
|
176
176
|
| `onBackground` | Called after the player enters the background | |
|
|
@@ -179,10 +179,34 @@ The `LibVlcPlayerView` extends React Native `ViewProps` and implements the follo
|
|
|
179
179
|
|
|
180
180
|
### Module types
|
|
181
181
|
|
|
182
|
+
#### `Error`
|
|
183
|
+
|
|
184
|
+
```ts
|
|
185
|
+
type Error = { message: string };
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
#### `Time`
|
|
189
|
+
|
|
190
|
+
```ts
|
|
191
|
+
type Time = { value: number };
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
#### `Position`
|
|
195
|
+
|
|
196
|
+
```ts
|
|
197
|
+
type Position = { value: number };
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
#### `Snapshot`
|
|
201
|
+
|
|
202
|
+
```ts
|
|
203
|
+
type Snapshot = { path: string };
|
|
204
|
+
```
|
|
205
|
+
|
|
182
206
|
#### `Tracks`
|
|
183
207
|
|
|
184
208
|
```ts
|
|
185
|
-
{
|
|
209
|
+
interface Tracks {
|
|
186
210
|
audio?: number;
|
|
187
211
|
video?: number;
|
|
188
212
|
subtitle?: number;
|
|
@@ -192,7 +216,7 @@ The `LibVlcPlayerView` extends React Native `ViewProps` and implements the follo
|
|
|
192
216
|
#### `Slave`
|
|
193
217
|
|
|
194
218
|
```ts
|
|
195
|
-
{
|
|
219
|
+
interface Slave {
|
|
196
220
|
source: string | number;
|
|
197
221
|
type: "audio" | "subtitle";
|
|
198
222
|
selected?: boolean;
|
|
@@ -202,7 +226,7 @@ The `LibVlcPlayerView` extends React Native `ViewProps` and implements the follo
|
|
|
202
226
|
#### `Dialog`
|
|
203
227
|
|
|
204
228
|
```ts
|
|
205
|
-
{
|
|
229
|
+
interface Dialog {
|
|
206
230
|
title: string;
|
|
207
231
|
text: string;
|
|
208
232
|
type: "error" | "login" | "question";
|
|
@@ -215,7 +239,7 @@ The `LibVlcPlayerView` extends React Native `ViewProps` and implements the follo
|
|
|
215
239
|
#### `Recording`
|
|
216
240
|
|
|
217
241
|
```ts
|
|
218
|
-
{
|
|
242
|
+
interface Recording {
|
|
219
243
|
path: string | null;
|
|
220
244
|
isRecording: boolean;
|
|
221
245
|
}
|
|
@@ -224,7 +248,7 @@ The `LibVlcPlayerView` extends React Native `ViewProps` and implements the follo
|
|
|
224
248
|
#### `Track`
|
|
225
249
|
|
|
226
250
|
```ts
|
|
227
|
-
{
|
|
251
|
+
interface Track {
|
|
228
252
|
id: number;
|
|
229
253
|
name: string;
|
|
230
254
|
}
|
|
@@ -233,7 +257,7 @@ The `LibVlcPlayerView` extends React Native `ViewProps` and implements the follo
|
|
|
233
257
|
#### `MediaTracks`
|
|
234
258
|
|
|
235
259
|
```ts
|
|
236
|
-
{
|
|
260
|
+
interface MediaTracks {
|
|
237
261
|
audio: Track[];
|
|
238
262
|
video: Track[];
|
|
239
263
|
subtitle: Track[];
|
|
@@ -243,7 +267,7 @@ The `LibVlcPlayerView` extends React Native `ViewProps` and implements the follo
|
|
|
243
267
|
#### `MediaInfo`
|
|
244
268
|
|
|
245
269
|
```ts
|
|
246
|
-
{
|
|
270
|
+
interface MediaInfo {
|
|
247
271
|
width: number;
|
|
248
272
|
height: number;
|
|
249
273
|
length: number;
|
|
@@ -192,7 +192,7 @@ class LibVlcPlayerView(
|
|
|
192
192
|
try {
|
|
193
193
|
URI(source)
|
|
194
194
|
} catch (_: Exception) {
|
|
195
|
-
onEncounteredError(mapOf("
|
|
195
|
+
onEncounteredError(mapOf("message" to "Invalid source, media could not be set"))
|
|
196
196
|
return
|
|
197
197
|
}
|
|
198
198
|
|
|
@@ -277,7 +277,7 @@ class LibVlcPlayerView(
|
|
|
277
277
|
try {
|
|
278
278
|
URI(source)
|
|
279
279
|
} catch (_: Exception) {
|
|
280
|
-
onEncounteredError(mapOf("
|
|
280
|
+
onEncounteredError(mapOf("message" to "Invalid source, $type could not be added"))
|
|
281
281
|
return@forEach
|
|
282
282
|
}
|
|
283
283
|
|
|
@@ -637,7 +637,7 @@ class LibVlcPlayerView(
|
|
|
637
637
|
val success = player.record(path)
|
|
638
638
|
|
|
639
639
|
if (!success) {
|
|
640
|
-
onEncounteredError(mapOf("
|
|
640
|
+
onEncounteredError(mapOf("message" to "Media could not be recorded"))
|
|
641
641
|
}
|
|
642
642
|
} else {
|
|
643
643
|
player.record(null)
|
|
@@ -674,13 +674,13 @@ class LibVlcPlayerView(
|
|
|
674
674
|
|
|
675
675
|
onSnapshotTaken(mapOf("path" to snapshotPath))
|
|
676
676
|
} catch (_: Exception) {
|
|
677
|
-
onEncounteredError(mapOf("
|
|
677
|
+
onEncounteredError(mapOf("message" to "Snapshot could not be taken"))
|
|
678
678
|
}
|
|
679
679
|
},
|
|
680
680
|
Handler(Looper.getMainLooper()),
|
|
681
681
|
)
|
|
682
682
|
} catch (_: Exception) {
|
|
683
|
-
onEncounteredError(mapOf("
|
|
683
|
+
onEncounteredError(mapOf("message" to "Snapshot could not be taken"))
|
|
684
684
|
}
|
|
685
685
|
}
|
|
686
686
|
|
|
@@ -825,17 +825,17 @@ fun LibVlcPlayerView.setPlayerListener(mediaPlayer: MediaPlayer?) {
|
|
|
825
825
|
}
|
|
826
826
|
|
|
827
827
|
Event.EncounteredError -> {
|
|
828
|
-
onEncounteredError(mapOf("
|
|
828
|
+
onEncounteredError(mapOf("message" to "Player encountered an error"))
|
|
829
829
|
|
|
830
830
|
player.stop()
|
|
831
831
|
}
|
|
832
832
|
|
|
833
833
|
Event.TimeChanged -> {
|
|
834
|
-
onTimeChanged(mapOf("
|
|
834
|
+
onTimeChanged(mapOf("value" to player.getTime().toInt()))
|
|
835
835
|
}
|
|
836
836
|
|
|
837
837
|
Event.PositionChanged -> {
|
|
838
|
-
onPositionChanged(mapOf("
|
|
838
|
+
onPositionChanged(mapOf("value" to player.getPosition()))
|
|
839
839
|
}
|
|
840
840
|
|
|
841
841
|
Event.ESAdded -> {
|
|
@@ -106,6 +106,18 @@ export interface NativeEvent<T> {
|
|
|
106
106
|
nativeEvent: T & NativeEventProps;
|
|
107
107
|
}
|
|
108
108
|
export type LibVlcEvent<T> = Omit<T & NativeEventProps, "target">;
|
|
109
|
+
export type Error = {
|
|
110
|
+
message: string;
|
|
111
|
+
};
|
|
112
|
+
export type Time = {
|
|
113
|
+
value: number;
|
|
114
|
+
};
|
|
115
|
+
export type Position = {
|
|
116
|
+
value: number;
|
|
117
|
+
};
|
|
118
|
+
export type Snapshot = {
|
|
119
|
+
path: string;
|
|
120
|
+
};
|
|
109
121
|
export interface Dialog {
|
|
110
122
|
title: string;
|
|
111
123
|
text: string;
|
|
@@ -149,23 +161,14 @@ type PausedListener = () => void;
|
|
|
149
161
|
* @hidden
|
|
150
162
|
*/
|
|
151
163
|
type StoppedListener = () => void;
|
|
152
|
-
export type Error = {
|
|
153
|
-
error: string;
|
|
154
|
-
};
|
|
155
164
|
/**
|
|
156
165
|
* @hidden
|
|
157
166
|
*/
|
|
158
167
|
type EncounteredErrorListener = (event: NativeEvent<Error>) => void;
|
|
159
|
-
export type Time = {
|
|
160
|
-
time: number;
|
|
161
|
-
};
|
|
162
168
|
/**
|
|
163
169
|
* @hidden
|
|
164
170
|
*/
|
|
165
171
|
type TimeChangedListener = (event: NativeEvent<Time>) => void;
|
|
166
|
-
export type Position = {
|
|
167
|
-
position: number;
|
|
168
|
-
};
|
|
169
172
|
/**
|
|
170
173
|
* @hidden
|
|
171
174
|
*/
|
|
@@ -178,9 +181,6 @@ type ESAddedListener = (event: NativeEvent<MediaTracks>) => void;
|
|
|
178
181
|
* @hidden
|
|
179
182
|
*/
|
|
180
183
|
type RecordChangedListener = (event: NativeEvent<Recording>) => void;
|
|
181
|
-
export type Snapshot = {
|
|
182
|
-
path: string;
|
|
183
|
-
};
|
|
184
184
|
/**
|
|
185
185
|
* @hidden
|
|
186
186
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LibVlcPlayer.types.d.ts","sourceRoot":"","sources":["../src/LibVlcPlayer.types.ts"],"names":[],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B;;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 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\nexport type Error = { error: string };\n\n/**\n * @hidden\n */\ntype EncounteredErrorListener = (event: NativeEvent<Error>) => void;\n\nexport type Time = { time: number };\n\n/**\n * @hidden\n */\ntype TimeChangedListener = (event: NativeEvent<Time>) => void;\n\nexport type Position = { position: number };\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\nexport type Snapshot = { path: string };\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 VLC options to initialize the player with\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: 3,\n * video: 2,\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 subtitles = [{\n * source: \"file://path/to/subtitle.srt\",\n * type: \"subtitle\",\n * selected: true,\n * }];\n *\n * <LibVlcPlayerView\n * source={BIG_BUCK_BUNNY}\n * slaves={subtitles}\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\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 VLC options to initialize the player with\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: 3,\n * video: 2,\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 subtitles = [{\n * source: \"file://path/to/subtitle.srt\",\n * type: \"subtitle\",\n * selected: true,\n * }];\n *\n * <LibVlcPlayerView\n * source={BIG_BUCK_BUNNY}\n * slaves={subtitles}\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"]}
|
|
@@ -95,7 +95,7 @@ class LibVlcPlayerView: ExpoView {
|
|
|
95
95
|
vlcDialog!.customRenderer = self
|
|
96
96
|
|
|
97
97
|
guard let source, let url = URL(string: source) else {
|
|
98
|
-
onEncounteredError(["
|
|
98
|
+
onEncounteredError(["message": "Invalid source, media could not be set"])
|
|
99
99
|
return
|
|
100
100
|
}
|
|
101
101
|
|
|
@@ -167,7 +167,7 @@ class LibVlcPlayerView: ExpoView {
|
|
|
167
167
|
let selected = slave.selected ?? false
|
|
168
168
|
|
|
169
169
|
guard let url = URL(string: source) else {
|
|
170
|
-
onEncounteredError(["
|
|
170
|
+
onEncounteredError(["message": "Invalid source, \(type) could not be added"])
|
|
171
171
|
continue
|
|
172
172
|
}
|
|
173
173
|
|
|
@@ -479,7 +479,7 @@ class LibVlcPlayerView: ExpoView {
|
|
|
479
479
|
player.stopRecording()
|
|
480
480
|
}
|
|
481
481
|
} else {
|
|
482
|
-
onEncounteredError(["
|
|
482
|
+
onEncounteredError(["message": "Media could not be recorded"])
|
|
483
483
|
}
|
|
484
484
|
}
|
|
485
485
|
|
|
@@ -508,13 +508,13 @@ class LibVlcPlayerView: ExpoView {
|
|
|
508
508
|
} else if !isLastAttempt {
|
|
509
509
|
mediaPlayer?.saveVideoSnapshot(at: snapshotPath, withWidth: Int32(0), andHeight: Int32(0))
|
|
510
510
|
} else {
|
|
511
|
-
onEncounteredError(["
|
|
511
|
+
onEncounteredError(["message": "Snapshot could not be taken"])
|
|
512
512
|
}
|
|
513
513
|
|
|
514
514
|
return hasSnapshot
|
|
515
515
|
}
|
|
516
516
|
} else {
|
|
517
|
-
onEncounteredError(["
|
|
517
|
+
onEncounteredError(["message": "Snapshot could not be taken"])
|
|
518
518
|
}
|
|
519
519
|
}
|
|
520
520
|
|
|
@@ -652,7 +652,7 @@ extension LibVlcPlayerView: VLCMediaPlayerDelegate {
|
|
|
652
652
|
MediaPlayerManager.shared.audioSessionManager.setAppropriateAudioSession()
|
|
653
653
|
pictureDrawable.updatePipState()
|
|
654
654
|
case .error:
|
|
655
|
-
onEncounteredError(["
|
|
655
|
+
onEncounteredError(["message": "Player encountered an error"])
|
|
656
656
|
|
|
657
657
|
player.stop()
|
|
658
658
|
default:
|
|
@@ -667,9 +667,9 @@ extension LibVlcPlayerView: VLCMediaPlayerDelegate {
|
|
|
667
667
|
|
|
668
668
|
func mediaPlayerTimeChanged(_: Notification) {
|
|
669
669
|
if let player = mediaPlayer {
|
|
670
|
-
onTimeChanged(["
|
|
670
|
+
onTimeChanged(["value": player.time.intValue])
|
|
671
671
|
|
|
672
|
-
onPositionChanged(["
|
|
672
|
+
onPositionChanged(["value": player.position])
|
|
673
673
|
}
|
|
674
674
|
}
|
|
675
675
|
|
package/package.json
CHANGED
|
@@ -119,6 +119,14 @@ export interface NativeEvent<T> {
|
|
|
119
119
|
|
|
120
120
|
export type LibVlcEvent<T> = Omit<T & NativeEventProps, "target">;
|
|
121
121
|
|
|
122
|
+
export type Error = { message: string };
|
|
123
|
+
|
|
124
|
+
export type Time = { value: number };
|
|
125
|
+
|
|
126
|
+
export type Position = { value: number };
|
|
127
|
+
|
|
128
|
+
export type Snapshot = { path: string };
|
|
129
|
+
|
|
122
130
|
export interface Dialog {
|
|
123
131
|
title: string;
|
|
124
132
|
text: string;
|
|
@@ -171,22 +179,16 @@ type PausedListener = () => void;
|
|
|
171
179
|
*/
|
|
172
180
|
type StoppedListener = () => void;
|
|
173
181
|
|
|
174
|
-
export type Error = { error: string };
|
|
175
|
-
|
|
176
182
|
/**
|
|
177
183
|
* @hidden
|
|
178
184
|
*/
|
|
179
185
|
type EncounteredErrorListener = (event: NativeEvent<Error>) => void;
|
|
180
186
|
|
|
181
|
-
export type Time = { time: number };
|
|
182
|
-
|
|
183
187
|
/**
|
|
184
188
|
* @hidden
|
|
185
189
|
*/
|
|
186
190
|
type TimeChangedListener = (event: NativeEvent<Time>) => void;
|
|
187
191
|
|
|
188
|
-
export type Position = { position: number };
|
|
189
|
-
|
|
190
192
|
/**
|
|
191
193
|
* @hidden
|
|
192
194
|
*/
|
|
@@ -202,8 +204,6 @@ type ESAddedListener = (event: NativeEvent<MediaTracks>) => void;
|
|
|
202
204
|
*/
|
|
203
205
|
type RecordChangedListener = (event: NativeEvent<Recording>) => void;
|
|
204
206
|
|
|
205
|
-
export type Snapshot = { path: string };
|
|
206
|
-
|
|
207
207
|
/**
|
|
208
208
|
* @hidden
|
|
209
209
|
*/
|