expo-libvlc-player 7.0.8 → 7.0.10
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 +7 -7
- package/android/src/main/java/expo/modules/libvlcplayer/LibVlcPlayerView.kt +1 -1
- package/android/src/main/java/expo/modules/libvlcplayer/managers/PictureInPictureManager.kt +1 -1
- package/build/LibVlcPlayer.types.d.ts +5 -5
- package/build/LibVlcPlayer.types.js.map +1 -1
- package/build/LibVlcPlayerModule.d.ts +2 -1
- package/build/LibVlcPlayerModule.d.ts.map +1 -1
- package/build/LibVlcPlayerModule.js.map +1 -1
- package/ios/LibVlcPlayerView.swift +2 -2
- package/package.json +7 -8
- package/src/LibVlcPlayer.types.ts +5 -5
- package/src/LibVlcPlayerModule.ts +2 -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.
|
|
129
|
-
| `record(path?: string)` | Starts or stops recording the current media.
|
|
130
|
-
| `snapshot(path: string)` | Takes a snapshot of the current media.
|
|
131
|
-
| `postAction(action: 1 \| 2)` | Posts an answer to a [`Dialog`](#dialog).
|
|
128
|
+
| `seek(value: number, type?: "time" \| "position")` | Sets the time or position of the current player. Value must be an integer equal or greater than `0` and type defaults to `"time"` | `Promise<void>` |
|
|
129
|
+
| `record(path?: string)` | Starts or stops recording the current media. Path must be a valid directory or `undefined` to stop recording | `Promise<void>` |
|
|
130
|
+
| `snapshot(path: string)` | Takes a snapshot of the current media. Path must be a valid directory | `Promise<void>` |
|
|
131
|
+
| `postAction(action: 1 \| 2)` | Posts an answer to a [`Dialog`](#dialog). Action 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,12 +145,12 @@ 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, float or `"auto"`
|
|
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
|
-
| `time` | Sets the initial player time. Must be an integer
|
|
151
|
+
| `time` | Sets the initial player time. Must be an integer (ms) greater than `0` | `0` |
|
|
152
152
|
| `volume` | Sets the player volume. Must be an integer between `0` and `100` | `100` |
|
|
153
|
-
| `mute` | Sets the player volume to `0` when `true
|
|
153
|
+
| `mute` | Sets the player volume to `0` when `true` and previous value is restored when `false` | `false` |
|
|
154
154
|
| `audioMixingMode` | Determines how the player will interact with other audio in the system | `"auto"` |
|
|
155
155
|
| `repeat` | Determines whether the media should repeat once ended | `false` |
|
|
156
156
|
| `autoplay` | Determines whether the media should autoplay once created | `true` |
|
|
@@ -283,7 +283,7 @@ class PictureInPictureManager(
|
|
|
283
283
|
rootView.addView(pictureLayout)
|
|
284
284
|
|
|
285
285
|
pipView?.let { view ->
|
|
286
|
-
//
|
|
286
|
+
// Black screen workaround
|
|
287
287
|
view.detachPlayerLayout()
|
|
288
288
|
view.attachPlayerLayout(pictureLayout)
|
|
289
289
|
|
|
@@ -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
|
|
34
|
+
* @param path - Must be a valid directory 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
|
|
42
|
+
* @param path - Must be a valid directory
|
|
43
43
|
*
|
|
44
44
|
* @returns A promise which resolves to `void`
|
|
45
45
|
*/
|
|
@@ -339,7 +339,7 @@ export interface LibVlcPlayerViewProps extends ViewProps {
|
|
|
339
339
|
*/
|
|
340
340
|
scale?: number;
|
|
341
341
|
/**
|
|
342
|
-
* Sets the container aspect ratio. Must be a valid ratio, float or `"auto"`
|
|
342
|
+
* Sets the container aspect ratio. Must be a valid ratio, float, or `"auto"`
|
|
343
343
|
*
|
|
344
344
|
* @example "16:9"
|
|
345
345
|
*
|
|
@@ -361,7 +361,7 @@ export interface LibVlcPlayerViewProps extends ViewProps {
|
|
|
361
361
|
*/
|
|
362
362
|
rate?: number;
|
|
363
363
|
/**
|
|
364
|
-
* Sets the initial player time. Must be an integer
|
|
364
|
+
* Sets the initial player time. Must be an integer (ms) greater than `0`
|
|
365
365
|
*
|
|
366
366
|
* @default 0
|
|
367
367
|
*/
|
|
@@ -373,7 +373,7 @@ export interface LibVlcPlayerViewProps extends ViewProps {
|
|
|
373
373
|
*/
|
|
374
374
|
volume?: number;
|
|
375
375
|
/**
|
|
376
|
-
* Sets the player volume to `0` when `true
|
|
376
|
+
* Sets the player volume to `0` when `true` and previous value is restored when `false`
|
|
377
377
|
*
|
|
378
378
|
* @default false
|
|
379
379
|
*/
|
|
@@ -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, @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
|
+
{"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 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\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 (ms) greater than `0`\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` and previous value is restored 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,7 +1,8 @@
|
|
|
1
1
|
import { NativeModule } from "expo";
|
|
2
2
|
import { type LibVlcPlayerModuleEvents } from "./LibVlcPlayer.types";
|
|
3
3
|
declare class LibVlcPlayerModule extends NativeModule<LibVlcPlayerModuleEvents> {
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* Attempts to trigger the local network privacy alert
|
|
5
6
|
*
|
|
6
7
|
* @returns A promise which resolves to `void`
|
|
7
8
|
*
|
|
@@ -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,KAAK,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAErE,OAAO,OAAO,kBAAmB,SAAQ,YAAY,CAAC,wBAAwB,CAAC;IAC7E
|
|
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;;;;;;OAMG;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;
|
|
1
|
+
{"version":3,"file":"LibVlcPlayerModule.js","sourceRoot":"","sources":["../src/LibVlcPlayerModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAqBzD,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 /**\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"]}
|
|
@@ -177,7 +177,7 @@ class LibVlcPlayerView: ExpoView {
|
|
|
177
177
|
|
|
178
178
|
switch contentFit {
|
|
179
179
|
case .contain:
|
|
180
|
-
// No
|
|
180
|
+
// No transformation required
|
|
181
181
|
break
|
|
182
182
|
case .cover:
|
|
183
183
|
let scale = videoAspect > viewAspect ?
|
|
@@ -223,7 +223,7 @@ class LibVlcPlayerView: ExpoView {
|
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
if volume != MediaPlayerConstants.maxPlayerVolume || mute {
|
|
226
|
-
// Audio instance not
|
|
226
|
+
// Audio instance not ready, try again
|
|
227
227
|
retryUntil { [weak self] isLastAttempt in
|
|
228
228
|
guard let self else { return true }
|
|
229
229
|
|
package/package.json
CHANGED
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-libvlc-player",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.10",
|
|
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": "node
|
|
9
|
-
"clean": "node
|
|
8
|
+
"build": "node scripts/build.js",
|
|
9
|
+
"clean": "node scripts/clean.js",
|
|
10
10
|
"lint": "eslint src/",
|
|
11
|
-
"prepare": "node
|
|
12
|
-
"open:ios": "node
|
|
13
|
-
"open:android": "node
|
|
11
|
+
"prepare": "node scripts/prepare.js",
|
|
12
|
+
"open:ios": "node scripts/open-ios.js",
|
|
13
|
+
"open:android": "node scripts/open-android.js"
|
|
14
14
|
},
|
|
15
15
|
"keywords": [
|
|
16
16
|
"react-native",
|
|
17
|
-
"vlc",
|
|
18
17
|
"expo",
|
|
19
18
|
"libvlc",
|
|
20
19
|
"player",
|
|
21
20
|
"expo-libvlc-player",
|
|
22
|
-
"
|
|
21
|
+
"ExpoLibVlcPlayer"
|
|
23
22
|
],
|
|
24
23
|
"repository": {
|
|
25
24
|
"type": "git",
|
|
@@ -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
|
|
37
|
+
* @param path - Must be a valid directory 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
|
|
45
|
+
* @param path - Must be a valid directory
|
|
46
46
|
*
|
|
47
47
|
* @returns A promise which resolves to `void`
|
|
48
48
|
*/
|
|
@@ -379,7 +379,7 @@ export interface LibVlcPlayerViewProps extends ViewProps {
|
|
|
379
379
|
*/
|
|
380
380
|
scale?: number;
|
|
381
381
|
/**
|
|
382
|
-
* Sets the container aspect ratio. Must be a valid ratio, float or `"auto"`
|
|
382
|
+
* Sets the container aspect ratio. Must be a valid ratio, float, or `"auto"`
|
|
383
383
|
*
|
|
384
384
|
* @example "16:9"
|
|
385
385
|
*
|
|
@@ -401,7 +401,7 @@ export interface LibVlcPlayerViewProps extends ViewProps {
|
|
|
401
401
|
*/
|
|
402
402
|
rate?: number;
|
|
403
403
|
/**
|
|
404
|
-
* Sets the initial player time. Must be an integer
|
|
404
|
+
* Sets the initial player time. Must be an integer (ms) greater than `0`
|
|
405
405
|
*
|
|
406
406
|
* @default 0
|
|
407
407
|
*/
|
|
@@ -413,7 +413,7 @@ export interface LibVlcPlayerViewProps extends ViewProps {
|
|
|
413
413
|
*/
|
|
414
414
|
volume?: number;
|
|
415
415
|
/**
|
|
416
|
-
* Sets the player volume to `0` when `true
|
|
416
|
+
* Sets the player volume to `0` when `true` and previous value is restored when `false`
|
|
417
417
|
*
|
|
418
418
|
* @default false
|
|
419
419
|
*/
|
|
@@ -3,7 +3,8 @@ import { NativeModule, requireNativeModule } from "expo";
|
|
|
3
3
|
import { type LibVlcPlayerModuleEvents } from "./LibVlcPlayer.types";
|
|
4
4
|
|
|
5
5
|
declare class LibVlcPlayerModule extends NativeModule<LibVlcPlayerModuleEvents> {
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Attempts to trigger the local network privacy alert
|
|
7
8
|
*
|
|
8
9
|
* @returns A promise which resolves to `void`
|
|
9
10
|
*
|