Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Android) Black Screen for a second between loading and video playback #1128

Closed
TheSolly opened this issue Jul 14, 2018 · 3 comments · Fixed by #1167 or #3179
Closed

(Android) Black Screen for a second between loading and video playback #1128

TheSolly opened this issue Jul 14, 2018 · 3 comments · Fixed by #1167 or #3179

Comments

@TheSolly
Copy link

TheSolly commented Jul 14, 2018

There is an always around 2 seconds of black screen when moving from onLoad which stop my loading spinner component and the start of the video playback in my code below. I am using ExoPlayer.
Any idea what i am doing wrong, or how can i improve my code to get rid of the black screen?!

My Code:

render() {
    let loading = null;
    let waitingVideo = null;
    if (!this.state.waitingVideoURL) {
      loading = (
        <View>
          <Text style={styles.loading}>Loading...</Text>
          <ActivityIndicator size="large" color="#2C3942" />
        </View>
      );
    } else {
      waitingVideo = (
        <Video
          source={{
            uri: this.state.waitingVideoURL,
          }}
          resizeMode="cover"
          style={styles.backgroundVideo}
          repeat
          onLoad={this.stopLoading}
        />
      );
    }

    return (
      <View style={styles.container}>
        <StatusBar hidden />
        {waitingVideo}
        {loading}
      </View>
    );
  }
}
@cobarx
Copy link
Contributor

cobarx commented Jul 14, 2018

I'm guessing you mean ExoPlayer, but wanted to make sure because Expo has their own video player.

Can you share a sample video? It may be an issue that's specific to certain videos.

@TheSolly
Copy link
Author

Yes, i am using ExoPlayer, corrected main post, thanks for the head up.
Will prepare a sample Video and post it here, meanwhile nothing can be improved in my code?!

@cmmartin
Copy link
Contributor

cmmartin commented Aug 4, 2018

I am having the same issue on iOS. The video doesn't seem to matter. It happens with every video that I've tried. I am using version 3.1.0. This is what happens...

  1. The poster shows
  2. The video finishes loading
  3. The poster is removed
  4. The video plays

Between steps 3 and 4, there is a flash of background color instead of the poster seamlessly blending into the video. The flash happens before the onLoad prop is called, so there isn't much you can do from userland AFAIK

djay05554 added a commit to djay05554/react-native-video that referenced this issue Dec 23, 2019
jake4376 added a commit to jake4376/react-native-video that referenced this issue Jan 18, 2020
rosslavni pushed a commit to rosslavni/react-native-video that referenced this issue Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants