React-native-youtube: Black screen when embedding youtube video

Created on 13 Jan 2017  路  5Comments  路  Source: davidohayon669/react-native-youtube

Hi, I'm using react-native 0.40.0. When I integrated the the example snippet into my project, I only get the empty black screen.

Same problem here: https://github.com/inProgress-team/react-native-youtube/issues/65
but I don't want to use WebView to solve this issue. Anyone know how to fix it?

Thanks alot!

Most helpful comment

@nhcuong95 the red frame happens if I remember correct because the YTPlayerView-iframe-player.html file that holds the inner iframe source isn't found by the native code.
Did you incorporated that file in you project correctly?

Try installing my fork for this repository by running
npm install github:davidohayon669/react-native-youtube#v1 --save
and following the instructions on the README. My fork takes care of all the assets installation with react-native link and rnpm link command lines

All 5 comments

@nhcuong95 Android/iOS? If you're on Android make sure that the project is included in MainApplication.java and that you've rebuit the project with react-native run-android.

Usually a red-line around the component indicates that it hasn't been installed properly.

@morelazers I'm working on the iOS one. And I saw a red-line around the component too.

I have been looking around for hours but haven't found a solution yet.

@nhcuong95 I got the same problem after upgrating my project to react-native 0.40.0. Because, like @morelazers said, react-native-youtube hasn't been installed properly. I rolled back to use react-native 0.39.0 and this problem was disappeared.

@nhcuong95 the red frame happens if I remember correct because the YTPlayerView-iframe-player.html file that holds the inner iframe source isn't found by the native code.
Did you incorporated that file in you project correctly?

Try installing my fork for this repository by running
npm install github:davidohayon669/react-native-youtube#v1 --save
and following the instructions on the README. My fork takes care of all the assets installation with react-native link and rnpm link command lines

For android you must provide apiKey.
https://developers.google.com/youtube/android/player/register
Register your application. Enable youtube api and use that api in apiKey.
<YouTube videoId="" apiKey="" play={false} fullscreen={true} loop={false}/>

Was this page helpful?
0 / 5 - 0 ratings

Related issues

smad picture smad  路  6Comments

berdof picture berdof  路  4Comments

ishita-kothari picture ishita-kothari  路  5Comments

quadsurf picture quadsurf  路  3Comments

savioseb picture savioseb  路  4Comments