0.4.2 • Published 5 months ago

react-native-playback v0.4.2

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

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.9

8 months ago

0.4.1

8 months ago

0.4.0

8 months ago

0.4.2

5 months ago

0.3.6

10 months ago

0.3.5

10 months ago

0.3.8

9 months ago

0.3.7

9 months ago

0.3.4

1 year ago

0.3.3

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.9

2 years ago

0.2.8

2 years ago

0.2.7

2 years ago

0.2.6

2 years ago

0.2.5

2 years ago

0.2.4

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.9

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago