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.

implement minLoadRetryCount on ios to reload a video after `onError`

See original GitHub issue

Current behavior

I’m trying to add a retry button that shows up when onError gets called. The button shows up as expected, but I can’t figure out how to ask the <Video/> component to reload/retry. Is it possible to reload the video after it fails loading?

Reproduction steps

  1. Implement a retry button that is only visible after onError is called
  2. Turn off internet
  3. open the app
  4. wait for the retry button to show up
  5. Tap it (nothing happens, of course, but I’m wondering how I’d get the video to reload here)

Expected behavior

Reload the video at step 5.

Platform

Which player are you experiencing the problem on:

  • iOS

Thank you for the help!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:9
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

23reactions
JorgeVVcommented, Sep 18, 2022

Passing a different key will recreate the component so if you store a key in the state and update it when onError is fired it will reload. It’s similar to cobarx’s second solution without a flash of blank content.

1reaction
cobarxcommented, Oct 14, 2018

Without testing it, either:

  • Set the source to null, then set it back to the original source
  • Render null instead of a <Video />, then render <Video /> again

It would make sense to have a reload() method for situations like this. I’ll keep it in mind when adding features. Feel free to submit a PR.

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-native-video - npm
Version 3.0 features a number of changes to existing behavior. See Updating for changes. Table of Contents. Installation. iOS; tvOS; Android ...
Read more >
How to pass a ref to avoid reload (react-native-video)
I just want the video to not stop and reload when it re-renders based on the isFullscreen prop. I'm not sure the code...
Read more >
'Unable to load video" error message ever… - Apple Community
'Unable to load video" error message ever since IOS 14 update. Before IOS14 i could use itunes to sync videos from my laptop...
Read more >
Show An Error Message When A Video Fails to Load in React ...
In this lesson we'll show to use the onError callback from react-native-video. We'll show how to use a separate ` that'll cover the...
Read more >
Video - Expo Documentation
Expo is an open-source platform for making universal native apps for Android, iOS, and the web with JavaScript and React.
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