Open ristkof opened 2 years ago
Hi @ristkof ,
We will try to reproduce this one and come up with a solution if we identify there is an issue. Thanks for filing the issue!
Hi @ristkof issue is reproduced; however, taking advantage of
You are right that the player needs to load before the view is able to receive api calls. Please call playVideo from within this delegate method.
I embedded the view in a UIViewController that is presented full screen.
When I call
load(withVideoId:"xxxxx")
and immediately callplayVideo()
, this does not work upon first presentation. Successive presentations of the view controller do work though.My workaround is to do
DispatchQueue.main.asyncAfter(deadline: .now() + 1) { self.ytView.playVideo() }
This is hacky though, it looks like something needs loading for about 1 second on my network connection before the playVideo works. I tried looking at the states I receive in the delegates after calling load(withVideoId:), but... I get no state changes on first load.
Am I doing it wrong or is this a bug?