expo-libvlc-player 6.1.18 → 6.2.1
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 +17 -15
- package/android/src/main/java/expo/modules/libvlcplayer/LibVlcPlayerModule.kt +4 -0
- package/android/src/main/java/expo/modules/libvlcplayer/LibVlcPlayerView.kt +18 -0
- package/android/src/main/java/expo/modules/libvlcplayer/records/Dialog.kt +1 -0
- package/build/LibVlcPlayer.types.d.ts +11 -0
- package/build/LibVlcPlayer.types.d.ts.map +1 -1
- package/build/LibVlcPlayer.types.js.map +1 -1
- package/build/LibVlcPlayerView.d.ts.map +1 -1
- package/build/LibVlcPlayerView.js +2 -2
- package/build/LibVlcPlayerView.js.map +1 -1
- package/build/utils/aspect.d.ts.map +1 -1
- package/build/utils/aspect.js.map +1 -1
- package/expo-module.config.json +4 -11
- package/ios/LibVlcPlayerModule.swift +4 -0
- package/ios/LibVlcPlayerView.swift +12 -2
- package/ios/Records/Dialog.swift +3 -0
- package/package.json +6 -4
- package/plugin/src/withExpoLibVlcPlayer.ts +3 -6
- package/src/LibVlcPlayer.types.ts +12 -5
- package/src/LibVlcPlayerView.tsx +99 -101
- package/src/utils/aspect.ts +1 -3
- package/tsconfig.json +1 -2
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
<i>Screenshots taken from the <a href="example/App.tsx">Example App</a> on Android and iOS</i>
|
|
20
20
|
</p>
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
### Supported versions
|
|
23
23
|
|
|
24
24
|
| Platform | Version |
|
|
25
25
|
| -------------------- | ------- |
|
|
@@ -120,18 +120,19 @@ See the [Example App](example/App.tsx) for additional usage.
|
|
|
120
120
|
|
|
121
121
|
### View methods
|
|
122
122
|
|
|
123
|
-
| Method
|
|
124
|
-
|
|
|
125
|
-
| `play()`
|
|
126
|
-
| `pause()`
|
|
127
|
-
| `stop()`
|
|
128
|
-
| `seek(value: number, type?: "time" \| "position")`
|
|
129
|
-
| `record(path?: string)`
|
|
130
|
-
| `snapshot(path: string)`
|
|
131
|
-
| `postAction(action: number)`
|
|
132
|
-
| `
|
|
133
|
-
| `
|
|
134
|
-
| `
|
|
123
|
+
| Method | Description | Returns |
|
|
124
|
+
| ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | --------------- |
|
|
125
|
+
| `play()` | Starts playback of the current player | `Promise<void>` |
|
|
126
|
+
| `pause()` | Pauses playback of the current player | `Promise<void>` |
|
|
127
|
+
| `stop()` | Stops playback of the current player | `Promise<void>` |
|
|
128
|
+
| `seek(value: number, type?: "time" \| "position")` | Sets the time or position of the current player. Must be a number equal or greater than `0`, type defaults to `"time"` | `Promise<void>` |
|
|
129
|
+
| `record(path?: string)` | Starts or stops recording the current media. Must be a valid directory path string or `undefined` to stop recording | `Promise<void>` |
|
|
130
|
+
| `snapshot(path: string)` | Takes a snapshot of the current media. Must be a valid directory path string | `Promise<void>` |
|
|
131
|
+
| `postAction(action: number)` | Posts an answer to a [`Dialog`](#dialog). Must be an integer of `1` or `2` | `Promise<void>` |
|
|
132
|
+
| `postLogin(username: string, password: string, store?: boolean)` | Posts a username and password to a login [`Dialog`](#dialog). Username can't be empty, password can be empty and if `true`, store the credentials | `Promise<void>` |
|
|
133
|
+
| `dismiss()` | Dismisses a [`Dialog`](#dialog) | `Promise<void>` |
|
|
134
|
+
| `startPictureInPicture()` | Enters Picture-in-Picture (PiP) mode. Config plugin has to be configured for Picture-in-Picture (PiP) to work | `Promise<void>` |
|
|
135
|
+
| `stopPictureInPicture()` | Exits Picture-in-Picture (PiP) mode on iOS | `Promise<void>` |
|
|
135
136
|
|
|
136
137
|
### View props
|
|
137
138
|
|
|
@@ -141,8 +142,8 @@ The `LibVlcPlayerView` extends React Native `ViewProps` and implements the follo
|
|
|
141
142
|
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------- | ----------- |
|
|
142
143
|
| `source` | Sets the source of the media to be played. Set to `null` to release the player | |
|
|
143
144
|
| `options` | Sets the VLC options to initialize the player with. See the [VLC Wiki](https://wiki.videolan.org/VLC_command-line_help/) for more | `[]` |
|
|
144
|
-
| `tracks` | Sets the player audio, video and subtitle tracks. See [`Tracks`](#tracks) for more
|
|
145
|
-
| `slaves` | Sets the player audio and subtitle slaves. See [`Slave`](#slave) for more
|
|
145
|
+
| `tracks` | Sets the player audio, video and subtitle tracks. See [`Tracks`](#tracks) for more | `undefined` |
|
|
146
|
+
| `slaves` | Sets the player audio and subtitle slaves. See [`Slave`](#slave) for more | `[]` |
|
|
146
147
|
| `scale` | Sets the player scaling factor. Must be a float equal or greater than `0` | `0` |
|
|
147
148
|
| `aspectRatio` | Sets the container aspect ratio. Must be a valid ratio string, number or `"auto"` | `undefined` |
|
|
148
149
|
| `contentFit` | Sets how the video should be scaled to fit in the container | `"contain"` |
|
|
@@ -204,6 +205,7 @@ The `LibVlcPlayerView` extends React Native `ViewProps` and implements the follo
|
|
|
204
205
|
{
|
|
205
206
|
title: string;
|
|
206
207
|
text: string;
|
|
208
|
+
type: "error" | "login" | "question";
|
|
207
209
|
cancelText?: string;
|
|
208
210
|
action1Text?: string;
|
|
209
211
|
action2Text?: string;
|
|
@@ -161,6 +161,10 @@ class LibVlcPlayerModule : Module() {
|
|
|
161
161
|
view.postAction(action)
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
+
AsyncFunction("postLogin") { view: LibVlcPlayerView, username: String, password: String, store: Boolean? ->
|
|
165
|
+
view.postLogin(username, password, store)
|
|
166
|
+
}
|
|
167
|
+
|
|
164
168
|
AsyncFunction("dismiss") { view: LibVlcPlayerView ->
|
|
165
169
|
view.dismiss()
|
|
166
170
|
}
|
|
@@ -695,6 +695,21 @@ class LibVlcPlayerView(
|
|
|
695
695
|
}
|
|
696
696
|
}
|
|
697
697
|
|
|
698
|
+
fun postLogin(
|
|
699
|
+
username: String,
|
|
700
|
+
password: String,
|
|
701
|
+
store: Boolean? = false,
|
|
702
|
+
) {
|
|
703
|
+
vlcDialog?.let { dialog ->
|
|
704
|
+
when (dialog) {
|
|
705
|
+
is VLCDialog.LoginDialog -> {
|
|
706
|
+
dialog.postLogin(username, password, store ?: false)
|
|
707
|
+
vlcDialog = null
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
|
|
698
713
|
fun dismiss() {
|
|
699
714
|
vlcDialog?.let { dialog ->
|
|
700
715
|
dialog.dismiss()
|
|
@@ -854,6 +869,7 @@ fun LibVlcPlayerView.setDialogCallbacks(ILibVLC: LibVLC?) {
|
|
|
854
869
|
Dialog(
|
|
855
870
|
title = dialog.getTitle(),
|
|
856
871
|
text = dialog.getText(),
|
|
872
|
+
type = "error",
|
|
857
873
|
)
|
|
858
874
|
|
|
859
875
|
onDialogDisplay(dialog)
|
|
@@ -866,6 +882,7 @@ fun LibVlcPlayerView.setDialogCallbacks(ILibVLC: LibVLC?) {
|
|
|
866
882
|
Dialog(
|
|
867
883
|
title = dialog.getTitle(),
|
|
868
884
|
text = dialog.getText(),
|
|
885
|
+
type = "login",
|
|
869
886
|
)
|
|
870
887
|
|
|
871
888
|
onDialogDisplay(dialog)
|
|
@@ -878,6 +895,7 @@ fun LibVlcPlayerView.setDialogCallbacks(ILibVLC: LibVLC?) {
|
|
|
878
895
|
Dialog(
|
|
879
896
|
title = dialog.getTitle(),
|
|
880
897
|
text = dialog.getText(),
|
|
898
|
+
type = "question",
|
|
881
899
|
cancelText = dialog.getCancelText(),
|
|
882
900
|
action1Text = dialog.getAction1Text(),
|
|
883
901
|
action2Text = dialog.getAction2Text(),
|
|
@@ -52,6 +52,16 @@ export interface LibVlcPlayerViewRef {
|
|
|
52
52
|
* @returns A promise which resolves to `void`
|
|
53
53
|
*/
|
|
54
54
|
readonly postAction: (action: 1 | 2) => Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Posts a username and password to a login `Dialog`
|
|
57
|
+
*
|
|
58
|
+
* @param username - Must be a valid username, can't be empty
|
|
59
|
+
* @param password - Must be a valid password, can be empty
|
|
60
|
+
* @param store - If `true`, store the credentials
|
|
61
|
+
*
|
|
62
|
+
* @returns A promise which resolves to `void`
|
|
63
|
+
*/
|
|
64
|
+
readonly postLogin: (username: string, password: string, store?: boolean) => Promise<void>;
|
|
55
65
|
/**
|
|
56
66
|
* Dismisses a `Dialog`
|
|
57
67
|
*
|
|
@@ -99,6 +109,7 @@ export type LibVlcEvent<T> = Omit<T & NativeEventProps, "target">;
|
|
|
99
109
|
export interface Dialog {
|
|
100
110
|
title: string;
|
|
101
111
|
text: string;
|
|
112
|
+
type: "error" | "login" | "question";
|
|
102
113
|
cancelText?: string;
|
|
103
114
|
action1Text?: string;
|
|
104
115
|
action2Text?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LibVlcPlayer.types.d.ts","sourceRoot":"","sources":["../src/LibVlcPlayer.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG9C,MAAM,MAAM,wBAAwB,GAAG,EAAE,CAAC;AAE1C,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC;;;;;;;OAOG;IACH,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5E;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAClD;;;;;;OAMG;I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AC;IAC1B;;OAEG;IACH,uBAAuB,CAAC,EAAE,MAAM,IAAI,CAAC;IACrC;;OAEG;IACH,sBAAsB,CAAC,EAAE,MAAM,IAAI,CAAC;CACrC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LibVlcPlayer.types.js","sourceRoot":"","sources":["../src/LibVlcPlayer.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ViewProps } from \"react-native\";\n\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport type LibVlcPlayerModuleEvents = {};\n\nexport interface LibVlcPlayerViewRef {\n /**\n * Starts playback of the current player\n *\n * @returns A promise which resolves to `void`\n */\n readonly play: () => Promise<void>;\n /**\n * Pauses playback of the current player\n *\n * @returns A promise which resolves to `void`\n */\n readonly pause: () => Promise<void>;\n /**\n * Stops playback of the current player\n *\n * @returns A promise which resolves to `void`\n */\n readonly stop: () => Promise<void>;\n /**\n * Sets the time or position of the current player\n *\n * @param value - Must be a number equal or greater than `0`\n * @param type - Defaults to `\"time\"`\n *\n * @returns A promise which resolves to `void`\n */\n readonly seek: (value: number, type?: \"time\" | \"position\") => Promise<void>;\n /**\n * Starts or stops recording the current media\n *\n * @param path - Must be a valid directory path string or `undefined` to stop recording\n *\n * @returns A promise which resolves to `void`\n */\n readonly record: (path?: string) => Promise<void>;\n /**\n * Takes a snapshot of the current media\n *\n * @param path - Must be a valid directory path string\n *\n * @returns A promise which resolves to `void`\n */\n readonly snapshot: (path: string) => Promise<void>;\n /**\n * Posts an answer to a `Dialog`\n *\n * @param action - Must be an integer of `1` or `2`\n *\n * @returns A promise which resolves to `void`\n */\n readonly postAction: (action: 1 | 2) => Promise<void>;\n /**\n * Dismisses a `Dialog`\n *\n * @returns A promise which resolves to `void`\n */\n readonly dismiss: () => Promise<void>;\n /**\n * Enters Picture-in-Picture (PiP) mode\n *\n * @note Config plugin has to be configured for Picture-in-Picture (PiP) to work\n *\n * @returns A promise which resolves to `void`\n */\n readonly startPictureInPicture: () => Promise<void>;\n /**\n * Exits Picture-in-Picture (PiP) mode\n *\n * @platform ios\n *\n * @returns A promise which resolves to `void`\n */\n readonly stopPictureInPicture: () => Promise<void>;\n}\n\nexport type LibVlcSource = string | number | null;\n\nexport interface Tracks {\n audio?: number;\n video?: number;\n subtitle?: number;\n}\n\nexport interface Slave {\n source: NonNullable<LibVlcSource>;\n type: \"audio\" | \"subtitle\";\n selected?: boolean;\n}\n\nexport type VideoAspectRatio = \"auto\" | string | number;\n\nexport type VideoContentFit = \"contain\" | \"cover\" | \"fill\";\n\nexport type AudioMixingMode =\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}\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\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 */\ntype PictureInPictureStartListener = () => void;\n\n/**\n * @hidden\n */\ntype PictureInPictureStopListener = () => void;\n\n/**\n * @hidden\n */\nexport interface LibVlcPlayerViewNativeProps extends ViewProps {\n ref?: React.Ref<LibVlcPlayerViewRef>;\n source?: LibVlcSource;\n options?: string[];\n tracks?: Tracks;\n slaves?: Slave[];\n scale?: number;\n aspectRatio?: VideoAspectRatio;\n contentFit?: VideoContentFit;\n rate?: number;\n time?: number;\n volume?: number;\n mute?: boolean;\n audioMixingMode?: AudioMixingMode;\n repeat?: boolean;\n autoplay?: boolean;\n pictureInPicture?: boolean;\n onBuffering?: BufferingListener;\n onPlaying?: PlayingListener;\n onPaused?: PausedListener;\n onStopped?: StoppedListener;\n onEncounteredError?: EncounteredErrorListener;\n onDialogDisplay?: DialogDisplayListener;\n onTimeChanged?: TimeChangedListener;\n onPositionChanged?: PositionChangedListener;\n onESAdded?: ESAddedListener;\n onRecordChanged?: RecordChangedListener;\n onSnapshotTaken?: SnapshotTakenListener;\n onFirstPlay?: FirstPlayListener;\n onForeground?: ForegroundListener;\n onBackground?: BackgroundListener;\n onPictureInPictureStart?: PictureInPictureStartListener;\n onPictureInPictureStop?: PictureInPictureStopListener;\n}\n\nexport interface LibVlcPlayerViewProps extends ViewProps {\n /**\n * Sets the source of the media to be played. Set to `null` to release the player\n *\n * @example\n *\n * ```tsx\n * const BIG_BUCK_BUNNY =\n * \"https://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_720p_h264.mov\";\n *\n * <LibVlcPlayerView source={BIG_BUCK_BUNNY} />\n * ```\n */\n source: LibVlcSource;\n /**\n * Sets the VLC options to initialize the player with\n *\n * https://wiki.videolan.org/VLC_command-line_help/\n *\n * @example\n *\n * ```tsx\n * const options = [\"--network-caching=1000\"];\n *\n * <LibVlcPlayerView\n * source={BIG_BUCK_BUNNY}\n * options={options}\n * />\n * ```\n *\n * @default []\n */\n options?: string[];\n /**\n * Sets the player audio, video and subtitle tracks\n *\n * @example\n *\n * ```tsx\n * const tracks = {\n * audio: 3,\n * video: 2,\n * subtitle: 1,\n * };\n *\n * <LibVlcPlayerView\n * source={BIG_BUCK_BUNNY}\n * tracks={tracks}\n * />\n * ```\n *\n * @default undefined\n */\n tracks?: Tracks;\n /**\n * Sets the player audio and subtitle slaves\n *\n * @example\n *\n * ```tsx\n * const subtitles = [{\n * source: \"file://path/to/subtitle.srt\",\n * type: \"subtitle\",\n * selected: true,\n * }];\n *\n * <LibVlcPlayerView\n * source={BIG_BUCK_BUNNY}\n * slaves={subtitles}\n * />\n * ```\n *\n * @default []\n */\n slaves?: Slave[];\n /**\n * Sets the player scaling factor. Must be a float equal or greater than `0`\n *\n * @default 0\n */\n scale?: number;\n /**\n * Sets the container aspect ratio. Must be a valid ratio string or number\n *\n * @example \"16:9\"\n *\n * @default undefined\n */\n aspectRatio?: VideoAspectRatio;\n /**\n * Sets how the video should be scaled to fit in the container\n *\n * @example \"cover\"\n *\n * @default \"contain\"\n */\n contentFit?: VideoContentFit;\n /**\n * Sets the player rate. Must be a float equal or greater than `1`\n *\n * @default 1\n */\n rate?: number;\n /**\n * Sets the initial player time. Must be an integer in milliseconds\n *\n * @default 0\n */\n time?: number;\n /**\n * Sets the player volume. Must be an integer between `0` and `100`\n *\n * @default 100\n */\n volume?: number;\n /**\n * Sets the player volume to `0` when `true`. Previous value is set when `false`\n *\n * @default false\n */\n mute?: boolean;\n /**\n * Determines how the player will interact with other audio playing in the system\n *\n * @example \"doNotMix\"\n *\n * @default \"auto\"\n */\n audioMixingMode?: AudioMixingMode;\n /**\n * Determines whether the media should repeat once ended\n *\n * @default false\n */\n repeat?: boolean;\n /**\n * Determines whether the media should autoplay once created\n *\n * @default true\n */\n autoplay?: boolean;\n /**\n * Determines whether the player should allow Picture-in-Picture (PiP) mode\n *\n * @default false\n */\n pictureInPicture?: boolean;\n /**\n * Called after the `Buffering` player event\n */\n onBuffering?: () => void;\n /**\n * Called after the `Playing` player event\n */\n onPlaying?: () => void;\n /**\n * Called after the `Paused` player event\n */\n onPaused?: () => void;\n /**\n * Called after the `Stopped` player event\n */\n onStopped?: () => void;\n /**\n * Called after the `EncounteredError` player event\n */\n onEncounteredError?: (event: Error) => void;\n /**\n * Called after a `Dialog` needs to be displayed\n */\n onDialogDisplay?: (event: Dialog) => void;\n /**\n * Called after the `TimeChanged` player event\n */\n onTimeChanged?: (event: Time) => void;\n /**\n * Called after the `PositionChanged` player event\n */\n onPositionChanged?: (event: Position) => void;\n /**\n * Called after the `ESAdded` player event\n */\n onESAdded?: (event: MediaTracks) => void;\n /**\n * Called after the `RecordChanged` player event\n */\n onRecordChanged?: (event: Recording) => void;\n /**\n * Called after a media snapshot is taken\n */\n onSnapshotTaken?: (event: Snapshot) => void;\n /**\n * Called after the player first playing event\n */\n onFirstPlay?: (event: MediaInfo) => void;\n /**\n * Called after the player enters the foreground\n */\n onForeground?: () => void;\n /**\n * Called after the player enters the background\n */\n onBackground?: () => void;\n /**\n * Called after the player enters Picture-in-Picture (PiP) mode\n */\n onPictureInPictureStart?: () => void;\n /**\n * Called after the player exits Picture-in-Picture (PiP) mode\n */\n onPictureInPictureStop?: () => void;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"LibVlcPlayer.types.js","sourceRoot":"","sources":["../src/LibVlcPlayer.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ViewProps } from \"react-native\";\n\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport type LibVlcPlayerModuleEvents = {};\n\nexport interface LibVlcPlayerViewRef {\n /**\n * Starts playback of the current player\n *\n * @returns A promise which resolves to `void`\n */\n readonly play: () => Promise<void>;\n /**\n * Pauses playback of the current player\n *\n * @returns A promise which resolves to `void`\n */\n readonly pause: () => Promise<void>;\n /**\n * Stops playback of the current player\n *\n * @returns A promise which resolves to `void`\n */\n readonly stop: () => Promise<void>;\n /**\n * Sets the time or position of the current player\n *\n * @param value - Must be a number equal or greater than `0`\n * @param type - Defaults to `\"time\"`\n *\n * @returns A promise which resolves to `void`\n */\n readonly seek: (value: number, type?: \"time\" | \"position\") => Promise<void>;\n /**\n * Starts or stops recording the current media\n *\n * @param path - Must be a valid directory path string or `undefined` to stop recording\n *\n * @returns A promise which resolves to `void`\n */\n readonly record: (path?: string) => Promise<void>;\n /**\n * Takes a snapshot of the current media\n *\n * @param path - Must be a valid directory path string\n *\n * @returns A promise which resolves to `void`\n */\n readonly snapshot: (path: string) => Promise<void>;\n /**\n * Posts an answer to a `Dialog`\n *\n * @param action - Must be an integer of `1` or `2`\n *\n * @returns A promise which resolves to `void`\n */\n readonly postAction: (action: 1 | 2) => Promise<void>;\n /**\n * Posts a username and password to a login `Dialog`\n *\n * @param username - Must be a valid username, can't be empty\n * @param password - Must be a valid password, can be empty\n * @param store - If `true`, store the credentials\n *\n * @returns A promise which resolves to `void`\n */\n readonly postLogin: (username: string, password: string, store?: boolean) => Promise<void>;\n /**\n * Dismisses a `Dialog`\n *\n * @returns A promise which resolves to `void`\n */\n readonly dismiss: () => Promise<void>;\n /**\n * Enters Picture-in-Picture (PiP) mode\n *\n * @note Config plugin has to be configured for Picture-in-Picture (PiP) to work\n *\n * @returns A promise which resolves to `void`\n */\n readonly startPictureInPicture: () => Promise<void>;\n /**\n * Exits Picture-in-Picture (PiP) mode\n *\n * @platform ios\n *\n * @returns A promise which resolves to `void`\n */\n readonly stopPictureInPicture: () => Promise<void>;\n}\n\nexport type LibVlcSource = string | number | null;\n\nexport interface Tracks {\n audio?: number;\n video?: number;\n subtitle?: number;\n}\n\nexport interface Slave {\n source: NonNullable<LibVlcSource>;\n type: \"audio\" | \"subtitle\";\n selected?: boolean;\n}\n\nexport type VideoAspectRatio = \"auto\" | string | number;\n\nexport type VideoContentFit = \"contain\" | \"cover\" | \"fill\";\n\nexport type AudioMixingMode = \"mixWithOthers\" | \"duckOthers\" | \"auto\" | \"doNotMix\";\n\nexport interface NativeEventProps {\n target: number;\n}\n\nexport interface NativeEvent<T> {\n nativeEvent: T & NativeEventProps;\n}\n\nexport type LibVlcEvent<T> = Omit<T & NativeEventProps, \"target\">;\n\nexport 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\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 */\ntype PictureInPictureStartListener = () => void;\n\n/**\n * @hidden\n */\ntype PictureInPictureStopListener = () => void;\n\n/**\n * @hidden\n */\nexport interface LibVlcPlayerViewNativeProps extends ViewProps {\n ref?: React.Ref<LibVlcPlayerViewRef>;\n source?: LibVlcSource;\n options?: string[];\n tracks?: Tracks;\n slaves?: Slave[];\n scale?: number;\n aspectRatio?: VideoAspectRatio;\n contentFit?: VideoContentFit;\n rate?: number;\n time?: number;\n volume?: number;\n mute?: boolean;\n audioMixingMode?: AudioMixingMode;\n repeat?: boolean;\n autoplay?: boolean;\n pictureInPicture?: boolean;\n onBuffering?: BufferingListener;\n onPlaying?: PlayingListener;\n onPaused?: PausedListener;\n onStopped?: StoppedListener;\n onEncounteredError?: EncounteredErrorListener;\n onDialogDisplay?: DialogDisplayListener;\n onTimeChanged?: TimeChangedListener;\n onPositionChanged?: PositionChangedListener;\n onESAdded?: ESAddedListener;\n onRecordChanged?: RecordChangedListener;\n onSnapshotTaken?: SnapshotTakenListener;\n onFirstPlay?: FirstPlayListener;\n onForeground?: ForegroundListener;\n onBackground?: BackgroundListener;\n onPictureInPictureStart?: PictureInPictureStartListener;\n onPictureInPictureStop?: PictureInPictureStopListener;\n}\n\nexport interface LibVlcPlayerViewProps extends ViewProps {\n /**\n * Sets the source of the media to be played. Set to `null` to release the player\n *\n * @example\n *\n * ```tsx\n * const BIG_BUCK_BUNNY =\n * \"https://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_720p_h264.mov\";\n *\n * <LibVlcPlayerView source={BIG_BUCK_BUNNY} />\n * ```\n */\n source: LibVlcSource;\n /**\n * Sets the VLC options to initialize the player with\n *\n * https://wiki.videolan.org/VLC_command-line_help/\n *\n * @example\n *\n * ```tsx\n * const options = [\"--network-caching=1000\"];\n *\n * <LibVlcPlayerView\n * source={BIG_BUCK_BUNNY}\n * options={options}\n * />\n * ```\n *\n * @default []\n */\n options?: string[];\n /**\n * Sets the player audio, video and subtitle tracks\n *\n * @example\n *\n * ```tsx\n * const tracks = {\n * audio: 3,\n * video: 2,\n * subtitle: 1,\n * };\n *\n * <LibVlcPlayerView\n * source={BIG_BUCK_BUNNY}\n * tracks={tracks}\n * />\n * ```\n *\n * @default undefined\n */\n tracks?: Tracks;\n /**\n * Sets the player audio and subtitle slaves\n *\n * @example\n *\n * ```tsx\n * const subtitles = [{\n * source: \"file://path/to/subtitle.srt\",\n * type: \"subtitle\",\n * selected: true,\n * }];\n *\n * <LibVlcPlayerView\n * source={BIG_BUCK_BUNNY}\n * slaves={subtitles}\n * />\n * ```\n *\n * @default []\n */\n slaves?: Slave[];\n /**\n * Sets the player scaling factor. Must be a float equal or greater than `0`\n *\n * @default 0\n */\n scale?: number;\n /**\n * Sets the container aspect ratio. Must be a valid ratio string or number\n *\n * @example \"16:9\"\n *\n * @default undefined\n */\n aspectRatio?: VideoAspectRatio;\n /**\n * Sets how the video should be scaled to fit in the container\n *\n * @example \"cover\"\n *\n * @default \"contain\"\n */\n contentFit?: VideoContentFit;\n /**\n * Sets the player rate. Must be a float equal or greater than `1`\n *\n * @default 1\n */\n rate?: number;\n /**\n * Sets the initial player time. Must be an integer in milliseconds\n *\n * @default 0\n */\n time?: number;\n /**\n * Sets the player volume. Must be an integer between `0` and `100`\n *\n * @default 100\n */\n volume?: number;\n /**\n * Sets the player volume to `0` when `true`. Previous value is set when `false`\n *\n * @default false\n */\n mute?: boolean;\n /**\n * Determines how the player will interact with other audio playing in the system\n *\n * @example \"doNotMix\"\n *\n * @default \"auto\"\n */\n audioMixingMode?: AudioMixingMode;\n /**\n * Determines whether the media should repeat once ended\n *\n * @default false\n */\n repeat?: boolean;\n /**\n * Determines whether the media should autoplay once created\n *\n * @default true\n */\n autoplay?: boolean;\n /**\n * Determines whether the player should allow Picture-in-Picture (PiP) mode\n *\n * @default false\n */\n pictureInPicture?: boolean;\n /**\n * Called after the `Buffering` player event\n */\n onBuffering?: () => void;\n /**\n * Called after the `Playing` player event\n */\n onPlaying?: () => void;\n /**\n * Called after the `Paused` player event\n */\n onPaused?: () => void;\n /**\n * Called after the `Stopped` player event\n */\n onStopped?: () => void;\n /**\n * Called after the `EncounteredError` player event\n */\n onEncounteredError?: (event: Error) => void;\n /**\n * Called after a `Dialog` needs to be displayed\n */\n onDialogDisplay?: (event: Dialog) => void;\n /**\n * Called after the `TimeChanged` player event\n */\n onTimeChanged?: (event: Time) => void;\n /**\n * Called after the `PositionChanged` player event\n */\n onPositionChanged?: (event: Position) => void;\n /**\n * Called after the `ESAdded` player event\n */\n onESAdded?: (event: MediaTracks) => void;\n /**\n * Called after the `RecordChanged` player event\n */\n onRecordChanged?: (event: Recording) => void;\n /**\n * Called after a media snapshot is taken\n */\n onSnapshotTaken?: (event: Snapshot) => void;\n /**\n * Called after the player first playing event\n */\n onFirstPlay?: (event: MediaInfo) => void;\n /**\n * Called after the player enters the foreground\n */\n onForeground?: () => void;\n /**\n * Called after the player enters the background\n */\n onBackground?: () => void;\n /**\n * Called after the player enters Picture-in-Picture (PiP) mode\n */\n onPictureInPictureStart?: () => void;\n /**\n * Called after the player exits Picture-in-Picture (PiP) mode\n */\n onPictureInPictureStop?: () => void;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LibVlcPlayerView.d.ts","sourceRoot":"","sources":["../src/LibVlcPlayerView.tsx"],"names":[],"mappings":"AAIA,OAAO,EAEL,qBAAqB,EACrB,mBAAmB,EAWpB,MAAM,sBAAsB,CAAC;AAe9B,QAAA,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"LibVlcPlayerView.d.ts","sourceRoot":"","sources":["../src/LibVlcPlayerView.tsx"],"names":[],"mappings":"AAIA,OAAO,EAEL,qBAAqB,EACrB,mBAAmB,EAWpB,MAAM,sBAAsB,CAAC;AAe9B,QAAA,MAAM,gBAAgB,uHAqGpB,CAAC;AAEH,eAAe,gBAAgB,CAAC"}
|
|
@@ -68,11 +68,11 @@ const LibVlcPlayerView = forwardRef((props, ref) => {
|
|
|
68
68
|
const aspectRatio = propRatio === "auto" ? defaultRatio.current : propRatio;
|
|
69
69
|
const nativeRatio = convertAspectRatio(aspectRatio);
|
|
70
70
|
return (<View style={{ aspectRatio: nativeRatio }}>
|
|
71
|
-
|
|
71
|
+
<NativeView {...props} ref={ref} style={[props.style, { height: "100%" }]} source={parseNativeSource(props.source)} slaves={props.slaves?.map((slave) => ({
|
|
72
72
|
...slave,
|
|
73
73
|
source: parseNativeSource(slave.source),
|
|
74
74
|
}))} onEncounteredError={onEncounteredError} onDialogDisplay={onDialogDisplay} onTimeChanged={onTimeChanged} onPositionChanged={onPositionChanged} onESAdded={onESAdded} onRecordChanged={onRecordChanged} onSnapshotTaken={onSnapshotTaken} onFirstPlay={onFirstPlay}/>
|
|
75
|
-
|
|
75
|
+
</View>);
|
|
76
76
|
});
|
|
77
77
|
export default LibVlcPlayerView;
|
|
78
78
|
//# sourceMappingURL=LibVlcPlayerView.js.map
|
|
@@ -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,EAAE,MAAM,EAAsB,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAiBpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEpD,MAAM,UAAU,G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AC,CAAC;YACpC,GAAG,KAAK;YACR,MAAM,EAAE,iBAAiB,CAAC,KAAK,CAAC,MAAM,CAAE;SACzC,CAAC,CAAC,CAAC,CACJ,kBAAkB,CAAC,CAAC,kBAAkB,CAAC,CACvC,eAAe,CAAC,CAAC,eAAe,CAAC,CACjC,aAAa,CAAC,CAAC,aAAa,CAAC,CAC7B,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,eAAe,CAAC,CAAC,eAAe,CAAC,CACjC,eAAe,CAAC,CAAC,eAAe,CAAC,CACjC,WAAW,CAAC,CAAC,WAAW,CAAC,EAE7B;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,gBAAgB,CAAC","sourcesContent":["import { requireNativeView } from \"expo\";\nimport { forwardRef, useRef, type ComponentType } from \"react\";\nimport { View } from \"react-native\";\n\nimport {\n LibVlcPlayerViewNativeProps,\n LibVlcPlayerViewProps,\n LibVlcPlayerViewRef,\n type Dialog,\n type Error,\n type MediaInfo,\n type MediaTracks,\n type NativeEvent,\n type Position,\n type Recording,\n type Snapshot,\n type Time,\n type VideoAspectRatio,\n} from \"./LibVlcPlayer.types\";\nimport { convertAspectRatio } from \"./utils/aspect\";\nimport { parseNativeSource } from \"./utils/assets\";\nimport { convertNativeEvent } from \"./utils/events\";\n\nconst NativeView: ComponentType<LibVlcPlayerViewNativeProps> =\n requireNativeView(\"ExpoLibVlcPlayer\");\n\nconst RENDERING_CHILDREN_WARNING =\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\nlet loggedRenderingChildrenWarning: boolean = false;\n\nconst FALLBACK_RATIO = 16 / 9;\n\nconst LibVlcPlayerView = forwardRef<LibVlcPlayerViewRef, LibVlcPlayerViewProps>((props, ref) => {\n const defaultRatio = useRef<VideoAspectRatio>(FALLBACK_RATIO);\n\n if (props.children && !loggedRenderingChildrenWarning) {\n console.warn(RENDERING_CHILDREN_WARNING);\n loggedRenderingChildrenWarning = true;\n }\n\n const onEncounteredError = (event: NativeEvent<Error>) => {\n const nativeEvent = convertNativeEvent(event);\n\n if (props.onEncounteredError) {\n props.onEncounteredError(nativeEvent);\n }\n };\n\n const onDialogDisplay = (event: NativeEvent<Dialog>) => {\n const nativeEvent = convertNativeEvent(event);\n\n if (props.onDialogDisplay) {\n props.onDialogDisplay(nativeEvent);\n }\n };\n\n const onTimeChanged = (event: NativeEvent<Time>) => {\n const nativeEvent = convertNativeEvent(event);\n\n if (props.onTimeChanged) {\n props.onTimeChanged(nativeEvent);\n }\n };\n\n const onPositionChanged = (event: NativeEvent<Position>) => {\n const nativeEvent = convertNativeEvent(event);\n\n if (props.onPositionChanged) {\n props.onPositionChanged(nativeEvent);\n }\n };\n\n const onESAdded = (event: NativeEvent<MediaTracks>) => {\n const nativeEvent = convertNativeEvent(event);\n\n if (props.onESAdded) {\n props.onESAdded(nativeEvent);\n }\n };\n\n const onRecordChanged = (event: NativeEvent<Recording>) => {\n const nativeEvent = convertNativeEvent(event);\n\n if (props.onRecordChanged) {\n props.onRecordChanged(nativeEvent);\n }\n };\n\n const onSnapshotTaken = (event: NativeEvent<Snapshot>) => {\n const nativeEvent = convertNativeEvent(event);\n\n if (props.onSnapshotTaken) {\n props.onSnapshotTaken(nativeEvent);\n }\n };\n\n const onFirstPlay = (event: NativeEvent<MediaInfo>) => {\n const nativeEvent = convertNativeEvent(event);\n const mediaRatio = nativeEvent.width / nativeEvent.height;\n\n if (props.onFirstPlay) {\n props.onFirstPlay(nativeEvent);\n }\n\n defaultRatio.current = mediaRatio || FALLBACK_RATIO;\n };\n\n const propRatio = props.aspectRatio;\n const aspectRatio = propRatio === \"auto\" ? defaultRatio.current : propRatio;\n const nativeRatio = convertAspectRatio(aspectRatio);\n\n return (\n <View style={{ aspectRatio: nativeRatio }}>\n <NativeView\n {...props}\n ref={ref}\n style={[props.style, { height: \"100%\" }]}\n source={parseNativeSource(props.source)}\n slaves={props.slaves?.map((slave) => ({\n ...slave,\n source: parseNativeSource(slave.source)!,\n }))}\n onEncounteredError={onEncounteredError}\n onDialogDisplay={onDialogDisplay}\n onTimeChanged={onTimeChanged}\n onPositionChanged={onPositionChanged}\n onESAdded={onESAdded}\n onRecordChanged={onRecordChanged}\n onSnapshotTaken={onSnapshotTaken}\n onFirstPlay={onFirstPlay}\n />\n </View>\n );\n});\n\nexport default LibVlcPlayerView;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aspect.d.ts","sourceRoot":"","sources":["../../src/utils/aspect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,wBAAgB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"aspect.d.ts","sourceRoot":"","sources":["../../src/utils/aspect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,wBAAgB,kBAAkB,CAAC,KAAK,CAAC,EAAE,gBAAgB,GAAG,gBAAgB,GAAG,SAAS,CAgBzF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aspect.js","sourceRoot":"","sources":["../../src/utils/aspect.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,kBAAkB,
|
|
1
|
+
{"version":3,"file":"aspect.js","sourceRoot":"","sources":["../../src/utils/aspect.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,kBAAkB,CAAC,KAAwB;IACzD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAEjC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzB,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YAE5C,MAAM,YAAY,GAAG,KAAK,GAAG,CAAC,IAAI,MAAM,GAAG,CAAC,CAAC;YAE7C,IAAI,YAAY,EAAE,CAAC;gBACjB,OAAO,KAAK,GAAG,MAAM,CAAC;YACxB,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import { VideoAspectRatio } from \"../LibVlcPlayer.types\";\n\nexport function convertAspectRatio(ratio?: VideoAspectRatio): VideoAspectRatio | undefined {\n if (typeof ratio === \"string\") {\n const numbers = ratio.split(\":\");\n\n if (numbers.length === 2) {\n const [width, height] = numbers.map(Number);\n\n const hasVideoSize = width > 0 && height > 0;\n\n if (hasVideoSize) {\n return width / height;\n }\n }\n }\n\n return ratio;\n}\n"]}
|
package/expo-module.config.json
CHANGED
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"platforms": [
|
|
3
|
-
"apple",
|
|
4
|
-
"android"
|
|
5
|
-
],
|
|
2
|
+
"platforms": ["apple", "android"],
|
|
6
3
|
"apple": {
|
|
7
|
-
"modules": [
|
|
8
|
-
"LibVlcPlayerModule"
|
|
9
|
-
]
|
|
4
|
+
"modules": ["LibVlcPlayerModule"]
|
|
10
5
|
},
|
|
11
6
|
"android": {
|
|
12
|
-
"modules": [
|
|
13
|
-
"expo.modules.libvlcplayer.LibVlcPlayerModule"
|
|
14
|
-
]
|
|
7
|
+
"modules": ["expo.modules.libvlcplayer.LibVlcPlayerModule"]
|
|
15
8
|
}
|
|
16
|
-
}
|
|
9
|
+
}
|
|
@@ -137,6 +137,10 @@ public class LibVlcPlayerModule: Module {
|
|
|
137
137
|
view.postAction(action)
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
+
AsyncFunction("postLogin") { (view: LibVlcPlayerView, username: String, password: String, store: Bool?) in
|
|
141
|
+
view.postLogin(username, password, store)
|
|
142
|
+
}
|
|
143
|
+
|
|
140
144
|
AsyncFunction("dismiss") { (view: LibVlcPlayerView) in
|
|
141
145
|
view.dismiss()
|
|
142
146
|
}
|
|
@@ -525,6 +525,13 @@ class LibVlcPlayerView: ExpoView {
|
|
|
525
525
|
}
|
|
526
526
|
}
|
|
527
527
|
|
|
528
|
+
func postLogin(_ username: String, _ password: String, _ store: Bool? = false) {
|
|
529
|
+
if let dialog = vlcDialog, let reference = vlcDialogRef {
|
|
530
|
+
dialog.postUsername(username, andPassword: password, forDialogReference: reference, store: store ?? false)
|
|
531
|
+
vlcDialogRef = nil
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
|
|
528
535
|
func dismiss() {
|
|
529
536
|
if let dialog = vlcDialog, let reference = vlcDialogRef {
|
|
530
537
|
dialog.dismissDialog(withReference: reference)
|
|
@@ -696,7 +703,8 @@ extension LibVlcPlayerView: VLCCustomDialogRendererProtocol {
|
|
|
696
703
|
) {
|
|
697
704
|
let dialog = Dialog(
|
|
698
705
|
title: title,
|
|
699
|
-
text: message
|
|
706
|
+
text: message,
|
|
707
|
+
type: "error"
|
|
700
708
|
)
|
|
701
709
|
|
|
702
710
|
onDialogDisplay(dialog)
|
|
@@ -713,7 +721,8 @@ extension LibVlcPlayerView: VLCCustomDialogRendererProtocol {
|
|
|
713
721
|
|
|
714
722
|
let dialog = Dialog(
|
|
715
723
|
title: title,
|
|
716
|
-
text: message
|
|
724
|
+
text: message,
|
|
725
|
+
type: "login"
|
|
717
726
|
)
|
|
718
727
|
|
|
719
728
|
onDialogDisplay(dialog)
|
|
@@ -733,6 +742,7 @@ extension LibVlcPlayerView: VLCCustomDialogRendererProtocol {
|
|
|
733
742
|
let dialog = Dialog(
|
|
734
743
|
title: title,
|
|
735
744
|
text: message,
|
|
745
|
+
type: "question",
|
|
736
746
|
cancelText: cancel,
|
|
737
747
|
action1Text: action1String,
|
|
738
748
|
action2Text: action2String
|
package/ios/Records/Dialog.swift
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-libvlc-player",
|
|
3
|
-
"version": "6.1
|
|
3
|
+
"version": "6.2.1",
|
|
4
4
|
"description": "LibVLC Player for Expo",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
"build": "expo-module build",
|
|
9
9
|
"clean": "expo-module clean",
|
|
10
10
|
"lint": "expo-module lint",
|
|
11
|
-
"test": "expo-module test",
|
|
12
11
|
"prepare": "husky && expo-module prepare",
|
|
13
12
|
"prepublishOnly": "expo-module prepublishOnly",
|
|
14
13
|
"open:ios": "xed example/ios",
|
|
@@ -33,18 +32,21 @@
|
|
|
33
32
|
"author": "David Cornejo <davidcornejo1@live.com> (https://github.com/cornejobarraza)",
|
|
34
33
|
"license": "MIT",
|
|
35
34
|
"homepage": "https://github.com/cornejobarraza/expo-libvlc-player#readme",
|
|
35
|
+
"dependencies": {},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@eslint/compat": "^1.4.1",
|
|
38
38
|
"@eslint/eslintrc": "^3.3.5",
|
|
39
39
|
"@eslint/js": "^9.39.4",
|
|
40
40
|
"@types/react": "~19.2.10",
|
|
41
41
|
"eslint": "^9.39.4",
|
|
42
|
-
"expo": "~55.0.
|
|
42
|
+
"expo": "~55.0.14",
|
|
43
43
|
"expo-module-scripts": "^55.0.2",
|
|
44
44
|
"globals": "^16.5.0",
|
|
45
45
|
"husky": "^9.1.7",
|
|
46
46
|
"lint-staged": "^16.3.2",
|
|
47
|
-
"
|
|
47
|
+
"prettier": "^3.8.1",
|
|
48
|
+
"react-native": "0.83.4",
|
|
49
|
+
"typescript": "^5.9.3"
|
|
48
50
|
},
|
|
49
51
|
"peerDependencies": {
|
|
50
52
|
"expo": "*",
|
|
@@ -6,8 +6,7 @@ import {
|
|
|
6
6
|
type ConfigPlugin,
|
|
7
7
|
} from "expo/config-plugins";
|
|
8
8
|
|
|
9
|
-
const LOCAL_NETWORK_USAGE =
|
|
10
|
-
"Allow $(PRODUCT_NAME) to access your local network";
|
|
9
|
+
const LOCAL_NETWORK_USAGE = "Allow $(PRODUCT_NAME) to access your local network";
|
|
11
10
|
|
|
12
11
|
type WithExpoLibVlcPlayerOptions = {
|
|
13
12
|
localNetworkPermission?: string;
|
|
@@ -16,7 +15,7 @@ type WithExpoLibVlcPlayerOptions = {
|
|
|
16
15
|
|
|
17
16
|
const withExpoLibVlcPlayer: ConfigPlugin<WithExpoLibVlcPlayerOptions> = (
|
|
18
17
|
config,
|
|
19
|
-
{ localNetworkPermission, supportsPictureInPicture } = {}
|
|
18
|
+
{ localNetworkPermission, supportsPictureInPicture } = {}
|
|
20
19
|
) => {
|
|
21
20
|
IOSConfig.Permissions.createPermissionsPlugin({
|
|
22
21
|
NSLocalNetworkUsageDescription: LOCAL_NETWORK_USAGE,
|
|
@@ -45,9 +44,7 @@ const withExpoLibVlcPlayer: ConfigPlugin<WithExpoLibVlcPlayerOptions> = (
|
|
|
45
44
|
const needsConfigMod = typeof supportsPictureInPicture === "boolean";
|
|
46
45
|
|
|
47
46
|
if (needsConfigMod) {
|
|
48
|
-
const activity = AndroidConfig.Manifest.getMainActivityOrThrow(
|
|
49
|
-
config.modResults,
|
|
50
|
-
);
|
|
47
|
+
const activity = AndroidConfig.Manifest.getMainActivityOrThrow(config.modResults);
|
|
51
48
|
|
|
52
49
|
if (supportsPictureInPicture) {
|
|
53
50
|
activity.$["android:supportsPictureInPicture"] = "true";
|
|
@@ -55,6 +55,16 @@ export interface LibVlcPlayerViewRef {
|
|
|
55
55
|
* @returns A promise which resolves to `void`
|
|
56
56
|
*/
|
|
57
57
|
readonly postAction: (action: 1 | 2) => Promise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* Posts a username and password to a login `Dialog`
|
|
60
|
+
*
|
|
61
|
+
* @param username - Must be a valid username, can't be empty
|
|
62
|
+
* @param password - Must be a valid password, can be empty
|
|
63
|
+
* @param store - If `true`, store the credentials
|
|
64
|
+
*
|
|
65
|
+
* @returns A promise which resolves to `void`
|
|
66
|
+
*/
|
|
67
|
+
readonly postLogin: (username: string, password: string, store?: boolean) => Promise<void>;
|
|
58
68
|
/**
|
|
59
69
|
* Dismisses a `Dialog`
|
|
60
70
|
*
|
|
@@ -97,11 +107,7 @@ export type VideoAspectRatio = "auto" | string | number;
|
|
|
97
107
|
|
|
98
108
|
export type VideoContentFit = "contain" | "cover" | "fill";
|
|
99
109
|
|
|
100
|
-
export type AudioMixingMode =
|
|
101
|
-
| "mixWithOthers"
|
|
102
|
-
| "duckOthers"
|
|
103
|
-
| "auto"
|
|
104
|
-
| "doNotMix";
|
|
110
|
+
export type AudioMixingMode = "mixWithOthers" | "duckOthers" | "auto" | "doNotMix";
|
|
105
111
|
|
|
106
112
|
export interface NativeEventProps {
|
|
107
113
|
target: number;
|
|
@@ -116,6 +122,7 @@ export type LibVlcEvent<T> = Omit<T & NativeEventProps, "target">;
|
|
|
116
122
|
export interface Dialog {
|
|
117
123
|
title: string;
|
|
118
124
|
text: string;
|
|
125
|
+
type: "error" | "login" | "question";
|
|
119
126
|
cancelText?: string;
|
|
120
127
|
action1Text?: string;
|
|
121
128
|
action2Text?: string;
|
package/src/LibVlcPlayerView.tsx
CHANGED
|
@@ -31,109 +31,107 @@ let loggedRenderingChildrenWarning: boolean = false;
|
|
|
31
31
|
|
|
32
32
|
const FALLBACK_RATIO = 16 / 9;
|
|
33
33
|
|
|
34
|
-
const LibVlcPlayerView = forwardRef<LibVlcPlayerViewRef, LibVlcPlayerViewProps>(
|
|
35
|
-
|
|
36
|
-
const defaultRatio = useRef<VideoAspectRatio>(FALLBACK_RATIO);
|
|
34
|
+
const LibVlcPlayerView = forwardRef<LibVlcPlayerViewRef, LibVlcPlayerViewProps>((props, ref) => {
|
|
35
|
+
const defaultRatio = useRef<VideoAspectRatio>(FALLBACK_RATIO);
|
|
37
36
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
if (props.children && !loggedRenderingChildrenWarning) {
|
|
38
|
+
console.warn(RENDERING_CHILDREN_WARNING);
|
|
39
|
+
loggedRenderingChildrenWarning = true;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const onEncounteredError = (event: NativeEvent<Error>) => {
|
|
43
|
+
const nativeEvent = convertNativeEvent(event);
|
|
44
|
+
|
|
45
|
+
if (props.onEncounteredError) {
|
|
46
|
+
props.onEncounteredError(nativeEvent);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const onDialogDisplay = (event: NativeEvent<Dialog>) => {
|
|
51
|
+
const nativeEvent = convertNativeEvent(event);
|
|
52
|
+
|
|
53
|
+
if (props.onDialogDisplay) {
|
|
54
|
+
props.onDialogDisplay(nativeEvent);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const onTimeChanged = (event: NativeEvent<Time>) => {
|
|
59
|
+
const nativeEvent = convertNativeEvent(event);
|
|
60
|
+
|
|
61
|
+
if (props.onTimeChanged) {
|
|
62
|
+
props.onTimeChanged(nativeEvent);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const onPositionChanged = (event: NativeEvent<Position>) => {
|
|
67
|
+
const nativeEvent = convertNativeEvent(event);
|
|
68
|
+
|
|
69
|
+
if (props.onPositionChanged) {
|
|
70
|
+
props.onPositionChanged(nativeEvent);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const onESAdded = (event: NativeEvent<MediaTracks>) => {
|
|
75
|
+
const nativeEvent = convertNativeEvent(event);
|
|
76
|
+
|
|
77
|
+
if (props.onESAdded) {
|
|
78
|
+
props.onESAdded(nativeEvent);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const onRecordChanged = (event: NativeEvent<Recording>) => {
|
|
83
|
+
const nativeEvent = convertNativeEvent(event);
|
|
84
|
+
|
|
85
|
+
if (props.onRecordChanged) {
|
|
86
|
+
props.onRecordChanged(nativeEvent);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
const onSnapshotTaken = (event: NativeEvent<Snapshot>) => {
|
|
91
|
+
const nativeEvent = convertNativeEvent(event);
|
|
92
|
+
|
|
93
|
+
if (props.onSnapshotTaken) {
|
|
94
|
+
props.onSnapshotTaken(nativeEvent);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
const onFirstPlay = (event: NativeEvent<MediaInfo>) => {
|
|
99
|
+
const nativeEvent = convertNativeEvent(event);
|
|
100
|
+
const mediaRatio = nativeEvent.width / nativeEvent.height;
|
|
101
|
+
|
|
102
|
+
if (props.onFirstPlay) {
|
|
103
|
+
props.onFirstPlay(nativeEvent);
|
|
41
104
|
}
|
|
42
105
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
props.
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
const onESAdded = (event: NativeEvent<MediaTracks>) => {
|
|
76
|
-
const nativeEvent = convertNativeEvent(event);
|
|
77
|
-
|
|
78
|
-
if (props.onESAdded) {
|
|
79
|
-
props.onESAdded(nativeEvent);
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
const onRecordChanged = (event: NativeEvent<Recording>) => {
|
|
84
|
-
const nativeEvent = convertNativeEvent(event);
|
|
85
|
-
|
|
86
|
-
if (props.onRecordChanged) {
|
|
87
|
-
props.onRecordChanged(nativeEvent);
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
const onSnapshotTaken = (event: NativeEvent<Snapshot>) => {
|
|
92
|
-
const nativeEvent = convertNativeEvent(event);
|
|
93
|
-
|
|
94
|
-
if (props.onSnapshotTaken) {
|
|
95
|
-
props.onSnapshotTaken(nativeEvent);
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
const onFirstPlay = (event: NativeEvent<MediaInfo>) => {
|
|
100
|
-
const nativeEvent = convertNativeEvent(event);
|
|
101
|
-
const mediaRatio = nativeEvent.width / nativeEvent.height;
|
|
102
|
-
|
|
103
|
-
if (props.onFirstPlay) {
|
|
104
|
-
props.onFirstPlay(nativeEvent);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
defaultRatio.current = mediaRatio || FALLBACK_RATIO;
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
const propRatio = props.aspectRatio;
|
|
111
|
-
const aspectRatio = propRatio === "auto" ? defaultRatio.current : propRatio;
|
|
112
|
-
const nativeRatio = convertAspectRatio(aspectRatio);
|
|
113
|
-
|
|
114
|
-
return (
|
|
115
|
-
<View style={{ aspectRatio: nativeRatio }}>
|
|
116
|
-
<NativeView
|
|
117
|
-
{...props}
|
|
118
|
-
ref={ref}
|
|
119
|
-
style={[props.style, { height: "100%" }]}
|
|
120
|
-
source={parseNativeSource(props.source)}
|
|
121
|
-
slaves={props.slaves?.map((slave) => ({
|
|
122
|
-
...slave,
|
|
123
|
-
source: parseNativeSource(slave.source)!,
|
|
124
|
-
}))}
|
|
125
|
-
onEncounteredError={onEncounteredError}
|
|
126
|
-
onDialogDisplay={onDialogDisplay}
|
|
127
|
-
onTimeChanged={onTimeChanged}
|
|
128
|
-
onPositionChanged={onPositionChanged}
|
|
129
|
-
onESAdded={onESAdded}
|
|
130
|
-
onRecordChanged={onRecordChanged}
|
|
131
|
-
onSnapshotTaken={onSnapshotTaken}
|
|
132
|
-
onFirstPlay={onFirstPlay}
|
|
133
|
-
/>
|
|
134
|
-
</View>
|
|
135
|
-
);
|
|
136
|
-
},
|
|
137
|
-
);
|
|
106
|
+
defaultRatio.current = mediaRatio || FALLBACK_RATIO;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
const propRatio = props.aspectRatio;
|
|
110
|
+
const aspectRatio = propRatio === "auto" ? defaultRatio.current : propRatio;
|
|
111
|
+
const nativeRatio = convertAspectRatio(aspectRatio);
|
|
112
|
+
|
|
113
|
+
return (
|
|
114
|
+
<View style={{ aspectRatio: nativeRatio }}>
|
|
115
|
+
<NativeView
|
|
116
|
+
{...props}
|
|
117
|
+
ref={ref}
|
|
118
|
+
style={[props.style, { height: "100%" }]}
|
|
119
|
+
source={parseNativeSource(props.source)}
|
|
120
|
+
slaves={props.slaves?.map((slave) => ({
|
|
121
|
+
...slave,
|
|
122
|
+
source: parseNativeSource(slave.source)!,
|
|
123
|
+
}))}
|
|
124
|
+
onEncounteredError={onEncounteredError}
|
|
125
|
+
onDialogDisplay={onDialogDisplay}
|
|
126
|
+
onTimeChanged={onTimeChanged}
|
|
127
|
+
onPositionChanged={onPositionChanged}
|
|
128
|
+
onESAdded={onESAdded}
|
|
129
|
+
onRecordChanged={onRecordChanged}
|
|
130
|
+
onSnapshotTaken={onSnapshotTaken}
|
|
131
|
+
onFirstPlay={onFirstPlay}
|
|
132
|
+
/>
|
|
133
|
+
</View>
|
|
134
|
+
);
|
|
135
|
+
});
|
|
138
136
|
|
|
139
137
|
export default LibVlcPlayerView;
|
package/src/utils/aspect.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { VideoAspectRatio } from "../LibVlcPlayer.types";
|
|
2
2
|
|
|
3
|
-
export function convertAspectRatio(
|
|
4
|
-
ratio?: VideoAspectRatio,
|
|
5
|
-
): VideoAspectRatio | undefined {
|
|
3
|
+
export function convertAspectRatio(ratio?: VideoAspectRatio): VideoAspectRatio | undefined {
|
|
6
4
|
if (typeof ratio === "string") {
|
|
7
5
|
const numbers = ratio.split(":");
|
|
8
6
|
|