abbasfreestyle/react-native-af-video-player

suggestion: videoCover OR video component

Opened this issue · 1 comments

Hi @abbasfreestyle ,
I'd like to recommend small update that can improve application performance when using this package.
Once again, great package...I am using it and its solved my fullScreen issue
I think that the rendering should be done like this:

renderVideoCover() {
  ...render the video cover with play button and all the styling
}

renderVideoPlayer() {
  ...render the video player and controls
}

render() {
  if (showVideoCover) return this.renderVideoCover();
  return this.renderVideo();
}

That way when the app navigate to a screen with the video component it won't try to fetch the video immediately but only after the user tap the play button.

This will:

  1. reduce the amount of video fetching - reduce data transfer.
  2. in case of an error, for example network error - will show the error just after the user tap the play button and not when the user navigate to a screen with the video component.

Hi @assafb81,

I think this is a good suggestion, I'll look to add this in the next release. Thank you :)