Make YouTubePlayer.state property publicly accessible if YouTubePlayerKit is imported using @_spi attribute
Fix background thread crash issues by isolating YouTubePlayerKit views and models to main actor
Send playerStatePublisher updated state in case .onChange
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.
Added some minor improvements:
YouTubePlayer.state
property publicly accessible if YouTubePlayerKit is imported using@_spi
attributeYouTubePlayerKit
views and models to main actorplayerStatePublisher
updated state in case.onChange
playerStateSubject
publisher will not ever be told that it's ready again.