I am currently building an app in React Native with Expo and I want to have a screen where I display a video. I am currently trying to do that with Expo Video but it isn't going that well. Here is the code of the screen:
Код: Выделить всё
function VideosScreen({ navigation }) { const video = React.useRef(null); const [status, setStatus] = React.useState({}); return ( setStatus(() => status)} /> status.isPlaying ? video.current.pauseAsync() : video.current.playAsync() } /> ); } https://imgur.com/a/4TwRyxJ
If I press play the video does play (I can hear the sound) and it does pause but the video just doesn't show up.
This code has been just copy pasted from their doc about it https://docs.expo.dev/versions/latest/sdk/video/.
For my second issue, when I exit out of this screen (either use the ui up top or create a separate button) it crashes my app after about 1s. I tried linking the button to multiple other screens with the same result.
Thank you in advance for your help.
I have tried to link the big buck bunny video instead with the same exact result.
I have double checked the video format and it is indeed .mp4.
Источник: https://stackoverflow.com/questions/781 ... ing-my-app
Мобильная версия