35 lines
729 B
JavaScript
35 lines
729 B
JavaScript
import { VideoView } from "expo-video";
|
|
import React from "react";
|
|
import { Image, StyleSheet, View } from "react-native";
|
|
import { img } from "../../../assets";
|
|
|
|
const PlaybackVideo = ({ videoUrl, videoPlayer }) => {
|
|
return (
|
|
<View style={styles.container}>
|
|
{!!videoUrl ? (
|
|
<VideoView
|
|
player={videoPlayer}
|
|
nativeControls={false}
|
|
contentFit="cover"
|
|
style={styles.fill}
|
|
/>
|
|
) : (
|
|
<Image source={img.placeholder3} style={styles.fill} />
|
|
)}
|
|
|
|
</View>
|
|
);
|
|
};
|
|
|
|
const styles = StyleSheet.create({
|
|
container: {
|
|
...StyleSheet.absoluteFillObject,
|
|
},
|
|
fill: {
|
|
width: "100%",
|
|
height: "100%",
|
|
},
|
|
});
|
|
|
|
export default PlaybackVideo;
|