Closed artistbuddy closed 2 months ago
@SvenTiigi can this be fixed with the PR I had opened recently?
Hi @artistbuddy,
please check out the develop
branch and let me know if this resolves your issue.
@SvenTiigi yes, if video is unavailable or private the Player set its state to error (err 6).
btw. Now, because of @MainActor
it isn't possible to initialise YouTubePlayer with default argument
@MainActor
final class YouTubePlayerAdapter {
let player: YouTubePlayer
// Call to main actor-isolated initializer 'init(source:configuration:)' in a synchronous nonisolated context
init(player: YouTubePlayer = .init()) {
self.player = player
}
}
I think this is Swift limitation not a https://github.com/SvenTiigi/YouTubePlayerKit/pull/98 problem.
I'm surprised I didn't see a compilation error when I worked on that PR 😕
@artistbuddy thanks for the response! Great to hear you are now receiving an error when passing a a YouTube video url which points to an unavailable or private video.
FYI: The @MainActor
annotations have been removed
@acosmicflamingo I will implement the Swift 6 complete concurrency checks in a separate feature branch.
@SvenTiigi sounds good!
Is your feature request related to a problem?
If URL is not a YouTube one or we persisted some URL and later YouTube deleted such a video, the player state remains ready, but YouTube's native splash screen says error.
What solution would you like?
Catch YouTube's native error as player's state error.
What alternatives have you considered?
I have considered observing getInformation() or getPlaybackMetadata() somehow. If fails it means some error on YouTube side occurred.
Any additional context?
No response