davidohayon669/react-native-youtube

Duplicate videos on the React Native list

Closed this issue · 2 comments

Hello people

I have a list of videos that comes from the API, the IDs are different, but the players appear the same video.

WhatsApp Image 2020-04-15 at 23 12 00

List

Captura de Tela 2020-04-15 às 23 15 45

card YouTube

Captura de Tela 2020-04-15 às 23 14 01

I didn't find the reason :-(

Multiple instances on Android

The YouTube API for Android is a singleton. What it means is that unlike the iOS implementation, no two players can be mounted and play a video at the same time. If you have two scenes that happen to live together, or come one after the other (such as when navigating to a new scene), The new Will take the focus of the singleton and play the video, but after being unmounted, the older mounted will not be able to take the role back, and will need to be re-mounted.

:-(

Any solution for this?