Expo Video Youtube


#1

Hi every body,

i want to show a video from youbube in an expo app. I’ve saw the Video support remote url, and it work with other platforms, but not with the youtube video.

There is somethings that i’m doing wrong?

This is my code:

<Video
source={{ uri: https://youtu.be/yzW6bWTIhHU }}
shouldPlay={playing}
resizeMode=“cover”
style={{ width, height: 300 }}
isMuted={muted}
/>


#2

Hey benetz,
Video expects the uri of the media file, which I don’t think is what the youtu.be link points to.
You can do something like this: https://snack.expo.io/@thetc/youtube-player-in-webview


#3

Thanks, I had already use the webView with the url of the page, I hoped there was a more elegant form.
This is only the YouTube case by the way, other streaming service give us directly the link to the media.

Thanks anyway.


#4

The only issue with using webView for video is that video will keep playing in background even you switch between app.

We would love to see [https://github.com/inProgress-team/react-native-youtube] support on expo


closed #5

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.