I prepared an application, I need to get the video links from the data file. What can I do for that.
source={{ ? }} and How do I project 4 videos to the screen using flatlist? Thank you
export const data = [
{
id: 1,
name: "Video1",
video: "http://example.com/video1.mp4" -> ***how do i do this***
},
{
id: 2,
name: "Video2",
video: "http://example.com/video2.mp4" -> ***how do i do this***
},
{
id: 3,
name: "Video3",
video: "http://example.com/video3.mp4" -> ***how do i do this***
},
];
return (
<View style={styles.container}>
<Video
ref={video}
style={{ alignSelf: "center", width: 320, height: 200 }}
source={{ ? }}
useNativeControls
resizeMode="contain"
isLooping
onPlaybackStatusUpdate={(status) => setStatus(() => status)}
/>
Example Image: I want to have a video code like the code written here :)
export const data = [
{
id: 1,
name: "image1",
image: "../assets/image/sun.png"
},
];
import data from './data';
function App() {
return (
<View>
<Image source={data.image}/>
</View)
}