expo-libvlc-player 0.1.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/.eslintrc.js +2 -0
- package/README.md +107 -0
- package/android/.gradle/9.0-milestone-1/checksums/checksums.lock +0 -0
- package/android/.gradle/9.0-milestone-1/fileChanges/last-build.bin +0 -0
- package/android/.gradle/9.0-milestone-1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/9.0-milestone-1/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/config.properties +2 -0
- package/android/.gradle/ideaInitScripts/ijtgtmapper.gradle +3 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/AndroidProjectSystem.xml +6 -0
- package/android/.idea/android.iml +9 -0
- package/android/.idea/caches/deviceStreaming.xml +835 -0
- package/android/.idea/deviceManager.xml +13 -0
- package/android/.idea/gradle.xml +13 -0
- package/android/.idea/misc.xml +3 -0
- package/android/.idea/modules.xml +8 -0
- package/android/.idea/runConfigurations.xml +17 -0
- package/android/.idea/vcs.xml +6 -0
- package/android/.idea/workspace.xml +72 -0
- package/android/build.gradle +53 -0
- package/android/local.properties +8 -0
- package/android/proguard-rules.pro +19 -0
- package/android/src/main/AndroidManifest.xml +4 -0
- package/android/src/main/java/expo/modules/libvlcplayer/AudioFocusManager.kt +210 -0
- package/android/src/main/java/expo/modules/libvlcplayer/VlcPlayerManager.kt +82 -0
- package/android/src/main/java/expo/modules/libvlcplayer/VlcPlayerModule.kt +129 -0
- package/android/src/main/java/expo/modules/libvlcplayer/VlcPlayerView.kt +328 -0
- package/android/src/main/java/expo/modules/libvlcplayer/enums/AudioMixingMode.kt +20 -0
- package/app.plugin.js +1 -0
- package/build/VlcPlayer.types.d.ts +278 -0
- package/build/VlcPlayer.types.d.ts.map +1 -0
- package/build/VlcPlayer.types.js +2 -0
- package/build/VlcPlayer.types.js.map +1 -0
- package/build/VlcPlayerModule.d.ts +6 -0
- package/build/VlcPlayerModule.d.ts.map +1 -0
- package/build/VlcPlayerModule.js +4 -0
- package/build/VlcPlayerModule.js.map +1 -0
- package/build/VlcPlayerView.d.ts +5 -0
- package/build/VlcPlayerView.d.ts.map +1 -0
- package/build/VlcPlayerView.js +36 -0
- package/build/VlcPlayerView.js.map +1 -0
- package/build/index.d.ts +4 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +5 -0
- package/build/index.js.map +1 -0
- package/build/utils/props.d.ts +3 -0
- package/build/utils/props.d.ts.map +1 -0
- package/build/utils/props.js +11 -0
- package/build/utils/props.js.map +1 -0
- package/eslint.config.js +50 -0
- package/expo-module.config.json +16 -0
- package/ios/Enums/AudioMixingMode.swift +35 -0
- package/ios/ExpoLibVlcPlayer.podspec +29 -0
- package/ios/VlcPlayerManager.swift +116 -0
- package/ios/VlcPlayerModule.swift +110 -0
- package/ios/VlcPlayerView.swift +321 -0
- package/package.json +49 -0
- package/plugin/build/withExpoLibVlcPlayer.d.ts +3 -0
- package/plugin/build/withExpoLibVlcPlayer.js +18 -0
- package/plugin/src/withExpoLibVlcPlayer.ts +21 -0
- package/plugin/tsconfig.json +9 -0
- package/plugin/tsconfig.tsbuildinfo +1 -0
- package/src/VlcPlayer.types.ts +291 -0
- package/src/VlcPlayerModule.ts +7 -0
- package/src/VlcPlayerView.tsx +73 -0
- package/src/index.ts +4 -0
- package/src/utils/props.ts +20 -0
- package/tsconfig.json +9 -0
package/.eslintrc.js
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://images.videolan.org/images/VLC-IconSmall.png" alt="VLC icon">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">LibVLC Player for Expo</h1>
|
|
6
|
+
|
|
7
|
+
### Installation
|
|
8
|
+
|
|
9
|
+
Add the package to your npm dependencies
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
npm install expo-libvlc-player
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Bare React Native projects
|
|
16
|
+
|
|
17
|
+
For bare React Native projects, you must ensure that you have [installed and configured](https://docs.expo.dev/bare/installing-expo-modules/) the `expo` package before continuing.
|
|
18
|
+
|
|
19
|
+
### Configure for Android
|
|
20
|
+
|
|
21
|
+
No additional configuration necessary.
|
|
22
|
+
|
|
23
|
+
### Configure for iOS
|
|
24
|
+
|
|
25
|
+
Run `npx pod-install` after installing the npm package.
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
import { VLCPLayerView } from "expo-libvlc-player";
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<View styles={{ height: 576 }}>
|
|
34
|
+
<VLCPlayerView
|
|
35
|
+
style={{ height: "100%" }}
|
|
36
|
+
uri="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"
|
|
37
|
+
/>
|
|
38
|
+
</View>
|
|
39
|
+
);
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
See the [example app](example/App.tsx) for additional usage.
|
|
43
|
+
|
|
44
|
+
### Player methods
|
|
45
|
+
|
|
46
|
+
| Prop | Description | Params |
|
|
47
|
+
| ------------------------ | ------------------------------------- | -------------------------------------- |
|
|
48
|
+
| `play()` | Starts playback of the current player | |
|
|
49
|
+
| `pause()` | Pauses playback of the current player | |
|
|
50
|
+
| `stop()` | Stops playback of the current player | |
|
|
51
|
+
| `seek(position: number)` | Sets position of the current player | Must be a float number between 0 and 1 |
|
|
52
|
+
|
|
53
|
+
### Player props
|
|
54
|
+
|
|
55
|
+
The `VLCPlayerView` extends React Native `ViewProps` and implements it's own props:
|
|
56
|
+
|
|
57
|
+
| Prop | Description | Default |
|
|
58
|
+
| ------------------ | ----------------------------------------------------------------------------------------- | -------- |
|
|
59
|
+
| `uri` | Sets the URI of the media to be played | |
|
|
60
|
+
| `subtitle` | Sets subtitle URI and enabled state | |
|
|
61
|
+
| `options` | Sets the VLC options to initialize the player with | `[]` |
|
|
62
|
+
| `volume` | Controls the player volume, must be an integer number between `0` and `100` | `100` |
|
|
63
|
+
| `mute` | Sets the player volume to `0` | `false` |
|
|
64
|
+
| `rate` | Controls the player rate, must be a float number between `0` and `1` | `1` |
|
|
65
|
+
| `tracks` | Sets the player audio and subtitle tracks | |
|
|
66
|
+
| `repeat` | Repeats the media once playback is ended | `false` |
|
|
67
|
+
| `aspectRatio` | Sets the player aspect ratio, must be a valid `string` | |
|
|
68
|
+
| `audioMixingMode` | Determines how the player will interact with other audio playing in the system | `"auto"` |
|
|
69
|
+
| `playInBackground` | Determines whether the player should continue playing after the app enters the background | `false` |
|
|
70
|
+
| `autoplay` | Autoplays media once player is created | `true` |
|
|
71
|
+
|
|
72
|
+
#### Callback props
|
|
73
|
+
|
|
74
|
+
| Prop | Description | Payload |
|
|
75
|
+
| ------------------- | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------- |
|
|
76
|
+
| `onBuffering` | Called after the `Buffering` player event | |
|
|
77
|
+
| `onPlaying` | Called after the `Playing` player event | |
|
|
78
|
+
| `onPaused` | Called after the `Paused` player event | |
|
|
79
|
+
| `onStopped` | Called after the `Stopped` player event | |
|
|
80
|
+
| `onEnded` | Called after the `EndReached` player event | |
|
|
81
|
+
| `onRepeat` | Called after the player repeats the media | |
|
|
82
|
+
| `onWarn` | Called after the player encounters a conflict | `{ warn: string }` |
|
|
83
|
+
| `onError` | Called after the `EncounteredError` player event | `{ error: string }` |
|
|
84
|
+
| `onPositionChanged` | Called after the `PositionChanged` player event | `{ position: number }` |
|
|
85
|
+
| `onLoad` | Called after the `Buffering` player event | `{ width: number, height: number, aspectRatio: string, duration: number, tracks: object, seekable: boolean }` |
|
|
86
|
+
| `onBackground` | Called after the player enters the background | |
|
|
87
|
+
|
|
88
|
+
## Disclaimer
|
|
89
|
+
|
|
90
|
+
**IMPORTANT:** This project is not affiliated with, endorsed by, or officially supported by VideoLAN or the VLC media player project.
|
|
91
|
+
|
|
92
|
+
The VLC logo and cone icon are trademarks of VideoLAN and are used here solely to indicate compatibility with the following VLC libraries:
|
|
93
|
+
|
|
94
|
+
- `LibVLC v3.6.2` for Android
|
|
95
|
+
- `MobileVLCKit v3.6.0` for iOS
|
|
96
|
+
|
|
97
|
+
This is an independent open-source implementation that provides React Native bindings for VLC's underlying media libraries.
|
|
98
|
+
|
|
99
|
+
For official VLC products and support, please visit [videolan.org](https://www.videolan.org/).
|
|
100
|
+
|
|
101
|
+
### Credits
|
|
102
|
+
|
|
103
|
+
This project is heavily inspired by existing libraries such as [expo-video](https://github.com/expo/expo/tree/main/packages/expo-video) and [react-native-vlc-media-player](https://github.com/razorRun/react-native-vlc-media-player).
|
|
104
|
+
|
|
105
|
+
## Contributing
|
|
106
|
+
|
|
107
|
+
Contributions are always welcome. Please raise any issues and/or fix them by creating a pull request.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
File without changes
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="JAVA_MODULE" version="4">
|
|
3
|
+
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
4
|
+
<exclude-output />
|
|
5
|
+
<content url="file://$MODULE_DIR$" />
|
|
6
|
+
<orderEntry type="inheritedJdk" />
|
|
7
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
8
|
+
</component>
|
|
9
|
+
</module>
|