question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Black screen when embedding youtube video

See original GitHub issue

Hi,

I just integrated react-native-youtube into my project and am seeing just a black background using the example snippet. I am using react-native 0.34.0. Is there something wrong with the snippet?

render() {
    return (
      <YouTube
        ref="youtubePlayer"
        videoId="CebcmJKutaQ" // The YouTube video ID
        play={true}           // control playback of video with true/false
        hidden={false}        // control visiblity of the entire view
        playsInline={true}    // control whether the video should play inline
        loop={false}          // control whether the video should loop when ended

        style={{alignSelf: 'stretch', height: 300, backgroundColor: 'black', marginVertical: 10}}
      />
    );
  }

image

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:8

github_iconTop GitHub Comments

13reactions
adeebbasheercommented, Sep 15, 2016

<YouTube ref=“youtubePlayer” videoId={this.props.item.id.videoId} // The YouTube video ID apiKey={Config.youtube.apiKey} onReady={(e)=>{}} onChangeState={this._onStateChange} onError={(e)=>{console.log(e);}} onProgress={(e)=>{}} style={[{alignSelf: ‘stretch’, backgroundColor: ‘black’, marginVertical: 10}]} />

9reactions
nancyhuynhcommented, Sep 21, 2016

@mahyarse unfortunately, I did not. I ended up just using a WebView instead, which suits our current needs:

<WebView
  source={{ uri: `https://www.youtube.com/embed/${this.props.item.videoId}` }}
/>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolve Black Screen Issue When Play Videos
Workable solutions fix the “black screen” issue when playing videos · Check the Internet Connectivity · Change Adobe Flash Player Settings · Clear...
Read more >
Embed video showing black screen before pushing play
Too bad cause the video itself is clean and nice embedding this way. Only thing is that black screen before pushing play in...
Read more >
Fix: Youtube Videos Black Screen - Appuals.com
Solution 2: Clear Browsing data. The cache and history present in your browser can sometimes cause Youtube videos to become black. They may...
Read more >
Youtube iframe embedded video not working (black screen)
So I havent' "SOLVED" it but here are a few hints: the issue comes from the 2 -moz-transform on both parent and parent....
Read more >
Embedded youtube movies won't play, gives a black screen
Hi all, I have a question, on some (web)sites they have embedded youtube video's normally you can play them or they play automatically...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found