Closed HPezz closed 3 months ago
Hi @HPezz,
could you please provide more information related to this issue for example a minimal reproducible example project?
I've tested the same code inside the example application of the YouTubePlayerKit and couldn't reproduce the described issue (see attached screencast) with Xcode 15.4 and an iPad Air 11-inch (M2) simulator running iPadOS 17.5
https://github.com/user-attachments/assets/06dedb0d-2d7f-4b0a-93c1-7fa10f47e84f
My blind guess is that if the YouTube Player gets stuck in the idle
state, the underlying YouTube Player iFrame API JavaScript may not have been loaded properly since the YouTube Player iFrame API JavaScript onReady
callback is the trigger which updates the state (https://developers.google.com/youtube/iframe_api_reference#Events).
While on the topic, should I create a PR to merge this? https://github.com/acosmicflamingo/YouTubePlayerKit/commit/eac25effa3b2239a26778ea21b1c4bf9c7987544
The problem is that once the player state becomes .error
, the next time you cue a new video, case .onReady
won't ever be accessed but instead it'l go to case .onStateChange
, so anything subscribed to playerStateSubject
publisher will not ever be told that it's ready again.
Good find @acosmicflamingo 👍 Yes a PR is very welcome!
Done! https://github.com/SvenTiigi/YouTubePlayerKit/pull/98
@SvenTiigi let me know if you want me to modify the PR in any way :)
Closing this issue due to inactivity. Feel free to re-open the issue at any time.
What happened?
Hi, I wanted to first thank you for this simple and intuitive kit!
I'm currently facing an issue while trying to use your YouTubePlayerView with the closure state. The state seems to be stuck in .idle. As a result, the overlay ProgressView() continues to spin, regardless of whether the video is ready or not loading.
I tried to bypass this issue by subscribing to the statePublisher attribute of YouTubePlayer, but it was the same; not one event was received.
Are you experiencing the same issue?
What are the steps to reproduce?
I'm working with XCode v15.4 / iPad iOS 17.5 and only trying to use the example of YoutubePlayerView initialized with the state closure :
What is the expected behavior?
I would like to use the closure state initializer of YouTubePlayerView as expected.
Thank you in advance for your time and consideration.