|
1 | 1 | import * as React from 'react'; |
2 | 2 |
|
3 | | -import {ActivityIndicator, StyleSheet, Text, View} from 'react-native'; |
4 | | -import VLC, {VLCPlayerALT, VLCPlayerView} from 'react-native-vlc-media-player'; |
| 3 | +import {ActivityIndicator, Button, StyleSheet, Text, View} from 'react-native'; |
| 4 | +import {VLCPlayerView, VLCPlayer} from 'react-native-vlc-media-player'; |
5 | 5 |
|
6 | 6 | export default function App() { |
7 | | - console.log(VLC) |
8 | | - console.log(VLCPlayerALT) |
9 | | - console.log("Player: ", VLCPlayerView) |
| 7 | + console.log("PlayerView: ", VLCPlayerView) |
| 8 | + console.log("P: ", VLCPlayer) |
| 9 | + const [pause, setPause] = React.useState(false) |
10 | 10 |
|
11 | 11 | return ( |
12 | 12 | <> |
13 | 13 | <ActivityIndicator style={styles.activityIndicator} size={'large'} /> |
14 | | - <VLC |
| 14 | + <VLCPlayer |
15 | 15 | source={{ |
16 | 16 | // uri: "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4", |
17 | | - // uri: "https://sample.vodobox.net/skate_phantom_flex_4k/skate_phantom_flex_4k.m3u8", |
18 | | - // type: "m3u8", |
19 | | - uri: 'https://dash.akamaized.net/akamai/bbb_30fps/bbb_30fps.mpd', |
20 | | - type: 'mpd', |
| 17 | + uri: "https://sample.vodobox.net/skate_phantom_flex_4k/skate_phantom_flex_4k.m3u8", |
| 18 | + type: "m3u8", |
| 19 | + // uri: 'https://dash.akamaized.net/akamai/bbb_30fps/bbb_30fps.mpd', |
| 20 | + // type: 'mpd', |
21 | 21 | }} |
22 | 22 | style={[ |
23 | 23 | { |
24 | | - ...styles.fullScreen, |
25 | | - // backgroundColor: "rgba(0,34,255,0.6)", |
| 24 | + flex: 1, |
26 | 25 | }, |
27 | | - StyleSheet.absoluteFillObject, |
28 | 26 | ]} |
| 27 | + onPaused={() => console.log("Paused")} |
29 | 28 | onEnded={() => { |
30 | 29 | console.log("End reached"); |
31 | 30 | }} |
32 | | - paused |
| 31 | + // onProgress={console.log} |
| 32 | + paused={pause} |
| 33 | + seek={0.98} |
| 34 | + rate={1} |
| 35 | + repeat={true} |
33 | 36 | /> |
| 37 | + <Button title={"Pause"} onPress={() => setPause(!pause)} /> |
34 | 38 | </> |
35 | 39 | ); |
36 | 40 | } |
|
0 commit comments