expo-libvlc-player 3.2.4 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -16
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/libvlcplayer/LibVlcPlayerModule.kt +12 -0
- package/android/src/main/java/expo/modules/libvlcplayer/MediaPlayerManager.kt +0 -3
- package/build/LibVlcPlayer.types.d.ts +2 -0
- package/build/LibVlcPlayer.types.d.ts.map +1 -1
- package/build/LibVlcPlayer.types.js.map +1 -1
- package/build/LibVlcPlayerModule.d.ts +8 -1
- package/build/LibVlcPlayerModule.d.ts.map +1 -1
- package/build/LibVlcPlayerModule.js.map +1 -1
- package/ios/LibVlcPlayerModule.swift +1 -1
- package/package.json +2 -2
- package/src/LibVlcPlayer.types.ts +2 -0
- package/src/LibVlcPlayerModule.ts +8 -1
package/README.md
CHANGED
|
@@ -99,34 +99,43 @@ return (
|
|
|
99
99
|
);
|
|
100
100
|
```
|
|
101
101
|
|
|
102
|
-
|
|
102
|
+
Check whether battery optimization is enabled on Android:
|
|
103
103
|
|
|
104
104
|
```tsx
|
|
105
105
|
import LibVlcPlayerModule from "expo-libvlc-player";
|
|
106
106
|
|
|
107
|
-
await LibVlcPlayerModule.
|
|
107
|
+
await LibVlcPlayerModule.checkBatteryOptimization();
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Trigger the local network privacy alert on iOS:
|
|
111
|
+
|
|
112
|
+
```tsx
|
|
113
|
+
import LibVlcPlayerModule from "expo-libvlc-player";
|
|
114
|
+
|
|
115
|
+
await LibVlcPlayerModule.triggerNetworkAlert();
|
|
108
116
|
```
|
|
109
117
|
|
|
110
118
|
See the [Example App](example/App.tsx) for additional usage.
|
|
111
119
|
|
|
112
120
|
### Module methods
|
|
113
121
|
|
|
114
|
-
| Method
|
|
115
|
-
|
|
|
116
|
-
| `
|
|
122
|
+
| Method | Description | Returns |
|
|
123
|
+
| ---------------------------- | -------------------------------------------------------------------- | ------------------ |
|
|
124
|
+
| `checkBatteryOptimization()` | Attempts to check whether battery optimization is enabled on Android | `Promise<boolean>` |
|
|
125
|
+
| `triggerNetworkAlert()` | Attempts to trigger the local network privacy alert on iOS | `Promise<void>` |
|
|
117
126
|
|
|
118
127
|
### View methods
|
|
119
128
|
|
|
120
|
-
| Method | Description |
|
|
121
|
-
| -------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
|
|
122
|
-
| `play()` | Starts playback of the current player |
|
|
123
|
-
| `pause()` | Pauses playback of the current player |
|
|
124
|
-
| `stop()` | Stops playback of the current player |
|
|
125
|
-
| `seek(value: number, type?: "time" \| "position")` | Sets the time or position of the current player. Must be a number equal or greater than `0`, type defaults to `"time"` |
|
|
126
|
-
| `record(path?: string)` | Starts or stops recording the current media. Must be a valid string or `undefined` to stop recording |
|
|
127
|
-
| `snapshot(path: string)` | Takes a snapshot of the current media. Must be a valid string |
|
|
128
|
-
| `postAction(action: number)` | Posts an answer to a [`Dialog`](#dialog). Must be an integer of `1` or `2` |
|
|
129
|
-
| `dismiss()` | Dismisses a [`Dialog`](#dialog) |
|
|
129
|
+
| Method | Description | Returns |
|
|
130
|
+
| -------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | --------------- |
|
|
131
|
+
| `play()` | Starts playback of the current player | `Promise<void>` |
|
|
132
|
+
| `pause()` | Pauses playback of the current player | `Promise<void>` |
|
|
133
|
+
| `stop()` | Stops playback of the current player | `Promise<void>` |
|
|
134
|
+
| `seek(value: number, type?: "time" \| "position")` | Sets the time or position of the current player. Must be a number equal or greater than `0`, type defaults to `"time"` | `Promise<void>` |
|
|
135
|
+
| `record(path?: string)` | Starts or stops recording the current media. Must be a valid string or `undefined` to stop recording | `Promise<void>` |
|
|
136
|
+
| `snapshot(path: string)` | Takes a snapshot of the current media. Must be a valid string | `Promise<void>` |
|
|
137
|
+
| `postAction(action: number)` | Posts an answer to a [`Dialog`](#dialog). Must be an integer of `1` or `2` | `Promise<void>` |
|
|
138
|
+
| `dismiss()` | Dismisses a [`Dialog`](#dialog) | `Promise<void>` |
|
|
130
139
|
|
|
131
140
|
### View props
|
|
132
141
|
|
|
@@ -146,7 +155,7 @@ The `LibVlcPlayerView` extends React Native `ViewProps` and implements the follo
|
|
|
146
155
|
| `volume` | Sets the player volume. Must be an integer between `0` and `100` | `100` |
|
|
147
156
|
| `mute` | Sets the player volume to `0` when `true`. Previous value is set when `false` | `false` |
|
|
148
157
|
| `audioMixingMode` | Determines how the player will interact with other audio in the system | `"auto"` |
|
|
149
|
-
| `playInBackground` | Determines whether the media should continue playing in the background
|
|
158
|
+
| `playInBackground` | Determines whether the media should continue playing in the background. Battery optimization must be disabled on Android | `false` |
|
|
150
159
|
| `repeat` | Determines whether the media should repeat once ended | `false` |
|
|
151
160
|
| `autoplay` | Determines whether the media should autoplay once created | `true` |
|
|
152
161
|
|
package/android/build.gradle
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
apply plugin: "com.android.library"
|
|
2
2
|
|
|
3
3
|
group = "expo.modules.libvlcplayer"
|
|
4
|
-
version = "3.
|
|
4
|
+
version = "3.3.0"
|
|
5
5
|
|
|
6
6
|
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
7
7
|
apply from: expoModulesCorePlugin
|
|
@@ -27,7 +27,7 @@ android {
|
|
|
27
27
|
namespace "expo.modules.libvlcplayer"
|
|
28
28
|
defaultConfig {
|
|
29
29
|
versionCode 1
|
|
30
|
-
versionName "3.
|
|
30
|
+
versionName "3.3.0"
|
|
31
31
|
consumerProguardFiles("proguard-rules.pro")
|
|
32
32
|
}
|
|
33
33
|
lintOptions {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
package expo.modules.libvlcplayer
|
|
2
2
|
|
|
3
|
+
import android.content.Context
|
|
4
|
+
import android.os.PowerManager
|
|
5
|
+
import expo.modules.kotlin.exception.Exceptions
|
|
3
6
|
import expo.modules.kotlin.modules.Module
|
|
4
7
|
import expo.modules.kotlin.modules.ModuleDefinition
|
|
5
8
|
import expo.modules.libvlcplayer.enums.AudioMixingMode
|
|
@@ -43,10 +46,19 @@ val playerEvents =
|
|
|
43
46
|
)
|
|
44
47
|
|
|
45
48
|
class LibVlcPlayerModule : Module() {
|
|
49
|
+
private val context: Context
|
|
50
|
+
get() = appContext.reactContext ?: throw Exceptions.ReactContextLost()
|
|
51
|
+
|
|
46
52
|
override fun definition() =
|
|
47
53
|
ModuleDefinition {
|
|
48
54
|
Name("ExpoLibVlcPlayer")
|
|
49
55
|
|
|
56
|
+
AsyncFunction("checkBatteryOptimization") {
|
|
57
|
+
val powerManager = context.applicationContext.getSystemService(Context.POWER_SERVICE) as? PowerManager
|
|
58
|
+
val packageName = context.applicationContext.packageName
|
|
59
|
+
return@AsyncFunction powerManager?.isIgnoringBatteryOptimizations(packageName) == false
|
|
60
|
+
}
|
|
61
|
+
|
|
50
62
|
OnCreate {
|
|
51
63
|
MediaPlayerManager.onModuleCreate(appContext)
|
|
52
64
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
package expo.modules.libvlcplayer
|
|
2
2
|
|
|
3
3
|
import expo.modules.kotlin.AppContext
|
|
4
|
-
import expo.modules.kotlin.exception.Exceptions
|
|
5
4
|
import java.lang.ref.WeakReference
|
|
6
5
|
|
|
7
6
|
object MediaPlayerManager {
|
|
@@ -18,8 +17,6 @@ object MediaPlayerManager {
|
|
|
18
17
|
}
|
|
19
18
|
|
|
20
19
|
fun onModuleCreate(appContext: AppContext) {
|
|
21
|
-
val context = appContext.reactContext ?: throw Exceptions.ReactContextLost()
|
|
22
|
-
|
|
23
20
|
if (!this::audioFocusManager.isInitialized) {
|
|
24
21
|
audioFocusManager = AudioFocusManager(appContext)
|
|
25
22
|
}
|
|
@@ -320,6 +320,8 @@ export interface LibVlcPlayerViewProps extends ViewProps {
|
|
|
320
320
|
/**
|
|
321
321
|
* Determines whether the media should continue playing in the background
|
|
322
322
|
*
|
|
323
|
+
* @note Battery optimization must be disabled on Android
|
|
324
|
+
*
|
|
323
325
|
* @default false
|
|
324
326
|
*/
|
|
325
327
|
playInBackground?: boolean;
|
|
@@ -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;AAE9C,MAAM,MAAM,wBAAwB,GAAG,EAAE,CAAC;AAE1C,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC;;;;;;;OAOG;IACH,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5E;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAClD;;;;;;OAMG;IACH,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD;;;;;;OAMG;IACH,QAAQ,CAAC,UAAU,EAAE,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtD;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACvC;AAED,MAAM,MAAM,YAAY,GAAG,MAAM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G;IACH,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B;;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;CAC3B"}
|
|
@@ -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\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 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 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 * Dismisses a `Dialog`\n *\n * @returns A promise which resolves to `void`\n */\n readonly dismiss: () => 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 VideoContentFit = \"contain\" | \"cover\" | \"fill\";\n\nexport type AudioMixingMode =\n | \"mixWithOthers\"\n | \"duckOthers\"\n | \"auto\"\n | \"doNotMix\";\n\nexport interface NativeEventProps {\n target: number;\n}\n\nexport interface NativeEvent<T> {\n nativeEvent: T & NativeEventProps;\n}\n\nexport type LibVlcEvent<T> = Omit<T & NativeEventProps, \"target\">;\n\nexport interface Dialog {\n title: string;\n text: string;\n 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 tracks: MediaTracks;\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 EndReachedListener = () => void;\n\nexport type Error = { error: string };\n\n/**\n * @hidden\n */\ntype EncounteredErrorListener = (event: NativeEvent<Error>) => void;\n\nexport type Time = { time: number };\n\n/**\n * @hidden\n */\ntype TimeChangedListener = (event: NativeEvent<Time>) => void;\n\nexport type Position = { position: number };\n\n/**\n * @hidden\n */\ntype PositionChangedListener = (event: NativeEvent<Position>) => void;\n\n/**\n * @hidden\n */\ntype ESAddedListener = (event: NativeEvent<MediaTracks>) => void;\n\n/**\n * @hidden\n */\ntype RecordChangedListener = (event: NativeEvent<Recording>) => void;\n\nexport type Snapshot = { path: string };\n\n/**\n * @hidden\n */\ntype SnapshotTakenListener = (event: NativeEvent<Snapshot>) => void;\n\n/**\n * @hidden\n */\ntype DialogDisplayListener = (event: NativeEvent<Dialog>) => void;\n\n/**\n * @hidden\n */\ntype FirstPlayListener = (event: NativeEvent<MediaInfo>) => void;\n\n/**\n * @hidden\n */\ntype ForegroundListener = () => void;\n\n/**\n * @hidden\n */\ntype BackgroundListener = () => void;\n\n/**\n * @hidden\n */\nexport interface LibVlcPlayerViewNativeProps {\n ref?: React.Ref<LibVlcPlayerViewRef>;\n source?: LibVlcSource;\n options?: string[];\n tracks?: Tracks;\n slaves?: Slave[];\n scale?: number;\n aspectRatio?: string | null;\n contentFit?: VideoContentFit;\n rate?: number;\n time?: number;\n volume?: number;\n mute?: boolean;\n audioMixingMode?: AudioMixingMode;\n playInBackground?: boolean;\n repeat?: boolean;\n autoplay?: boolean;\n onBuffering?: BufferingListener;\n onPlaying?: PlayingListener;\n onPaused?: PausedListener;\n onStopped?: StoppedListener;\n onEndReached?: EndReachedListener;\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}\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 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 [\"--network-caching=1000\"]\n *\n * @default []\n */\n options?: string[];\n /**\n * Sets the player audio, video and subtitle tracks\n *\n * @example\n * ```tsx\n * <LibVlcPlayerView\n * tracks={{\n * audio: 0,\n * video: 1,\n * subtitle: 2,\n * }}\n * />\n * ```\n *\n * @default undefined\n */\n tracks?: Tracks;\n /**\n * Sets the player audio and subtitle slaves\n *\n * @example\n * ```tsx\n * <LibVlcPlayerView\n * slaves={[\n * {\n * source: \"file://path/to/subtitle.srt\",\n * type: \"subtitle\",\n * selected: true\n * },\n * ]}\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 player aspect ratio. Must be a valid string or `null` for default\n *\n * @example \"16:9\"\n *\n * @default undefined\n */\n aspectRatio?: string | null;\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 * @default \"auto\"\n */\n audioMixingMode?: AudioMixingMode;\n /**\n * Determines whether the media should continue playing in the background\n *\n * @default false\n */\n playInBackground?: boolean;\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 * 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 `EndReached` player event\n */\n onEndReached?: () => 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"]}
|
|
1
|
+
{"version":3,"file":"LibVlcPlayer.types.js","sourceRoot":"","sources":["../src/LibVlcPlayer.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ViewProps } from \"react-native\";\n\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 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 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 * Dismisses a `Dialog`\n *\n * @returns A promise which resolves to `void`\n */\n readonly dismiss: () => 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 VideoContentFit = \"contain\" | \"cover\" | \"fill\";\n\nexport type AudioMixingMode =\n | \"mixWithOthers\"\n | \"duckOthers\"\n | \"auto\"\n | \"doNotMix\";\n\nexport interface NativeEventProps {\n target: number;\n}\n\nexport interface NativeEvent<T> {\n nativeEvent: T & NativeEventProps;\n}\n\nexport type LibVlcEvent<T> = Omit<T & NativeEventProps, \"target\">;\n\nexport interface Dialog {\n title: string;\n text: string;\n 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 tracks: MediaTracks;\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 EndReachedListener = () => void;\n\nexport type Error = { error: string };\n\n/**\n * @hidden\n */\ntype EncounteredErrorListener = (event: NativeEvent<Error>) => void;\n\nexport type Time = { time: number };\n\n/**\n * @hidden\n */\ntype TimeChangedListener = (event: NativeEvent<Time>) => void;\n\nexport type Position = { position: number };\n\n/**\n * @hidden\n */\ntype PositionChangedListener = (event: NativeEvent<Position>) => void;\n\n/**\n * @hidden\n */\ntype ESAddedListener = (event: NativeEvent<MediaTracks>) => void;\n\n/**\n * @hidden\n */\ntype RecordChangedListener = (event: NativeEvent<Recording>) => void;\n\nexport type Snapshot = { path: string };\n\n/**\n * @hidden\n */\ntype SnapshotTakenListener = (event: NativeEvent<Snapshot>) => void;\n\n/**\n * @hidden\n */\ntype DialogDisplayListener = (event: NativeEvent<Dialog>) => void;\n\n/**\n * @hidden\n */\ntype FirstPlayListener = (event: NativeEvent<MediaInfo>) => void;\n\n/**\n * @hidden\n */\ntype ForegroundListener = () => void;\n\n/**\n * @hidden\n */\ntype BackgroundListener = () => void;\n\n/**\n * @hidden\n */\nexport interface LibVlcPlayerViewNativeProps {\n ref?: React.Ref<LibVlcPlayerViewRef>;\n source?: LibVlcSource;\n options?: string[];\n tracks?: Tracks;\n slaves?: Slave[];\n scale?: number;\n aspectRatio?: string | null;\n contentFit?: VideoContentFit;\n rate?: number;\n time?: number;\n volume?: number;\n mute?: boolean;\n audioMixingMode?: AudioMixingMode;\n playInBackground?: boolean;\n repeat?: boolean;\n autoplay?: boolean;\n onBuffering?: BufferingListener;\n onPlaying?: PlayingListener;\n onPaused?: PausedListener;\n onStopped?: StoppedListener;\n onEndReached?: EndReachedListener;\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}\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 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 [\"--network-caching=1000\"]\n *\n * @default []\n */\n options?: string[];\n /**\n * Sets the player audio, video and subtitle tracks\n *\n * @example\n * ```tsx\n * <LibVlcPlayerView\n * tracks={{\n * audio: 0,\n * video: 1,\n * subtitle: 2,\n * }}\n * />\n * ```\n *\n * @default undefined\n */\n tracks?: Tracks;\n /**\n * Sets the player audio and subtitle slaves\n *\n * @example\n * ```tsx\n * <LibVlcPlayerView\n * slaves={[\n * {\n * source: \"file://path/to/subtitle.srt\",\n * type: \"subtitle\",\n * selected: true\n * },\n * ]}\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 player aspect ratio. Must be a valid string or `null` for default\n *\n * @example \"16:9\"\n *\n * @default undefined\n */\n aspectRatio?: string | null;\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 * @default \"auto\"\n */\n audioMixingMode?: AudioMixingMode;\n /**\n * Determines whether the media should continue playing in the background\n *\n * @note Battery optimization must be disabled on Android\n *\n * @default false\n */\n playInBackground?: boolean;\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 * 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 `EndReached` player event\n */\n onEndReached?: () => 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"]}
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import { NativeModule } from "expo";
|
|
2
2
|
import { LibVlcPlayerModuleEvents } from "./LibVlcPlayer.types";
|
|
3
3
|
declare class LibVlcPlayerModule extends NativeModule<LibVlcPlayerModuleEvents> {
|
|
4
|
+
/** Attempts to check whether battery optimization is enabled
|
|
5
|
+
*
|
|
6
|
+
* @returns A promise which resolves to `true` or `false`
|
|
7
|
+
*
|
|
8
|
+
* @platform android
|
|
9
|
+
*/
|
|
10
|
+
checkBatteryOptimization(): Promise<boolean>;
|
|
4
11
|
/** Attempts to trigger the local network privacy alert
|
|
5
12
|
*
|
|
6
13
|
* @returns A promise which resolves to `void`
|
|
7
14
|
*
|
|
8
15
|
* @platform ios
|
|
9
16
|
*/
|
|
10
|
-
|
|
17
|
+
triggerNetworkAlert(): Promise<void>;
|
|
11
18
|
}
|
|
12
19
|
declare const _default: LibVlcPlayerModule;
|
|
13
20
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LibVlcPlayerModule.d.ts","sourceRoot":"","sources":["../src/LibVlcPlayerModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAuB,MAAM,MAAM,CAAC;AAEzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,OAAO,OAAO,kBAAmB,SAAQ,YAAY,CAAC,wBAAwB,CAAC;IAC7E;;;;;OAKG;IACH,
|
|
1
|
+
{"version":3,"file":"LibVlcPlayerModule.d.ts","sourceRoot":"","sources":["../src/LibVlcPlayerModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAuB,MAAM,MAAM,CAAC;AAEzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,OAAO,OAAO,kBAAmB,SAAQ,YAAY,CAAC,wBAAwB,CAAC;IAC7E;;;;;OAKG;IACH,wBAAwB,IAAI,OAAO,CAAC,OAAO,CAAC;IAC5C;;;;;OAKG;IACH,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;CACrC;;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 { LibVlcPlayerModuleEvents } from \"./LibVlcPlayer.types\";\n\ndeclare class LibVlcPlayerModule extends NativeModule<LibVlcPlayerModuleEvents> {\n /** Attempts to check whether battery optimization is enabled\n *\n * @returns A promise which resolves to `true` or `false`\n *\n * @platform android\n */\n checkBatteryOptimization(): Promise<boolean>;\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\nexport default requireNativeModule<LibVlcPlayerModule>(\"ExpoLibVlcPlayer\");\n"]}
|
|
@@ -38,7 +38,7 @@ public class LibVlcPlayerModule: Module {
|
|
|
38
38
|
public func definition() -> ModuleDefinition {
|
|
39
39
|
Name("ExpoLibVlcPlayer")
|
|
40
40
|
|
|
41
|
-
AsyncFunction("
|
|
41
|
+
AsyncFunction("triggerNetworkAlert") {
|
|
42
42
|
LocalNetworkManager.shared.triggerLocalNetworkPrivacyAlert()
|
|
43
43
|
}
|
|
44
44
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-libvlc-player",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"description": "LibVLC Player for Expo",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@eslint/js": "^9.30.0",
|
|
36
36
|
"@types/react": "~19.0.0",
|
|
37
37
|
"eslint": "^9.30.0",
|
|
38
|
-
"expo": "~53.0.
|
|
38
|
+
"expo": "~53.0.27",
|
|
39
39
|
"expo-module-scripts": "^4.1.6",
|
|
40
40
|
"globals": "^16.2.0",
|
|
41
41
|
"husky": "^9.1.7",
|
|
@@ -352,6 +352,8 @@ export interface LibVlcPlayerViewProps extends ViewProps {
|
|
|
352
352
|
/**
|
|
353
353
|
* Determines whether the media should continue playing in the background
|
|
354
354
|
*
|
|
355
|
+
* @note Battery optimization must be disabled on Android
|
|
356
|
+
*
|
|
355
357
|
* @default false
|
|
356
358
|
*/
|
|
357
359
|
playInBackground?: boolean;
|
|
@@ -3,13 +3,20 @@ import { NativeModule, requireNativeModule } from "expo";
|
|
|
3
3
|
import { LibVlcPlayerModuleEvents } from "./LibVlcPlayer.types";
|
|
4
4
|
|
|
5
5
|
declare class LibVlcPlayerModule extends NativeModule<LibVlcPlayerModuleEvents> {
|
|
6
|
+
/** Attempts to check whether battery optimization is enabled
|
|
7
|
+
*
|
|
8
|
+
* @returns A promise which resolves to `true` or `false`
|
|
9
|
+
*
|
|
10
|
+
* @platform android
|
|
11
|
+
*/
|
|
12
|
+
checkBatteryOptimization(): Promise<boolean>;
|
|
6
13
|
/** Attempts to trigger the local network privacy alert
|
|
7
14
|
*
|
|
8
15
|
* @returns A promise which resolves to `void`
|
|
9
16
|
*
|
|
10
17
|
* @platform ios
|
|
11
18
|
*/
|
|
12
|
-
|
|
19
|
+
triggerNetworkAlert(): Promise<void>;
|
|
13
20
|
}
|
|
14
21
|
|
|
15
22
|
export default requireNativeModule<LibVlcPlayerModule>("ExpoLibVlcPlayer");
|