implement minLoadRetryCount on ios to reload a video after `onError`
See original GitHub issueCurrent 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
- Implement a retry button that is only visible after
onError
is called - Turn off internet
- open the app
- wait for the retry button to show up
- 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:
- Created 5 years ago
- Reactions:9
- Comments:7 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Passing a different
key
will recreate the component so if you store a key in the state and update it whenonError
is fired it will reload. It’s similar to cobarx’s second solution without a flash of blank content.Without testing it, either:
<Video />
, then render<Video />
againIt 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.