barmej / react-native-youtube-player

A Cross-platform Youtube Player component for React Native Built using the official YouTube IFrame Player API.
127 stars 49 forks source link

Some videos are taking forever to load in iOS #39

Open ajaykumar97 opened 3 years ago

ajaykumar97 commented 3 years ago

First of all, thanks a lot for this amazing library to provide a utility to play the youtube videos.

I am using this youtube player for an iOS application. Most of the youtube videos are being played successfully by the player, but some of the videos take forever to load in some of the iOS devices. For example, I am trying to play this youtube video, but it takes forever to load the video. The player get stuck with a loading indicator.

My code for the player is:

<YoutubePlayer
     loop
     videoId="moZOrq0qL3Q"
     autoPlay
     onStart={() => console.log('Video started')}
     onEnd={() => alert('Video Ended')}
     onError={() => {
          console.log('error loading video');
     }}
 />

Testing Environment:

react-native: "0.62.2"
react-native-youtube-player: "1.0.6"
iOS device: iPhone 6
iOS version: "12.4.8"

Can anyone please help me in this or suggest any workaround/solution for this?