SvenTiigi / YouTubePlayerKit

A Swift Package to easily play YouTube videos 📺
https://sventiigi.github.io/YouTubePlayerKit/
MIT License
714 stars 64 forks source link

Prevent JavaScript evaluation from always throwing a WKErrorDomain error #90

Closed acosmicflamingo closed 5 months ago

acosmicflamingo commented 5 months ago

While debugging some issues, I noticed that I kept getting an issue like this anytime JavaScript code was being evaluated in the web view subclass:

"Error Domain=WKErrorDomain Code=5 "JavaScript execution returned a result of an unsupported type" UserInfo={NSLocalizedDescription=JavaScript execution returned a result of an unsupported type}" 

Wrapping it in a no-op function seems to fix the problem.

acosmicflamingo commented 5 months ago

This breaks youTubePlayer.getPlayerMetadata(); closing.