TheWidlarzGroup / react-native-video

A <Video /> component for react-native
http://thewidlarzgroup.github.io/react-native-video/
MIT License
7.15k stars 2.88k forks source link

Progressive downloads not working - 2.0.0 - 3.0.0 #1130

Closed facuescobar closed 6 years ago

facuescobar commented 6 years ago

Current behavior

Progressive downloads not working.

The video waits until is 100% downloaded to start playing.

I don't have an specific configuration for the video. I have the same video configuration and videos in another project and everything is working correctly.

The only difference is the RN version, here I'm using RN v0.55.4. But in the project where it's working correctly I use v0.54.4

Reproduction steps

VideoPlayer.js

static defaultProps = {
  repeat: false,
  paused: true,
  muted: false,
  loaded: false,
  progress: 0,
  duration: 100,
  buffering: false,
};
...

render() {
  return (
    <Video
      {...this.props}
      style={this.props.style}
      replay={this.state.replay}
      paused={this.state.paused}
      muted={this.state.muted}
      repeat={this.state.repeat}
      onLoad={this.onVideoLoad}
      onProgress={this.onVideoProgress}
      onBuffer={this.onVideoBuffer}
      onEnd={this.onVideoEnd}
    />
  );
}

Video.js

static defaultProps = {
  replay: false,
  muted: false,
  paused: true,
  repeat: false,
  resizeMode: 'contain',
  progressUpdateInterval: 250,
  playInBackground: false,
  playWhenInactive: false,
  ignoreSilentSwitch: 'ignore',
};
...

render() {
  const { props } = this;

  return (
    <RNVideo
      {...props}
      style={[style.video, props.style]}
      source={{
        ...props.source,
        mainVer: 1,
        patchVer: 0,
      }}
      ref={ref => {
        this._video = ref;
      }}
      onLoad={this.onLoad}
    />
  );
}

Expected behavior

Video download should be progressive.

Platform

Environment:
  OS: macOS High Sierra 10.13.3
  Node: 7.9.0
  Yarn: 0.23.2
  npm: 5.8.0
  Watchman: 4.7.0
  Xcode: Xcode 9.2 Build version 9C40b
  Android Studio: 2.3 AI-162.4069837

Packages: (wanted => installed)
  react: 16.3.1 => 16.3.1
  react-native: 0.55.4 => 0.55.4
"react-native-video": "^3.0.0",

Video sample

This is a short video Video duration: 4s Video download time: 9 seconds

short-video-load.mov.zip

I have large videos that takes more than 3 minutes to download!

n1ru4l commented 6 years ago

Does this happen on android or ios devices?

facuescobar commented 6 years ago

@n1ru4l Thanks for your response, it was happening on both.

I don't know why but it started to work correctly today. It's weird, I had this issue for a couple days, I didn't reinstall anything (I did it before but it didn't work), and nothing has changed in the server side, maybe my computer was causing it.

Anyway, it's working correctly, I'm going to close it. Thanks!