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.

[iOS] Displaying white box instead of video

See original GitHub issue

Hi,

I am using this for iOS app. I have already ran the link command. Please find details below

  "dependencies": {
    "react": "16.4.1",
    "react-native": "0.56.0",
    "react-native-youtube": "^1.1.0"
  },

Below is the code

 <View style={styles.container}>
        <YouTube
          videoId="tmIIOsO95Yw"   // The YouTube video ID
          play={true}             // control playback of video with true/false
          fullscreen={true}       // control whether the video should play in fullscreen or inline
          loop={true}             // control whether the video should loop when ended
          style={{ alignSelf: 'stretch', height: 300 }}
          onReady={e => console.log('onReady has been loaded')}
          onError={e => {
            console.error('error occured') 
          }}
        />
      </View>

Simulator iphone6

screen shot 2018-08-17 at 10 57 42 am

On double click on white screen, I see this

screen shot 2018-08-17 at 10 57 28 am

Please suggest how to resolve this.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

25reactions
LeonidVeremchukcommented, Jan 2, 2019

Maybe this info will be useful for any…

Manually import to Xcode (without Podfile).

1) Add library to Xcode

-Right Click on Libraries dir -> Add Files to “Your Project name”->…/node_modules/react-native-youtube/RCTYouTube.xcodeproj

2) Linking library

-Add libRCTYouTube.a to Linked Frameworks and Libraries

3) Manually import YTPlayerView-iframe-player.html

3.1 copy YTPlayerView-iframe-player.html from …/node_modules/react-native-youtube/assets/ to YOUR_APP/ios/assets/ 3.2. In Xcode Right Click on your root -> Add Files to “Your Project name” - find YTPlayerView-iframe-player.html from your ios/assets/

I do not know why it is so difficult, but these steps help me.

Player example in app:

render() {
        return <View
            style={{
                alignItems: "center",
                justifyContent: "center",
                margin: 1,
                backgroundColor: 'black'
            }}
        >

            <YouTube
                apiKey={configuration.youtubeApiKey}
                play={true}
                videoId="sY5MmhLQBng"  // The YouTube video ID
                onReady={(e) => console.log('READY', e)}
                onChangeState={e => console.log('STATE', e)}
                onChangeQuality={e => console.log('onChangeQuality', e)}
                onError={e => console.log('onError', e)}
                style={{ width: '99%', alignSelf: 'stretch', height: 220 }}
            />
        </View>
    }
0reactions
umkhan65commented, Aug 23, 2019

@LeonidVeremchuk worked for me 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Iphone 11 Max Pro Video only white screen…
Iphone 11 Max Pro Video only white screen with audio of recording ... Hey all, I know this question has been asked but...
Read more >
[iOS] Displaying white box instead of video · Issue #309 - GitHub
Hi, I am using this for iOS app. I have already ran the link command. Please find details below "dependencies": { "react": "16.4.1", ......
Read more >
How to Easily Fix the iPhone White Screen of Death - Lifewire
If an iPhone screen turns black and white, a setting has probably been changed. Go to Settings > Accessibility > Display & Text...
Read more >
White Box appear on screen when keyboard is displayed
After pulling my hair out for an hour I figure out the cause: The keyboard was shrinken. In IOS, you can shrink the...
Read more >
YouTube search missing results or blank on Safari for Mac users
Turn on the developer menu in Safari preferences. Then change your user agent to something like Chrime or Firefox or iPad. Chances are...
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