@lunarr/vlc-player
v1.0.5
Published
VLC Player for React Native
Downloads
266
Maintainers
Readme
@lunarr/vlc-player
VLC Player for react-native based on xuyuanzhou/react-native-yz-vlcplayer
, delia-m/react-native-yz-vlcplayer
and react-native-vlc-media-player
to be used on Lunarr.
Installation
React Native 0.60+
yarn add @lunarr/vlc-player
Additional step for iOS
Set Enable Bitcode
to NO
Build Settings ---> search Bitcode
Don't forget to pod update
and gradlew clean
Example
import Video from "@lunarr/vlc-player";
<Video
ref={videoRef}
source={{ uri: url }}
style={styles.video}
onProgress={({ currentTime, duration }) => {
setState({
currentTime, // seconds
duration // seconds
});
}}
onSeek={({ currentTime, duration }) => {
setState({
currentTime, // seconds
duration // seconds
});
}}
onEnd={() => {
setState({ play: false });
}}
onError={() => {
setState({
play: false,
error: {
error: "Oops!",
message:
"There was an error playing this video, please try again later."
}
});
}}
paused={!state.play}
/>