expo-libvlc-player 2.1.2 → 2.1.3
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 +13 -13
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/libvlcplayer/LibVlcPlayerModule.kt +4 -4
- package/android/src/main/java/expo/modules/libvlcplayer/LibVlcPlayerView.kt +10 -10
- package/build/LibVlcPlayer.types.d.ts +18 -18
- package/build/LibVlcPlayer.types.d.ts.map +1 -1
- package/build/LibVlcPlayer.types.js.map +1 -1
- package/build/LibVlcPlayerView.js.map +1 -1
- package/ios/LibVlcPlayerModule.swift +4 -4
- package/ios/LibVlcPlayerView.swift +9 -9
- package/package.json +1 -1
- package/src/LibVlcPlayer.types.ts +24 -24
- package/src/LibVlcPlayerView.tsx +1 -1
package/README.md
CHANGED
|
@@ -137,9 +137,9 @@ The `LibVlcPlayerView` extends React Native `ViewProps` and implements the follo
|
|
|
137
137
|
| `volume` | Sets the player volume. Must be an integer between `0` and `100` | `100` |
|
|
138
138
|
| `mute` | Sets the player volume to `0` when `true`. Previous value is set when `false` | `false` |
|
|
139
139
|
| `audioMixingMode` | Determines how the player will interact with other audio in the system | `"auto"` |
|
|
140
|
+
| `repeat` | Determines whether the media should repeat once ended | `false` |
|
|
140
141
|
| `playInBackground` | Determines whether the media should continue playing in the background | `false` |
|
|
141
142
|
| `autoplay` | Determines whether the media should autoplay once created | `true` |
|
|
142
|
-
| `repeat` | Determines whether the media should repeat once ended | `false` |
|
|
143
143
|
|
|
144
144
|
#### Callback props
|
|
145
145
|
|
|
@@ -198,18 +198,6 @@ The `LibVlcPlayerView` extends React Native `ViewProps` and implements the follo
|
|
|
198
198
|
}
|
|
199
199
|
```
|
|
200
200
|
|
|
201
|
-
#### `QuestionDialog`
|
|
202
|
-
|
|
203
|
-
```ts
|
|
204
|
-
{
|
|
205
|
-
title: string;
|
|
206
|
-
text: string;
|
|
207
|
-
cancelText?: string;
|
|
208
|
-
action1Text?: string;
|
|
209
|
-
action2Text?: string;
|
|
210
|
-
}
|
|
211
|
-
```
|
|
212
|
-
|
|
213
201
|
#### `MediaInfo`
|
|
214
202
|
|
|
215
203
|
```ts
|
|
@@ -222,6 +210,18 @@ The `LibVlcPlayerView` extends React Native `ViewProps` and implements the follo
|
|
|
222
210
|
}
|
|
223
211
|
```
|
|
224
212
|
|
|
213
|
+
#### `QuestionDialog`
|
|
214
|
+
|
|
215
|
+
```ts
|
|
216
|
+
{
|
|
217
|
+
title: string;
|
|
218
|
+
text: string;
|
|
219
|
+
cancelText?: string;
|
|
220
|
+
action1Text?: string;
|
|
221
|
+
action2Text?: string;
|
|
222
|
+
}
|
|
223
|
+
```
|
|
224
|
+
|
|
225
225
|
## Disclaimer
|
|
226
226
|
|
|
227
227
|
This project is not affiliated with, endorsed by, or officially supported by VideoLAN. The VLC icon is trademark of VideoLAN and is used here solely to indicate compatibility with the following **LibVLC** bindings:
|
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 = "2.1.
|
|
4
|
+
version = "2.1.3"
|
|
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 "2.1.
|
|
30
|
+
versionName "2.1.3"
|
|
31
31
|
consumerProguardFiles("proguard-rules.pro")
|
|
32
32
|
}
|
|
33
33
|
lintOptions {
|
|
@@ -93,6 +93,10 @@ class LibVlcPlayerModule : Module() {
|
|
|
93
93
|
view.audioMixingMode = audioMixingMode ?: AudioMixingMode.AUTO
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
+
Prop("repeat") { view: LibVlcPlayerView, repeat: Boolean? ->
|
|
97
|
+
view.repeat = repeat ?: false
|
|
98
|
+
}
|
|
99
|
+
|
|
96
100
|
Prop("playInBackground") { view: LibVlcPlayerView, playInBackground: Boolean? ->
|
|
97
101
|
view.playInBackground = playInBackground ?: false
|
|
98
102
|
}
|
|
@@ -101,10 +105,6 @@ class LibVlcPlayerModule : Module() {
|
|
|
101
105
|
view.autoplay = autoplay ?: true
|
|
102
106
|
}
|
|
103
107
|
|
|
104
|
-
Prop("repeat") { view: LibVlcPlayerView, repeat: Boolean? ->
|
|
105
|
-
view.repeat = repeat ?: false
|
|
106
|
-
}
|
|
107
|
-
|
|
108
108
|
OnViewDestroys { view: LibVlcPlayerView ->
|
|
109
109
|
MediaPlayerManager.unregisterPlayerView(view)
|
|
110
110
|
view.destroyPlayer()
|
|
@@ -381,6 +381,16 @@ class LibVlcPlayerView(
|
|
|
381
381
|
MediaPlayerManager.audioFocusManager.updateAudioFocus()
|
|
382
382
|
}
|
|
383
383
|
|
|
384
|
+
var repeat: Boolean = false
|
|
385
|
+
set(value) {
|
|
386
|
+
field = value
|
|
387
|
+
|
|
388
|
+
if (options.hasRepeatOption()) {
|
|
389
|
+
val error = mapOf("error" to "Repeat enabled via options")
|
|
390
|
+
onEncounteredError(error)
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
|
|
384
394
|
var playInBackground: Boolean = false
|
|
385
395
|
set(value) {
|
|
386
396
|
field = value
|
|
@@ -398,16 +408,6 @@ class LibVlcPlayerView(
|
|
|
398
408
|
}
|
|
399
409
|
}
|
|
400
410
|
|
|
401
|
-
var repeat: Boolean = false
|
|
402
|
-
set(value) {
|
|
403
|
-
field = value
|
|
404
|
-
|
|
405
|
-
if (options.hasRepeatOption()) {
|
|
406
|
-
val error = mapOf("error" to "Repeat enabled via options")
|
|
407
|
-
onEncounteredError(error)
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
|
|
411
411
|
fun play() {
|
|
412
412
|
mediaPlayer?.let { player ->
|
|
413
413
|
if (options.hasStartPausedOption()) {
|
|
@@ -52,6 +52,10 @@ export interface Slave {
|
|
|
52
52
|
type: "audio" | "subtitle";
|
|
53
53
|
selected?: boolean;
|
|
54
54
|
}
|
|
55
|
+
export type AudioMixingMode = "mixWithOthers" | "duckOthers" | "auto" | "doNotMix";
|
|
56
|
+
export interface NativeEvent<T> {
|
|
57
|
+
nativeEvent: T;
|
|
58
|
+
}
|
|
55
59
|
export interface Track {
|
|
56
60
|
id: number;
|
|
57
61
|
name: string;
|
|
@@ -68,9 +72,12 @@ export interface MediaInfo {
|
|
|
68
72
|
seekable: boolean;
|
|
69
73
|
tracks: MediaTracks;
|
|
70
74
|
}
|
|
71
|
-
export
|
|
72
|
-
|
|
73
|
-
|
|
75
|
+
export interface QuestionDialog {
|
|
76
|
+
title: string;
|
|
77
|
+
text: string;
|
|
78
|
+
cancelText?: string;
|
|
79
|
+
action1Text?: string;
|
|
80
|
+
action2Text?: string;
|
|
74
81
|
}
|
|
75
82
|
/**
|
|
76
83
|
* @hidden
|
|
@@ -114,13 +121,6 @@ type ESAddedListener = (event: NativeEvent<MediaTracks>) => void;
|
|
|
114
121
|
* @hidden
|
|
115
122
|
*/
|
|
116
123
|
type DialogDisplayListener = (event: NativeEvent<QuestionDialog>) => void;
|
|
117
|
-
export interface QuestionDialog {
|
|
118
|
-
title: string;
|
|
119
|
-
text: string;
|
|
120
|
-
cancelText?: string;
|
|
121
|
-
action1Text?: string;
|
|
122
|
-
action2Text?: string;
|
|
123
|
-
}
|
|
124
124
|
/**
|
|
125
125
|
* @hidden
|
|
126
126
|
*/
|
|
@@ -145,9 +145,9 @@ export interface LibVlcPlayerViewNativeProps {
|
|
|
145
145
|
volume?: number;
|
|
146
146
|
mute?: boolean;
|
|
147
147
|
audioMixingMode?: AudioMixingMode;
|
|
148
|
+
repeat?: boolean;
|
|
148
149
|
playInBackground?: boolean;
|
|
149
150
|
autoplay?: boolean;
|
|
150
|
-
repeat?: boolean;
|
|
151
151
|
onBuffering?: BufferingListener;
|
|
152
152
|
onPlaying?: PlayingListener;
|
|
153
153
|
onPaused?: PausedListener;
|
|
@@ -256,7 +256,13 @@ export interface LibVlcPlayerViewProps extends ViewProps {
|
|
|
256
256
|
*/
|
|
257
257
|
audioMixingMode?: AudioMixingMode;
|
|
258
258
|
/**
|
|
259
|
-
* Determines whether the media should
|
|
259
|
+
* Determines whether the media should repeat once ended
|
|
260
|
+
*
|
|
261
|
+
* @default false
|
|
262
|
+
*/
|
|
263
|
+
repeat?: boolean;
|
|
264
|
+
/**
|
|
265
|
+
* Determines whether the media should continue playing in the background
|
|
260
266
|
*
|
|
261
267
|
* @default false
|
|
262
268
|
*/
|
|
@@ -267,12 +273,6 @@ export interface LibVlcPlayerViewProps extends ViewProps {
|
|
|
267
273
|
* @default true
|
|
268
274
|
*/
|
|
269
275
|
autoplay?: boolean;
|
|
270
|
-
/**
|
|
271
|
-
* Determines whether the media should repeat once ended
|
|
272
|
-
*
|
|
273
|
-
* @default false
|
|
274
|
-
*/
|
|
275
|
-
repeat?: boolean;
|
|
276
276
|
/**
|
|
277
277
|
* Called after the `Buffering` player event
|
|
278
278
|
*/
|
|
@@ -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,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;;;;;;OAMG;IACH,QAAQ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AAK,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,cAAc,KAAK,IAAI,CAAC;IAClD;;OAEG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;IACzC;;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 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 position of the current player\n *\n * @param position - Must be a float between `0` and `1`\n *\n * @returns A promise which resolves to `void`\n */\n readonly seek: (position: number) => Promise<void>;\n /**\n * Posts an answer to a `QuestionDialog`\n *\n * @param action - Must be an integer between `1` and `2`\n *\n * @returns A promise which resolves to `void`\n */\n readonly postAction: (action: 1 | 2) => Promise<void>;\n /**\n * Dismisses a `QuestionDialog`\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 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\nexport
|
|
1
|
+
{"version":3,"file":"LibVlcPlayer.types.js","sourceRoot":"","sources":["../src/LibVlcPlayer.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ViewProps } from \"react-native\";\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 position of the current player\n *\n * @param position - Must be a float between `0` and `1`\n *\n * @returns A promise which resolves to `void`\n */\n readonly seek: (position: number) => Promise<void>;\n /**\n * Posts an answer to a `QuestionDialog`\n *\n * @param action - Must be an integer between `1` and `2`\n *\n * @returns A promise which resolves to `void`\n */\n readonly postAction: (action: 1 | 2) => Promise<void>;\n /**\n * Dismisses a `QuestionDialog`\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 AudioMixingMode =\n | \"mixWithOthers\"\n | \"duckOthers\"\n | \"auto\"\n | \"doNotMix\";\n\nexport interface NativeEvent<T> {\n nativeEvent: T;\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\nexport interface QuestionDialog {\n title: string;\n text: string;\n cancelText?: string;\n action1Text?: string;\n action2Text?: string;\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\n/**\n * @hidden\n */\ntype EncounteredErrorListener = (event: NativeEvent<Error>) => void;\n\nexport type Error = { error: string };\n\n/**\n * @hidden\n */\ntype PositionChangedListener = (event: NativeEvent<Position>) => void;\n\nexport type Position = { position: number };\n\n/**\n * @hidden\n */\ntype ESAddedListener = (event: NativeEvent<MediaTracks>) => void;\n\n/**\n * @hidden\n */\ntype DialogDisplayListener = (event: NativeEvent<QuestionDialog>) => void;\n\n/**\n * @hidden\n */\ntype FirstPlayListener = (event: NativeEvent<MediaInfo>) => 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 rate?: number;\n time?: number;\n volume?: number;\n mute?: boolean;\n audioMixingMode?: AudioMixingMode;\n repeat?: boolean;\n playInBackground?: boolean;\n autoplay?: boolean;\n onBuffering?: BufferingListener;\n onPlaying?: PlayingListener;\n onPaused?: PausedListener;\n onStopped?: StoppedListener;\n onEndReached?: EndReachedListener;\n onEncounteredError?: EncounteredErrorListener;\n onPositionChanged?: PositionChangedListener;\n onESAdded?: ESAddedListener;\n onDialogDisplay?: DialogDisplayListener;\n onFirstPlay?: FirstPlayListener;\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 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 repeat once ended\n *\n * @default false\n */\n repeat?: boolean;\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 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 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 a `QuestionDialog` is displayed\n */\n onDialogDisplay?: (event: QuestionDialog) => void;\n /**\n * Called after the first `Playing` player event\n */\n onFirstPlay?: (event: MediaInfo) => void;\n /**\n * Called after the player enters the background\n */\n onBackground?: () => void;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LibVlcPlayerView.js","sourceRoot":"","sources":["../src/LibVlcPlayerView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EAAE,UAAU,EAAsB,MAAM,OAAO,CAAC;AAavD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD,MAAM,UAAU,GACd,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;AAExC,IAAI,8BAA8B,GAAY,KAAK,CAAC;AAEpD,MAAM,gBAAgB,GAAG,UAAU,CACjC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACb,MAAM,WAAW,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;IAE9C,mBAAmB;IACnB,IAAI,WAAW,CAAC,QAAQ,IAAI,CAAC,8BAA8B,EAAE,CAAC;QAC5D,OAAO,CAAC,IAAI,CACV,gNAAgN,CACjN,CAAC;QACF,8BAA8B,GAAG,IAAI,CAAC;IACxC,CAAC;IAED,MAAM,kBAAkB,GAAG,CAAC,EAAE,WAAW,EAAsB,EAAE,EAAE;QACjE,IAAI,KAAK,CAAC,kBAAkB,EAAE,CAAC;YAC7B,KAAK,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;QACxC,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,iBAAiB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CAAC,WAAW,CAAC,EACzB,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["import { requireNativeView } from \"expo\";\nimport { forwardRef, type ComponentType } from \"react\";\n\nimport {\n LibVlcPlayerViewNativeProps,\n LibVlcPlayerViewProps,\n LibVlcPlayerViewRef,\n type NativeEvent,\n type Error,\n type Position,\n type MediaTracks,\n type
|
|
1
|
+
{"version":3,"file":"LibVlcPlayerView.js","sourceRoot":"","sources":["../src/LibVlcPlayerView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EAAE,UAAU,EAAsB,MAAM,OAAO,CAAC;AAavD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD,MAAM,UAAU,GACd,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;AAExC,IAAI,8BAA8B,GAAY,KAAK,CAAC;AAEpD,MAAM,gBAAgB,GAAG,UAAU,CACjC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACb,MAAM,WAAW,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;IAE9C,mBAAmB;IACnB,IAAI,WAAW,CAAC,QAAQ,IAAI,CAAC,8BAA8B,EAAE,CAAC;QAC5D,OAAO,CAAC,IAAI,CACV,gNAAgN,CACjN,CAAC;QACF,8BAA8B,GAAG,IAAI,CAAC;IACxC,CAAC;IAED,MAAM,kBAAkB,GAAG,CAAC,EAAE,WAAW,EAAsB,EAAE,EAAE;QACjE,IAAI,KAAK,CAAC,kBAAkB,EAAE,CAAC;YAC7B,KAAK,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;QACxC,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,iBAAiB,GAAG,CAAC,EAAE,WAAW,EAAyB,EAAE,EAAE;QACnE,IAAI,KAAK,CAAC,iBAAi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gB,CAAC","sourcesContent":["import { requireNativeView } from \"expo\";\nimport { forwardRef, type ComponentType } from \"react\";\n\nimport {\n LibVlcPlayerViewNativeProps,\n LibVlcPlayerViewProps,\n LibVlcPlayerViewRef,\n type NativeEvent,\n type Error,\n type Position,\n type MediaTracks,\n type MediaInfo,\n type QuestionDialog,\n} from \"./LibVlcPlayer.types\";\nimport { parseSource } from \"./utils/assets\";\nimport { convertNativeProps } from \"./utils/props\";\n\nconst NativeView: ComponentType<LibVlcPlayerViewNativeProps> =\n requireNativeView(\"ExpoLibVlcPlayer\");\n\nlet loggedRenderingChildrenWarning: boolean = false;\n\nconst LibVlcPlayerView = forwardRef<LibVlcPlayerViewRef, LibVlcPlayerViewProps>(\n (props, ref) => {\n const nativeProps = convertNativeProps(props);\n\n // @ts-expect-error\n if (nativeProps.children && !loggedRenderingChildrenWarning) {\n console.warn(\n \"The <LibVlcPlayerView> component does not support children. This may lead to inconsistent behaviour or crashes. If you want to render content on top of the LibVlcPlayer, consider using absolute positioning.\",\n );\n loggedRenderingChildrenWarning = true;\n }\n\n const onEncounteredError = ({ nativeEvent }: NativeEvent<Error>) => {\n if (props.onEncounteredError) {\n props.onEncounteredError(nativeEvent);\n }\n };\n\n const onPositionChanged = ({ nativeEvent }: NativeEvent<Position>) => {\n if (props.onPositionChanged) {\n props.onPositionChanged(nativeEvent);\n }\n };\n\n const onESAdded = ({ nativeEvent }: NativeEvent<MediaTracks>) => {\n if (props.onESAdded) {\n props.onESAdded(nativeEvent);\n }\n };\n\n const onDialogDisplay = ({ nativeEvent }: NativeEvent<QuestionDialog>) => {\n if (props.onDialogDisplay) {\n props.onDialogDisplay(nativeEvent);\n }\n };\n\n const onFirstPlay = ({ nativeEvent }: NativeEvent<MediaInfo>) => {\n if (props.onFirstPlay) {\n props.onFirstPlay(nativeEvent);\n }\n };\n\n return (\n <NativeView\n {...nativeProps}\n ref={ref}\n source={parseSource(props.source)}\n slaves={props.slaves?.map((slave) => ({\n ...slave,\n source: parseSource(slave.source)!,\n }))}\n onEncounteredError={onEncounteredError}\n onPositionChanged={onPositionChanged}\n onESAdded={onESAdded}\n onDialogDisplay={onDialogDisplay}\n onFirstPlay={onFirstPlay}\n />\n );\n },\n);\n\nexport default LibVlcPlayerView;\n"]}
|
|
@@ -81,6 +81,10 @@ public class LibVlcPlayerModule: Module {
|
|
|
81
81
|
view.audioMixingMode = audioMixingMode ?? .auto
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
+
Prop("repeat") { (view: LibVlcPlayerView, shouldRepeat: Bool?) in
|
|
85
|
+
view.shouldRepeat = shouldRepeat ?? false
|
|
86
|
+
}
|
|
87
|
+
|
|
84
88
|
Prop("playInBackground") { (view: LibVlcPlayerView, playInBackground: Bool?) in
|
|
85
89
|
view.playInBackground = playInBackground ?? false
|
|
86
90
|
}
|
|
@@ -89,10 +93,6 @@ public class LibVlcPlayerModule: Module {
|
|
|
89
93
|
view.autoplay = autoplay ?? true
|
|
90
94
|
}
|
|
91
95
|
|
|
92
|
-
Prop("repeat") { (view: LibVlcPlayerView, shouldRepeat: Bool?) in
|
|
93
|
-
view.shouldRepeat = shouldRepeat ?? false
|
|
94
|
-
}
|
|
95
|
-
|
|
96
96
|
OnViewDidUpdateProps { (view: LibVlcPlayerView) in
|
|
97
97
|
view.createPlayer()
|
|
98
98
|
}
|
|
@@ -335,6 +335,15 @@ class LibVlcPlayerView: ExpoView {
|
|
|
335
335
|
}
|
|
336
336
|
}
|
|
337
337
|
|
|
338
|
+
var shouldRepeat: Bool = false {
|
|
339
|
+
didSet {
|
|
340
|
+
if options.hasRepeatOption() {
|
|
341
|
+
let error = ["error": "Repeat enabled via options"]
|
|
342
|
+
onEncounteredError(error)
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
338
347
|
var playInBackground: Bool = false {
|
|
339
348
|
didSet {
|
|
340
349
|
MediaPlayerManager.shared.setAppropriateAudioSession()
|
|
@@ -351,15 +360,6 @@ class LibVlcPlayerView: ExpoView {
|
|
|
351
360
|
}
|
|
352
361
|
}
|
|
353
362
|
|
|
354
|
-
var shouldRepeat: Bool = false {
|
|
355
|
-
didSet {
|
|
356
|
-
if options.hasRepeatOption() {
|
|
357
|
-
let error = ["error": "Repeat enabled via options"]
|
|
358
|
-
onEncounteredError(error)
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
|
|
363
363
|
func play() {
|
|
364
364
|
if let player = mediaPlayer {
|
|
365
365
|
if options.hasStartPausedOption() {
|
package/package.json
CHANGED
|
@@ -57,6 +57,16 @@ export interface Slave {
|
|
|
57
57
|
selected?: boolean;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
export type AudioMixingMode =
|
|
61
|
+
| "mixWithOthers"
|
|
62
|
+
| "duckOthers"
|
|
63
|
+
| "auto"
|
|
64
|
+
| "doNotMix";
|
|
65
|
+
|
|
66
|
+
export interface NativeEvent<T> {
|
|
67
|
+
nativeEvent: T;
|
|
68
|
+
}
|
|
69
|
+
|
|
60
70
|
export interface Track {
|
|
61
71
|
id: number;
|
|
62
72
|
name: string;
|
|
@@ -76,14 +86,12 @@ export interface MediaInfo {
|
|
|
76
86
|
tracks: MediaTracks;
|
|
77
87
|
}
|
|
78
88
|
|
|
79
|
-
export
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
export interface NativeEvent<T> {
|
|
86
|
-
nativeEvent: T;
|
|
89
|
+
export interface QuestionDialog {
|
|
90
|
+
title: string;
|
|
91
|
+
text: string;
|
|
92
|
+
cancelText?: string;
|
|
93
|
+
action1Text?: string;
|
|
94
|
+
action2Text?: string;
|
|
87
95
|
}
|
|
88
96
|
|
|
89
97
|
/**
|
|
@@ -135,14 +143,6 @@ type ESAddedListener = (event: NativeEvent<MediaTracks>) => void;
|
|
|
135
143
|
*/
|
|
136
144
|
type DialogDisplayListener = (event: NativeEvent<QuestionDialog>) => void;
|
|
137
145
|
|
|
138
|
-
export interface QuestionDialog {
|
|
139
|
-
title: string;
|
|
140
|
-
text: string;
|
|
141
|
-
cancelText?: string;
|
|
142
|
-
action1Text?: string;
|
|
143
|
-
action2Text?: string;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
146
|
/**
|
|
147
147
|
* @hidden
|
|
148
148
|
*/
|
|
@@ -169,9 +169,9 @@ export interface LibVlcPlayerViewNativeProps {
|
|
|
169
169
|
volume?: number;
|
|
170
170
|
mute?: boolean;
|
|
171
171
|
audioMixingMode?: AudioMixingMode;
|
|
172
|
+
repeat?: boolean;
|
|
172
173
|
playInBackground?: boolean;
|
|
173
174
|
autoplay?: boolean;
|
|
174
|
-
repeat?: boolean;
|
|
175
175
|
onBuffering?: BufferingListener;
|
|
176
176
|
onPlaying?: PlayingListener;
|
|
177
177
|
onPaused?: PausedListener;
|
|
@@ -281,7 +281,13 @@ export interface LibVlcPlayerViewProps extends ViewProps {
|
|
|
281
281
|
*/
|
|
282
282
|
audioMixingMode?: AudioMixingMode;
|
|
283
283
|
/**
|
|
284
|
-
* Determines whether the media should
|
|
284
|
+
* Determines whether the media should repeat once ended
|
|
285
|
+
*
|
|
286
|
+
* @default false
|
|
287
|
+
*/
|
|
288
|
+
repeat?: boolean;
|
|
289
|
+
/**
|
|
290
|
+
* Determines whether the media should continue playing in the background
|
|
285
291
|
*
|
|
286
292
|
* @default false
|
|
287
293
|
*/
|
|
@@ -292,12 +298,6 @@ export interface LibVlcPlayerViewProps extends ViewProps {
|
|
|
292
298
|
* @default true
|
|
293
299
|
*/
|
|
294
300
|
autoplay?: boolean;
|
|
295
|
-
/**
|
|
296
|
-
* Determines whether the media should repeat once ended
|
|
297
|
-
*
|
|
298
|
-
* @default false
|
|
299
|
-
*/
|
|
300
|
-
repeat?: boolean;
|
|
301
301
|
/**
|
|
302
302
|
* Called after the `Buffering` player event
|
|
303
303
|
*/
|
package/src/LibVlcPlayerView.tsx
CHANGED
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
type Error,
|
|
10
10
|
type Position,
|
|
11
11
|
type MediaTracks,
|
|
12
|
-
type QuestionDialog,
|
|
13
12
|
type MediaInfo,
|
|
13
|
+
type QuestionDialog,
|
|
14
14
|
} from "./LibVlcPlayer.types";
|
|
15
15
|
import { parseSource } from "./utils/assets";
|
|
16
16
|
import { convertNativeProps } from "./utils/props";
|