Skip to content

Commit 96fc7c0

Browse files
committed
chore: add most of the VLC Player logic back to swift
1 parent 1f4859c commit 96fc7c0

File tree

5 files changed

+375
-140
lines changed

5 files changed

+375
-140
lines changed

example/src/App.tsx

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,40 @@
11
import * as React from 'react';
22

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';
55

66
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)
1010

1111
return (
1212
<>
1313
<ActivityIndicator style={styles.activityIndicator} size={'large'} />
14-
<VLC
14+
<VLCPlayer
1515
source={{
1616
// 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',
2121
}}
2222
style={[
2323
{
24-
...styles.fullScreen,
25-
// backgroundColor: "rgba(0,34,255,0.6)",
24+
flex: 1,
2625
},
27-
StyleSheet.absoluteFillObject,
2826
]}
27+
onPaused={() => console.log("Paused")}
2928
onEnded={() => {
3029
console.log("End reached");
3130
}}
32-
paused
31+
// onProgress={console.log}
32+
paused={pause}
33+
seek={0.98}
34+
rate={1}
35+
repeat={true}
3336
/>
37+
<Button title={"Pause"} onPress={() => setPause(!pause)} />
3438
</>
3539
);
3640
}

index.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
1-
import VLCPlayer from "./VLCPlayer";
1+
export VLCPlayer from "./VLCPlayer";
22
export VLCPlayerView from "./playerView/VLCPlayerView";
3-
4-
export default VLCPlayer
5-
export const VLCPlayerALT = VLCPlayer

0 commit comments

Comments
 (0)