0.1.5 • Published 4 months ago

react-native-videoplayer-fabric v0.1.5

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

react-native-videoplayer-fabric

video player for react native

Installation

npm install react-native-videoplayer-fabric

Usage

import * as React from 'react';

import { Button, StyleSheet, View } from 'react-native';
import { VideoPlayerComponent, VideoplayerView } from 'react-native-videoplayer-fabric';

export default function App() {
  const videoPlayerComponentRef =
    React.useRef<VideoPlayerComponent>(null);
  return (
    <View style={styles.container}>
      <VideoPlayerComponent
        ref={videoPlayerComponentRef}
        onErrorEvent={()=>{
          console.log("error")
        }}
        videoUrl="https://ia800208.us.archive.org/4/items/Popeye_forPresident/Popeye_forPresident_512kb.mp42"
        style={styles.box}
      />

      <Button title='Play' onPress={()=>{
          videoPlayerComponentRef.current?.play()
      }}/>
      <View style={{height:20}}/>
      <Button title='Pause' onPress={()=>{
             videoPlayerComponentRef.current?.pause()
      }}/>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: 'center',
    justifyContent: 'center',
    backgroundColor: 'red',
  },
  box: {
    width: 300,
    height: 200,
    marginVertical: 20,
  },
});

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


0.1.5

4 months ago

0.1.4

9 months ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago