chore(example): add more platforms and fix metro resolve

This commit is contained in:
Krzysztof Moch
2024-11-11 13:25:36 +01:00
parent b13a718393
commit 9474bb4fdf
12 changed files with 2275 additions and 308 deletions
+11 -5
View File
@@ -1,5 +1,5 @@
import * as React from 'react';
import { Button, Platform, StyleSheet, View } from 'react-native';
import { Button, Dimensions, Platform, StyleSheet, View } from 'react-native';
import { VideoView, createPlayer } from 'react-native-video';
const player = createPlayer('https://www.w3schools.com/html/mov_bbb.mp4');
@@ -22,11 +22,13 @@ export default function App() {
return (
<View style={styles.container}>
<VideoView player={player} style={styles.box} />
{/* Two VideoViews with same player are supported not supported on Android */}
{Platform.OS === 'ios' && show && (
<View style={styles.videoContainer}>
<VideoView player={player} style={styles.box} />
)}
{/* Two VideoViews with same player are supported not supported on Android */}
{Platform.OS === 'ios' && show && (
<VideoView player={player} style={styles.box} />
)}
</View>
<Button title="Play" onPress={play} />
<Button title="Pause" onPress={pause} />
<Button title="Seek to 3sec" onPress={seek} />
@@ -41,6 +43,10 @@ const styles = StyleSheet.create({
alignItems: 'center',
justifyContent: 'flex-start',
},
videoContainer: {
flexDirection: Dimensions.get('window').width > 700 ? 'row' : 'column',
gap: 20,
},
box: {
width: 300,
height: 300,