LedgerHQ / ledger-live-mobile

⛔️ DEPRECATED - Ledger Live (Mobile)
https://ledger.com/live
Apache License 2.0
381 stars 116 forks source link

Fix blank videos in onboarding #2374

Closed ofreyssinet-ledger closed 2 years ago

ofreyssinet-ledger commented 2 years ago

Issue: when the app is displaying a video (either welcome screen or buy nano scren) goes in the background and is then resumed, the video is sometimes blank.

This issue happens on both iOS and Android, especially.

This PR contains the only solution I could find to prevent this from happening, basically unmounting the video component when the app goes in the background and then remounting it when the app comes back in the foreground.

It is far from perfect and has a side effect of restarting the video, but I could not reproduce the issue anymore so I guess it does the job 🤷‍♂️ It's better than having a blank space where the video should be.

NB: I also changed the video player on Android from MediaPlayer to ExoPlayer (which is the recommended player for react-native-video). The reason we were using MediaPlayer is that with ExoPlayer it was stopping the media playing in other apps, but there is actually the prop disableFocus to prevent that from happening.

Type

Context

v3 pre-release

Parts of the app affected / Test plan

Onboarding welcome screen & "i don't have a Ledger" screen