YTPlayerView not working properly

472 Views Asked by At

I have embedded YouTube in my application using YTPlayerView helper library for iOS the main issue I am facing right now is that I have embedded the multiple instances of YTPlayerView within scrollview and its loosing its not calling the changestate playback properly. The problem occurs when two videos are loaded concurrently.

1

There are 1 best solutions below

7
On

you can not use multiple instance of ytplayer in same view as it described in this link see here

  • The library does not support concurrent video playback in multiple YTPlayerView instances. If your application has multiple YTPlayerView instances, a recommended best practice is to pause or stop playback in any existing instances before starting playback in a different instance. In the example application that ships with the project, the ViewControllers make use of NSNotificationCenter to dispatch notifications that playback is about to begin. Other ViewControllers are notified and will pause playback in their YTPlayerView instances.