0.3.4 • Published 3 months ago
react-native-playback v0.3.4
react-native-playback
React Native Playback
Installation
npm install react-native-playback
Usage
import { VideoView, createPlayer } from 'react-native-playback'
const [ playerId, setPlayerId ] = useState<string | null>(null)
useEffect(() => {
const player = createPlayer(() => {
setPlayerId(player.getId())
player.setSource({
url: 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4'
})
player.pause()
player.play()
player.on('load', (data) => console.log("ON LOAD", data))
player.on('error', (data) => console.log("ON ERROR", data))
player.on('buffering', (data) => console.log("ON BUFFERING", data))
player.on('timedMetadata', (data) => console.log("ON TIMED METADATA", data))
player.on('stalled', (data) => console.log("ON STALLED", data))
player.on('play', (data) => console.log("ON PLAY", data))
player.on('pause', (data) => console.log("ON PAUSE", data))
player.on('progress', (data) => console.log("ON PROGRESS", data))
player.on('end', (data) => console.log("ON END", data))
player.on('seek', (data) => console.log('ON SEEK', data))
player.on('becomeNoisy', (data) => console.log("ON BECOME NOISY", data))
})
}, [])
if(!playerId)
return null
return <VideoView
style={styles.container}
playerId={playerId}
style={{
backgroundColor: 'black',
width: 400,
height: 300
}}
/>
)
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT
Made with create-react-native-library
0.3.4
3 months ago
0.3.3
6 months ago
0.3.2
6 months ago
0.3.1
6 months ago
0.3.0
6 months ago
0.2.9
6 months ago
0.2.8
6 months ago
0.2.7
6 months ago
0.2.6
6 months ago
0.2.5
6 months ago
0.2.4
6 months ago
0.2.3
6 months ago
0.2.2
7 months ago
0.2.1
7 months ago
0.2.0
7 months ago
0.1.9
7 months ago
0.1.8
7 months ago
0.1.7
7 months ago
0.1.6
7 months ago
0.1.5
7 months ago
0.1.4
7 months ago
0.1.3
7 months ago
0.1.2
7 months ago
0.1.1
7 months ago
0.1.0
7 months ago