Floating video

This commit is contained in:
Adolfo Reyna
2023-01-08 22:15:43 -05:00
parent caf2a8ee04
commit 05d05f79f7
6 changed files with 140 additions and 13 deletions

View File

@@ -5,7 +5,7 @@ import API from '../API';
import { useSnapshot } from 'valtio';
import GlobalState from '../contexts/GlobalState.js';
const VideoPlayer = ({ videosFiles, postId, poster, videoUrl }) => {
const VideoPlayer = ({ videosFiles, postId, poster, videoUrl, videoStyle }) => {
const gState = useSnapshot(GlobalState);
const viewer = gState.me;
const video = React.useRef(null);
@@ -33,11 +33,14 @@ const VideoPlayer = ({ videosFiles, postId, poster, videoUrl }) => {
return (
<Video
ref={video}
style={styles.video}
style={{
...styles.video,
...videoStyle
}}
source={{
uri: chosenVideo.length ? chosenVideo[chosenVideo.length-1].link : '',
}}
useNativeControls
useNativeControls={false}
shouldPlay={true}
resizeMode="contain"
onPlaybackStatusUpdate={status => setStatus(() => status)}