expo-libvlc-player 7.0.2 → 7.0.4

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 CHANGED
@@ -141,7 +141,7 @@ The `LibVlcPlayerView` extends React Native `ViewProps` and implements the follo
141
141
  | Prop | Description | Default |
142
142
  | ------------------ | --------------------------------------------------------------------------------------------------------------------------------- | ----------- |
143
143
  | `source` | Sets the source of the media to be played. Set to `null` to release the player | |
144
- | `options` | Sets the VLC options to initialize the player with. See the [VLC Wiki](https://wiki.videolan.org/VLC_command-line_help/) for more | `[]` |
144
+ | `options` | Sets the options to initialize the media with. See the [VideoLAN Wiki](https://wiki.videolan.org/VLC_command-line_help/) for more | `[]` |
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` |
@@ -174,14 +174,11 @@ class LibVlcPlayerView(
174
174
  }
175
175
 
176
176
  fun createPlayer() {
177
- var args = options
178
- args.toggleStartPausedOption(autoplay)
179
-
180
177
  if (pictureInPicture) {
181
178
  MediaPlayerManager.pictureInPictureManager.setupPipView(this)
182
179
  }
183
180
 
184
- libVLC = LibVLC(context, args)
181
+ libVLC = LibVLC(context)
185
182
  setDialogCallbacks(libVLC!!)
186
183
 
187
184
  mediaPlayer = MediaPlayer(libVLC!!)
@@ -196,7 +193,12 @@ class LibVlcPlayerView(
196
193
  return
197
194
  }
198
195
 
196
+ var args = options
197
+ args.normalizeOptions()
198
+ args.toggleStartPausedOption(autoplay)
199
+
199
200
  val media = Media(libVLC!!, Uri.parse(source!!))
201
+ args.forEach { arg -> media!!.addOption(arg) }
200
202
  mediaPlayer!!.setMedia(media)
201
203
  media.release()
202
204
  mediaPlayer!!.play()
@@ -216,26 +218,10 @@ class LibVlcPlayerView(
216
218
  }
217
219
 
218
220
  fun selectTrack(
219
- trackId: Int?,
221
+ index: Int,
220
222
  type: Int,
221
223
  ) {
222
224
  mediaPlayer?.let { player ->
223
- val tracks =
224
- when (type) {
225
- IMedia.Track.Type.Audio -> player.getAudioTracks()
226
- IMedia.Track.Type.Video -> player.getVideoTracks()
227
- IMedia.Track.Type.Text -> player.getSpuTracks()
228
- else -> null
229
- }
230
-
231
- if (tracks == null) return
232
-
233
- val firstTrack = tracks.firstOrNull { track -> track.id != -1 }
234
- val firstTrackId = firstTrack?.id
235
- val index = trackId ?: firstTrackId
236
-
237
- if (index == null) return
238
-
239
225
  when (type) {
240
226
  IMedia.Track.Type.Audio -> {
241
227
  player.setAudioTrack(index)
@@ -257,9 +243,9 @@ class LibVlcPlayerView(
257
243
  val videoTrack = tracks?.video
258
244
  val spuTrack = tracks?.subtitle
259
245
 
260
- selectTrack(audioTrack, IMedia.Track.Type.Audio)
261
- selectTrack(videoTrack, IMedia.Track.Type.Video)
262
- selectTrack(spuTrack, IMedia.Track.Type.Text)
246
+ audioTrack?.let { audioTrack -> selectTrack(audioTrack, IMedia.Track.Type.Audio) }
247
+ videoTrack?.let { videoTrack -> selectTrack(videoTrack, IMedia.Track.Type.Video) }
248
+ spuTrack?.let { spuTrack -> selectTrack(spuTrack, IMedia.Track.Type.Text) }
263
249
  }
264
250
 
265
251
  fun addPlayerSlaves(slaves: List<Slave>) {
@@ -914,16 +900,25 @@ fun LibVlcPlayerView.setDialogCallbacks(ILibVLC: LibVLC?) {
914
900
  }
915
901
  }
916
902
 
917
- private fun MutableList<String>.toggleStartPausedOption(autoplay: Boolean) {
918
- val options =
919
- setOf(
920
- "--start-paused",
921
- ":start-paused",
922
- )
903
+ private fun MutableList<String>.normalizeOptions() {
904
+ val normalized =
905
+ map { option ->
906
+ if (!option.startsWith(":")) {
907
+ ":" + option.dropWhile { character -> character == '-' }
908
+ } else {
909
+ option
910
+ }
911
+ }
923
912
 
924
- removeAll { option -> option in options }
913
+ for (i in indices) {
914
+ this[i] = normalized[i]
915
+ }
916
+ }
917
+
918
+ private fun MutableList<String>.toggleStartPausedOption(autoplay: Boolean) {
919
+ val hasOption = contains(":start-paused")
925
920
 
926
- if (!autoplay) {
927
- add("--start-paused")
921
+ if (!autoplay && !hasOption) {
922
+ add(":start-paused")
928
923
  }
929
924
  }
@@ -254,14 +254,16 @@ export interface LibVlcPlayerViewProps extends ViewProps {
254
254
  *
255
255
  * ```tsx
256
256
  * const BIG_BUCK_BUNNY =
257
- * "https://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_720p_h264.mov";
257
+ * "https://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_720p_h264.mov";
258
258
  *
259
259
  * <LibVlcPlayerView source={BIG_BUCK_BUNNY} />
260
260
  * ```
261
261
  */
262
262
  source: LibVlcSource;
263
263
  /**
264
- * Sets the VLC options to initialize the player with
264
+ * Sets the options to initialize the media with.
265
+ *
266
+ * See the VideoLAN Wiki for more:
265
267
  *
266
268
  * https://wiki.videolan.org/VLC_command-line_help/
267
269
  *
@@ -271,8 +273,8 @@ export interface LibVlcPlayerViewProps extends ViewProps {
271
273
  * const options = ["--network-caching=1000"];
272
274
  *
273
275
  * <LibVlcPlayerView
274
- * source={BIG_BUCK_BUNNY}
275
- * options={options}
276
+ * source={BIG_BUCK_BUNNY}
277
+ * options={options}
276
278
  * />
277
279
  * ```
278
280
  *
@@ -286,14 +288,14 @@ export interface LibVlcPlayerViewProps extends ViewProps {
286
288
  *
287
289
  * ```tsx
288
290
  * const tracks = {
289
- * audio: 3,
290
- * video: 2,
291
- * subtitle: 1,
291
+ * audio: -1,
292
+ * video: 1,
293
+ * subtitle: 1,
292
294
  * };
293
295
  *
294
296
  * <LibVlcPlayerView
295
- * source={BIG_BUCK_BUNNY}
296
- * tracks={tracks}
297
+ * source={BIG_BUCK_BUNNY}
298
+ * tracks={tracks}
297
299
  * />
298
300
  * ```
299
301
  *
@@ -306,15 +308,17 @@ export interface LibVlcPlayerViewProps extends ViewProps {
306
308
  * @example
307
309
  *
308
310
  * ```tsx
309
- * const subtitles = [{
310
- * source: "file://path/to/subtitle.srt",
311
- * type: "subtitle",
312
- * selected: true,
313
- * }];
311
+ * const slaves = [
312
+ * {
313
+ * source: "file://path/to/subtitle.srt",
314
+ * type: "subtitle",
315
+ * selected: true,
316
+ * },
317
+ * ];
314
318
  *
315
319
  * <LibVlcPlayerView
316
- * source={BIG_BUCK_BUNNY}
317
- * slaves={subtitles}
320
+ * source={BIG_BUCK_BUNNY}
321
+ * slaves={slaves}
318
322
  * />
319
323
  * ```
320
324
  *
@@ -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;I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;IAC3B;;OAEG;IACH,WAAW,CAAC,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 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 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"]}
@@ -8,6 +8,7 @@ class LibVlcPlayerView: ExpoView {
8
8
  private let playerDrawable: MediaPlayerDrawable = .init()
9
9
  private var pictureDrawable: PictureInPictureDrawable!
10
10
 
11
+ var library: VLCLibrary?
11
12
  var mediaPlayer: VLCMediaPlayer?
12
13
  var vlcDialog: VLCDialogProvider?
13
14
  var vlcDialogRef: NSValue?
@@ -72,10 +73,6 @@ class LibVlcPlayerView: ExpoView {
72
73
  }
73
74
 
74
75
  func createPlayer() {
75
- var args = options
76
- args.toggleStartPausedOption(autoplay)
77
-
78
- let library = VLCLibrary(options: args)
79
76
  var drawable: MediaPlayerDrawable
80
77
 
81
78
  if pictureInPicture {
@@ -86,12 +83,13 @@ class LibVlcPlayerView: ExpoView {
86
83
  drawable = playerDrawable
87
84
  }
88
85
 
89
- mediaPlayer = VLCMediaPlayer(library: library)
86
+ library = VLCLibrary()
87
+ mediaPlayer = VLCMediaPlayer(library: library!)
90
88
  mediaPlayer!.drawable = drawable
91
89
  mediaPlayer!.delegate = self
92
90
  setupPlayer()
93
91
 
94
- vlcDialog = VLCDialogProvider(library: library, customUI: dialogCustomUI)
92
+ vlcDialog = VLCDialogProvider(library: library!, customUI: dialogCustomUI)
95
93
  vlcDialog!.customRenderer = self
96
94
 
97
95
  guard let source, let url = URL(string: source) else {
@@ -99,7 +97,13 @@ class LibVlcPlayerView: ExpoView {
99
97
  return
100
98
  }
101
99
 
102
- mediaPlayer!.media = VLCMedia(url: url)
100
+ var args = options
101
+ args.normalizeOptions()
102
+ args.toggleStartPausedOption(autoplay)
103
+
104
+ let media = VLCMedia(url: url)
105
+ args.forEach { arg in media!.addOption(arg) }
106
+ mediaPlayer!.media = media
103
107
  mediaPlayer!.play()
104
108
 
105
109
  firstPlay = true
@@ -109,41 +113,25 @@ class LibVlcPlayerView: ExpoView {
109
113
  }
110
114
 
111
115
  func destroyPlayer() {
116
+ library = nil
112
117
  mediaPlayer?.stop()
113
118
  mediaPlayer = nil
114
119
  vlcDialog?.customRenderer = nil
115
120
  vlcDialog = nil
116
121
  }
117
122
 
118
- func selectTrack(_ trackId: Int?, _ type: VLCMedia.TrackType) {
123
+ func selectTrack(_ index: Int, _ type: VLCMedia.TrackType) {
119
124
  if let player = mediaPlayer {
120
- if trackId == -1 {
125
+ if index == -1 {
121
126
  switch type {
122
127
  case .audio: player.deselectAllAudioTracks()
123
128
  case .video: player.deselectAllVideoTracks()
124
129
  case .text: player.deselectAllTextTracks()
125
130
  default: break
126
131
  }
127
- return
128
- }
129
-
130
- let tracks: [VLCMediaPlayer.Track]? = switch type {
131
- case .audio: player.audioTracks
132
- case .video: player.videoTracks
133
- case .text: player.textTracks
134
- default: nil
132
+ } else {
133
+ player.selectTrack(at: index, type: type)
135
134
  }
136
-
137
- guard let tracks else { return }
138
-
139
- let firstTrack = tracks.first?.trackId
140
- let firstTrackInt = firstTrack.map { id in (id as NSString).intValue }
141
- let firstTrackId = firstTrackInt.map { id in Int(id) }
142
- let index = trackId ?? firstTrackId
143
-
144
- guard let index else { return }
145
-
146
- player.selectTrack(at: index, type: type)
147
135
  }
148
136
  }
149
137
 
@@ -152,9 +140,9 @@ class LibVlcPlayerView: ExpoView {
152
140
  let videoTrack = tracks?.video
153
141
  let textTrack = tracks?.subtitle
154
142
 
155
- selectTrack(audioTrack, .audio)
156
- selectTrack(videoTrack, .video)
157
- selectTrack(textTrack, .text)
143
+ if let audioTrack { selectTrack(audioTrack, .audio) }
144
+ if let videoTrack { selectTrack(videoTrack, .video) }
145
+ if let textTrack { selectTrack(textTrack, .text) }
158
146
  }
159
147
 
160
148
  func addPlayerSlaves(_ slaves: [Slave]) {
@@ -770,16 +758,23 @@ extension LibVlcPlayerView: VLCCustomDialogRendererProtocol {
770
758
  }
771
759
 
772
760
  private extension [String] {
773
- mutating func toggleStartPausedOption(_ autoplay: Bool) {
774
- let options = [
775
- "--start-paused",
776
- ":start-paused",
777
- ]
761
+ mutating func normalizeOptions() {
762
+ self = map { option in
763
+ if !option.hasPrefix(":") {
764
+ ":" + option.drop { character in character == "-" }
765
+ } else {
766
+ option
767
+ }
768
+ }
769
+ }
770
+ }
778
771
 
779
- removeAll { option in options.contains(option) }
772
+ private extension [String] {
773
+ mutating func toggleStartPausedOption(_ autoplay: Bool) {
774
+ let hasOption = self.contains(":start-paused")
780
775
 
781
- if !autoplay {
782
- append("--start-paused")
776
+ if !autoplay, !hasOption {
777
+ append(":start-paused")
783
778
  }
784
779
  }
785
780
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-libvlc-player",
3
- "version": "7.0.2",
3
+ "version": "7.0.4",
4
4
  "description": "LibVLC Player for Expo",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -1,7 +1,7 @@
1
1
  import { type ConfigPlugin } from "expo/config-plugins";
2
- type WithExpoLibVlcPlayerOptions = {
2
+ interface WithExpoLibVlcPlayerProps {
3
3
  localNetworkPermission?: string;
4
4
  supportsPictureInPicture?: boolean;
5
- };
6
- declare const withExpoLibVlcPlayer: ConfigPlugin<WithExpoLibVlcPlayerOptions>;
5
+ }
6
+ declare const withExpoLibVlcPlayer: ConfigPlugin<WithExpoLibVlcPlayerProps>;
7
7
  export default withExpoLibVlcPlayer;
@@ -2,6 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const config_plugins_1 = require("expo/config-plugins");
4
4
  const LOCAL_NETWORK_USAGE = "Allow $(PRODUCT_NAME) to access your local network";
5
+ const AUDIO_BACKGROUND_MODE = "audio";
6
+ const PICTURE_CONFIG_MANIFEST = "android:supportsPictureInPicture";
5
7
  const withExpoLibVlcPlayer = (config, { localNetworkPermission, supportsPictureInPicture } = {}) => {
6
8
  config_plugins_1.IOSConfig.Permissions.createPermissionsPlugin({
7
9
  NSLocalNetworkUsageDescription: LOCAL_NETWORK_USAGE,
@@ -12,9 +14,9 @@ const withExpoLibVlcPlayer = (config, { localNetworkPermission, supportsPictureI
12
14
  const needsConfigMod = typeof supportsPictureInPicture === "boolean";
13
15
  if (needsConfigMod) {
14
16
  const backgroundModes = config.modResults.UIBackgroundModes ?? [];
15
- const filteredModes = backgroundModes.filter((mode) => mode !== "audio");
17
+ const filteredModes = backgroundModes.filter((mode) => mode !== AUDIO_BACKGROUND_MODE);
16
18
  if (supportsPictureInPicture) {
17
- config.modResults.UIBackgroundModes = [...filteredModes, "audio"];
19
+ config.modResults.UIBackgroundModes = [...filteredModes, AUDIO_BACKGROUND_MODE];
18
20
  }
19
21
  else {
20
22
  config.modResults.UIBackgroundModes = filteredModes;
@@ -27,10 +29,10 @@ const withExpoLibVlcPlayer = (config, { localNetworkPermission, supportsPictureI
27
29
  if (needsConfigMod) {
28
30
  const activity = config_plugins_1.AndroidConfig.Manifest.getMainActivityOrThrow(config.modResults);
29
31
  if (supportsPictureInPicture) {
30
- activity.$["android:supportsPictureInPicture"] = "true";
32
+ activity.$[PICTURE_CONFIG_MANIFEST] = "true";
31
33
  }
32
34
  else {
33
- delete activity.$["android:supportsPictureInPicture"];
35
+ delete activity.$[PICTURE_CONFIG_MANIFEST];
34
36
  }
35
37
  }
36
38
  return config;
@@ -6,14 +6,16 @@ import {
6
6
  type ConfigPlugin,
7
7
  } from "expo/config-plugins";
8
8
 
9
- const LOCAL_NETWORK_USAGE = "Allow $(PRODUCT_NAME) to access your local network";
10
-
11
- type WithExpoLibVlcPlayerOptions = {
9
+ interface WithExpoLibVlcPlayerProps {
12
10
  localNetworkPermission?: string;
13
11
  supportsPictureInPicture?: boolean;
14
- };
12
+ }
13
+
14
+ const LOCAL_NETWORK_USAGE = "Allow $(PRODUCT_NAME) to access your local network";
15
+ const AUDIO_BACKGROUND_MODE = "audio";
16
+ const PICTURE_CONFIG_MANIFEST = "android:supportsPictureInPicture";
15
17
 
16
- const withExpoLibVlcPlayer: ConfigPlugin<WithExpoLibVlcPlayerOptions> = (
18
+ const withExpoLibVlcPlayer: ConfigPlugin<WithExpoLibVlcPlayerProps> = (
17
19
  config,
18
20
  { localNetworkPermission, supportsPictureInPicture } = {}
19
21
  ) => {
@@ -28,10 +30,10 @@ const withExpoLibVlcPlayer: ConfigPlugin<WithExpoLibVlcPlayerOptions> = (
28
30
 
29
31
  if (needsConfigMod) {
30
32
  const backgroundModes = config.modResults.UIBackgroundModes ?? [];
31
- const filteredModes = backgroundModes.filter((mode) => mode !== "audio");
33
+ const filteredModes = backgroundModes.filter((mode) => mode !== AUDIO_BACKGROUND_MODE);
32
34
 
33
35
  if (supportsPictureInPicture) {
34
- config.modResults.UIBackgroundModes = [...filteredModes, "audio"];
36
+ config.modResults.UIBackgroundModes = [...filteredModes, AUDIO_BACKGROUND_MODE];
35
37
  } else {
36
38
  config.modResults.UIBackgroundModes = filteredModes;
37
39
  }
@@ -47,9 +49,9 @@ const withExpoLibVlcPlayer: ConfigPlugin<WithExpoLibVlcPlayerOptions> = (
47
49
  const activity = AndroidConfig.Manifest.getMainActivityOrThrow(config.modResults);
48
50
 
49
51
  if (supportsPictureInPicture) {
50
- activity.$["android:supportsPictureInPicture"] = "true";
52
+ activity.$[PICTURE_CONFIG_MANIFEST] = "true";
51
53
  } else {
52
- delete activity.$["android:supportsPictureInPicture"];
54
+ delete activity.$[PICTURE_CONFIG_MANIFEST];
53
55
  }
54
56
  }
55
57
 
@@ -285,14 +285,16 @@ export interface LibVlcPlayerViewProps extends ViewProps {
285
285
  *
286
286
  * ```tsx
287
287
  * const BIG_BUCK_BUNNY =
288
- * "https://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_720p_h264.mov";
288
+ * "https://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_720p_h264.mov";
289
289
  *
290
290
  * <LibVlcPlayerView source={BIG_BUCK_BUNNY} />
291
291
  * ```
292
292
  */
293
293
  source: LibVlcSource;
294
294
  /**
295
- * Sets the VLC options to initialize the player with
295
+ * Sets the options to initialize the media with.
296
+ *
297
+ * See the VideoLAN Wiki for more:
296
298
  *
297
299
  * https://wiki.videolan.org/VLC_command-line_help/
298
300
  *
@@ -302,8 +304,8 @@ export interface LibVlcPlayerViewProps extends ViewProps {
302
304
  * const options = ["--network-caching=1000"];
303
305
  *
304
306
  * <LibVlcPlayerView
305
- * source={BIG_BUCK_BUNNY}
306
- * options={options}
307
+ * source={BIG_BUCK_BUNNY}
308
+ * options={options}
307
309
  * />
308
310
  * ```
309
311
  *
@@ -317,14 +319,14 @@ export interface LibVlcPlayerViewProps extends ViewProps {
317
319
  *
318
320
  * ```tsx
319
321
  * const tracks = {
320
- * audio: 3,
321
- * video: 2,
322
- * subtitle: 1,
322
+ * audio: -1,
323
+ * video: 1,
324
+ * subtitle: 1,
323
325
  * };
324
326
  *
325
327
  * <LibVlcPlayerView
326
- * source={BIG_BUCK_BUNNY}
327
- * tracks={tracks}
328
+ * source={BIG_BUCK_BUNNY}
329
+ * tracks={tracks}
328
330
  * />
329
331
  * ```
330
332
  *
@@ -337,15 +339,17 @@ export interface LibVlcPlayerViewProps extends ViewProps {
337
339
  * @example
338
340
  *
339
341
  * ```tsx
340
- * const subtitles = [{
341
- * source: "file://path/to/subtitle.srt",
342
- * type: "subtitle",
343
- * selected: true,
344
- * }];
342
+ * const slaves = [
343
+ * {
344
+ * source: "file://path/to/subtitle.srt",
345
+ * type: "subtitle",
346
+ * selected: true,
347
+ * },
348
+ * ];
345
349
  *
346
350
  * <LibVlcPlayerView
347
- * source={BIG_BUCK_BUNNY}
348
- * slaves={subtitles}
351
+ * source={BIG_BUCK_BUNNY}
352
+ * slaves={slaves}
349
353
  * />
350
354
  * ```
351
355
  *