expo-libvlc-player 7.0.18 → 7.0.20
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 +4 -4
- package/android/src/main/java/expo/modules/libvlcplayer/LibVlcPlayerModule.kt +0 -1
- package/android/src/main/java/expo/modules/libvlcplayer/LibVlcPlayerView.kt +6 -8
- package/android/src/main/java/expo/modules/libvlcplayer/constants/MediaPlayerConstants.kt +1 -1
- package/build/LibVlcPlayer.types.d.ts +1 -1
- package/build/LibVlcPlayer.types.d.ts.map +1 -1
- package/build/LibVlcPlayer.types.js.map +1 -1
- package/ios/Constants/MediaPlayerConstants.swift +1 -1
- package/ios/LibVlcPlayerModule.swift +0 -1
- package/ios/LibVlcPlayerView.swift +27 -31
- package/ios/Managers/AudioSessionManager.swift +4 -4
- package/ios/Managers/KeepAwakeManager.swift +5 -3
- package/ios/Managers/MediaPlayerManager.swift +2 -1
- package/ios/Utils/PictureInPictureDrawable.swift +7 -1
- package/package.json +1 -1
- package/src/LibVlcPlayer.types.ts +1 -1
package/README.md
CHANGED
|
@@ -287,15 +287,15 @@ interface MediaInfo {
|
|
|
287
287
|
|
|
288
288
|
#### Black screen
|
|
289
289
|
|
|
290
|
-
On Android, the `libvlcjni` player detaches from the View
|
|
290
|
+
On Android, the `libvlcjni` player detaches from the View after switching screens.
|
|
291
291
|
|
|
292
|
-
The current workaround attaches the View
|
|
292
|
+
The current workaround attaches the View back but it causes a brief black screen.
|
|
293
293
|
|
|
294
294
|
https://code.videolan.org/videolan/vlc-android/-/issues/1495
|
|
295
295
|
|
|
296
|
-
On iOS, the `VLCKit` player
|
|
296
|
+
On iOS, the `VLCKit` player deselects the video track after switching screens.
|
|
297
297
|
|
|
298
|
-
The current workaround
|
|
298
|
+
The current workaround selects the video track back but it causes a brief black screen.
|
|
299
299
|
|
|
300
300
|
https://code.videolan.org/videolan/VLCKit/-/issues/743
|
|
301
301
|
|
|
@@ -112,11 +112,11 @@ class LibVlcPlayerView(
|
|
|
112
112
|
|
|
113
113
|
fun getTextureView(layout: VLCVideoLayout): TextureView? = layout.findViewById(org.videolan.R.id.texture_video)
|
|
114
114
|
|
|
115
|
-
fun addPlayerLayout(
|
|
115
|
+
fun addPlayerLayout(layout: VLCVideoLayout) {
|
|
116
116
|
val parent = playerLayout.parent as? ViewGroup
|
|
117
117
|
|
|
118
118
|
if (parent == null) {
|
|
119
|
-
addView(
|
|
119
|
+
addView(layout)
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
|
|
@@ -143,12 +143,12 @@ class LibVlcPlayerView(
|
|
|
143
143
|
removePlayerLayout()
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
fun attachPlayerLayout(
|
|
146
|
+
fun attachPlayerLayout(layout: VLCVideoLayout) {
|
|
147
147
|
mediaPlayer?.let { player ->
|
|
148
148
|
val attached = player.getVLCVout().areViewsAttached()
|
|
149
149
|
|
|
150
150
|
if (!attached) {
|
|
151
|
-
player.attachViews(
|
|
151
|
+
player.attachViews(layout, DISPLAY_MANAGER, ENABLE_SUBTITLES, USE_TEXTURE_VIEW)
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
}
|
|
@@ -579,12 +579,10 @@ class LibVlcPlayerView(
|
|
|
579
579
|
pauseCoroutine =
|
|
580
580
|
CoroutineScope(Dispatchers.Main).launch {
|
|
581
581
|
if (pictureInPicture) {
|
|
582
|
-
delay(MediaPlayerConstants.
|
|
582
|
+
delay(MediaPlayerConstants.PAUSE_DELAY_MS)
|
|
583
583
|
}
|
|
584
584
|
|
|
585
|
-
|
|
586
|
-
mediaPlayer?.pause()
|
|
587
|
-
}
|
|
585
|
+
mediaPlayer?.pause()
|
|
588
586
|
}
|
|
589
587
|
}
|
|
590
588
|
|
|
@@ -15,7 +15,7 @@ object MediaPlayerConstants {
|
|
|
15
15
|
const val EXTRA_CONTROL_FORWARD: Int = 4
|
|
16
16
|
const val SEEK_STEP_MS: Long = 10_000L
|
|
17
17
|
|
|
18
|
-
const val
|
|
18
|
+
const val PAUSE_DELAY_MS: Long = 1_000L
|
|
19
19
|
const val EXP_DELAY_MULTIPLIER: Double = 1.5
|
|
20
20
|
const val RETRY_DELAY_MS: Double = 300.0
|
|
21
21
|
const val MAX_RETRY_COUNT: Int = 3
|
|
@@ -255,7 +255,7 @@ export interface LibVlcPlayerViewProps extends ViewProps {
|
|
|
255
255
|
*
|
|
256
256
|
* @see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs}
|
|
257
257
|
*/
|
|
258
|
-
ref
|
|
258
|
+
ref?: React.RefObject<LibVlcPlayerViewRef | null>;
|
|
259
259
|
/**
|
|
260
260
|
* Sets the source of the media to be played. Set to `null` to release the player
|
|
261
261
|
*
|
|
@@ -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;;;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M,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 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 number 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, number, 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 number equal or greater than `1`\n *\n * @default 1\n */\n rate?: number;\n /**\n * Sets the initial player time. Must be a number equal or greater than `0`\n *\n * @default 0\n */\n time?: number;\n /**\n * Sets the player volume. Must be a number 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
|
+
{"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 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 number 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, number, 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 number equal or greater than `1`\n *\n * @default 1\n */\n rate?: number;\n /**\n * Sets the initial player time. Must be a number equal or greater than `0`\n *\n * @default 0\n */\n time?: number;\n /**\n * Sets the player volume. Must be a number 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"]}
|
|
@@ -5,7 +5,7 @@ enum MediaPlayerConstants {
|
|
|
5
5
|
static let minPlayerVolume: Int = 0
|
|
6
6
|
static let maxPlayerVolume: Int = 100
|
|
7
7
|
|
|
8
|
-
static let
|
|
8
|
+
static let resetDelayMs: Double = 1_000.0
|
|
9
9
|
static let expDelayMultiplier: Double = 1.5
|
|
10
10
|
static let retryDelayMs: Double = 300.0
|
|
11
11
|
static let maxRetryCount: Int = 3
|
|
@@ -73,17 +73,11 @@ class LibVlcPlayerView: ExpoView {
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
func createPlayer() {
|
|
76
|
-
var drawable: MediaPlayerDrawable
|
|
77
|
-
|
|
78
|
-
if pictureInPicture {
|
|
79
|
-
playerDrawable.removeFromSuperview()
|
|
80
|
-
drawable = pictureDrawable
|
|
81
|
-
} else {
|
|
82
|
-
pictureDrawable?.removeFromSuperview()
|
|
83
|
-
drawable = playerDrawable
|
|
84
|
-
}
|
|
85
|
-
|
|
86
76
|
library = VLCLibrary()
|
|
77
|
+
let drawable = pictureInPicture
|
|
78
|
+
? pictureDrawable!
|
|
79
|
+
: playerDrawable
|
|
80
|
+
|
|
87
81
|
mediaPlayer = VLCMediaPlayer(library: library!)
|
|
88
82
|
mediaPlayer!.drawable = drawable
|
|
89
83
|
mediaPlayer!.delegate = self
|
|
@@ -109,6 +103,7 @@ class LibVlcPlayerView: ExpoView {
|
|
|
109
103
|
firstPlay = true
|
|
110
104
|
shouldInit = false
|
|
111
105
|
|
|
106
|
+
subviews.forEach { view in view.removeFromSuperview() }
|
|
112
107
|
addSubview(drawable)
|
|
113
108
|
}
|
|
114
109
|
|
|
@@ -304,6 +299,16 @@ class LibVlcPlayerView: ExpoView {
|
|
|
304
299
|
return CGSize(width: 0, height: 0)
|
|
305
300
|
}
|
|
306
301
|
|
|
302
|
+
func resetVideoTrack() {
|
|
303
|
+
guard let player = mediaPlayer,
|
|
304
|
+
let videoTrack = player.videoTracks.first(where: { track in track.isSelected }),
|
|
305
|
+
isInBackground
|
|
306
|
+
else { return }
|
|
307
|
+
|
|
308
|
+
videoTrack.isSelected = false
|
|
309
|
+
videoTrack.isSelectedExclusively = true
|
|
310
|
+
}
|
|
311
|
+
|
|
307
312
|
var hasVideoSize: Bool {
|
|
308
313
|
let video = getVideoSize()
|
|
309
314
|
return video.width > 0 && video.height > 0
|
|
@@ -436,9 +441,10 @@ class LibVlcPlayerView: ExpoView {
|
|
|
436
441
|
mediaPlayer?.pause()
|
|
437
442
|
}
|
|
438
443
|
|
|
439
|
-
func
|
|
444
|
+
func pauseReset() {
|
|
440
445
|
if !pictureInPicture {
|
|
441
446
|
mediaPlayer?.pause()
|
|
447
|
+
resetVideoTrack()
|
|
442
448
|
}
|
|
443
449
|
}
|
|
444
450
|
|
|
@@ -464,6 +470,13 @@ class LibVlcPlayerView: ExpoView {
|
|
|
464
470
|
}
|
|
465
471
|
}
|
|
466
472
|
|
|
473
|
+
func seekZero() {
|
|
474
|
+
if let player = mediaPlayer {
|
|
475
|
+
// Black screen workaround
|
|
476
|
+
player.time = VLCTime(int: Int32(player.time.intValue))
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
|
|
467
480
|
func record(_ path: String?) {
|
|
468
481
|
if let player = mediaPlayer {
|
|
469
482
|
if let path {
|
|
@@ -528,30 +541,12 @@ class LibVlcPlayerView: ExpoView {
|
|
|
528
541
|
pictureDrawable.stopPictureInPicture()
|
|
529
542
|
}
|
|
530
543
|
|
|
531
|
-
func resetPictureInPicture() {
|
|
532
|
-
guard let player = mediaPlayer,
|
|
533
|
-
!player.isPlaying,
|
|
534
|
-
let videoTrack = player.videoTracks.first(where: { track in track.isSelected })
|
|
535
|
-
else { return }
|
|
536
|
-
|
|
537
|
-
videoTrack.isSelected = false
|
|
538
|
-
videoTrack.isSelectedExclusively = true
|
|
539
|
-
|
|
540
|
-
player.play()
|
|
541
|
-
|
|
542
|
-
let deadline = DispatchTime.now() + .milliseconds(Int(MediaPlayerConstants.pipDelayMs))
|
|
543
|
-
|
|
544
|
-
DispatchQueue.main.asyncAfter(deadline: deadline) {
|
|
545
|
-
player.pause()
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
|
|
549
544
|
func onStartPictureInPicture() {
|
|
550
545
|
onPictureInPictureStart()
|
|
551
546
|
}
|
|
552
547
|
|
|
553
548
|
func onStopPictureInPicture() {
|
|
554
|
-
|
|
549
|
+
resetVideoTrack()
|
|
555
550
|
onPictureInPictureStop()
|
|
556
551
|
}
|
|
557
552
|
|
|
@@ -565,7 +560,8 @@ class LibVlcPlayerView: ExpoView {
|
|
|
565
560
|
|
|
566
561
|
if block(isLastAttempt) || isLastAttempt { return }
|
|
567
562
|
|
|
568
|
-
let
|
|
563
|
+
let deadDelay = DispatchTimeInterval.milliseconds(Int(delay))
|
|
564
|
+
let deadline = DispatchTime.now() + deadDelay
|
|
569
565
|
let expDelay = delay * MediaPlayerConstants.expDelayMultiplier
|
|
570
566
|
|
|
571
567
|
DispatchQueue.main.asyncAfter(deadline: deadline) { [weak self] in
|
|
@@ -20,7 +20,7 @@ class AudioSessionManager {
|
|
|
20
20
|
let audioMixingMode = findAudioMixingMode()
|
|
21
21
|
var audioSessionCategoryOptions: AVAudioSession.CategoryOptions = audioSession.categoryOptions
|
|
22
22
|
|
|
23
|
-
let
|
|
23
|
+
let anyPlayingView = expoViews.allObjects.contains { view in
|
|
24
24
|
if let player = view.mediaPlayer, let audio = player.audio {
|
|
25
25
|
player.isPlaying && audio.volume > MediaPlayerConstants.minPlayerVolume
|
|
26
26
|
} else {
|
|
@@ -30,9 +30,9 @@ class AudioSessionManager {
|
|
|
30
30
|
|
|
31
31
|
let shouldMixOverride = audioMixingMode == .mixWithOthers
|
|
32
32
|
let doNotMixOverride = audioMixingMode == .doNotMix
|
|
33
|
-
let shouldDuckOthers = audioMixingMode == .duckOthers &&
|
|
33
|
+
let shouldDuckOthers = audioMixingMode == .duckOthers && anyPlayingView
|
|
34
34
|
|
|
35
|
-
let shouldMixWithOthers = shouldMixOverride || !
|
|
35
|
+
let shouldMixWithOthers = shouldMixOverride || !anyPlayingView
|
|
36
36
|
|
|
37
37
|
if shouldMixWithOthers && !shouldDuckOthers && !doNotMixOverride {
|
|
38
38
|
audioSessionCategoryOptions.insert(.mixWithOthers)
|
|
@@ -54,7 +54,7 @@ class AudioSessionManager {
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
if
|
|
57
|
+
if anyPlayingView || doNotMixOverride {
|
|
58
58
|
do {
|
|
59
59
|
try audioSession.setActive(true)
|
|
60
60
|
} catch {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
class KeepAwakeManager {
|
|
2
2
|
static let shared = KeepAwakeManager()
|
|
3
3
|
|
|
4
|
-
private lazy var
|
|
5
|
-
view.mediaPlayer?.isPlaying == true
|
|
6
|
-
}
|
|
4
|
+
private lazy var expoViews = MediaPlayerManager.shared.expoViews
|
|
7
5
|
|
|
8
6
|
func activateKeepAwake() {
|
|
9
7
|
DispatchQueue.main.async {
|
|
@@ -18,6 +16,10 @@ class KeepAwakeManager {
|
|
|
18
16
|
}
|
|
19
17
|
|
|
20
18
|
func toggleKeepAwake() {
|
|
19
|
+
let anyPlayingView = expoViews.allObjects.contains { view in
|
|
20
|
+
view.mediaPlayer?.isPlaying == true
|
|
21
|
+
}
|
|
22
|
+
|
|
21
23
|
if anyPlayingView {
|
|
22
24
|
activateKeepAwake()
|
|
23
25
|
} else {
|
|
@@ -27,6 +27,7 @@ class MediaPlayerManager {
|
|
|
27
27
|
for view in expoViews.allObjects {
|
|
28
28
|
view.isInBackground = false
|
|
29
29
|
view.onForeground()
|
|
30
|
+
view.seekZero()
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
33
|
|
|
@@ -34,7 +35,7 @@ class MediaPlayerManager {
|
|
|
34
35
|
for view in expoViews.allObjects {
|
|
35
36
|
view.isInBackground = true
|
|
36
37
|
view.onBackground()
|
|
37
|
-
view.
|
|
38
|
+
view.pauseReset()
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
41
|
}
|
|
@@ -83,7 +83,13 @@ extension PictureInPictureDrawable: VLCPictureInPictureMediaControlling {
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
func seek(by offset: Int64, completion: (() -> Void)!) {
|
|
86
|
-
|
|
86
|
+
if let player = mediaPlayer {
|
|
87
|
+
player.time = VLCTime(int: Int32(player.time.intValue + Int32(offset)))
|
|
88
|
+
|
|
89
|
+
DispatchQueue.main.async {
|
|
90
|
+
completion()
|
|
91
|
+
}
|
|
92
|
+
}
|
|
87
93
|
}
|
|
88
94
|
|
|
89
95
|
func mediaLength() -> Int64 {
|
package/package.json
CHANGED
|
@@ -295,7 +295,7 @@ export interface LibVlcPlayerViewProps extends ViewProps {
|
|
|
295
295
|
*
|
|
296
296
|
* @see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs}
|
|
297
297
|
*/
|
|
298
|
-
ref
|
|
298
|
+
ref?: React.RefObject<LibVlcPlayerViewRef | null>;
|
|
299
299
|
/**
|
|
300
300
|
* Sets the source of the media to be played. Set to `null` to release the player
|
|
301
301
|
*
|