SvenTiigi / YouTubePlayerKit

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

Is it possible to set origin? #64

Closed DusanFM closed 1 year ago

DusanFM commented 1 year ago

Is your feature request related to a problem?

It seems that unless origin is set to "origin": "http://www.youtube.com", some videos that are restricted to youtube only will not play in the app.

What solution would you like?

I would like for origin to be a property in configuration so that it can be set. In that case It should correspond to the origin parameter in the IFrame API (https://developers.google.com/youtube/player_parameters)

What alternatives have you considered?

set enableJavascriptAPI to true and just have origin set to "http://www.youtube.com" by default in the config.

Any additional context?

No response

SvenTiigi commented 1 year ago

Hey @DusanFM,

Please check out the develop branch which allows setting the origin parameter in the YouTubePlayer.Configuration.

DusanFM commented 1 year ago

@SvenTiigi Code-wise It looks really good!

To test it I assume I need to clone the develop branch and create a new instance that will play from that? This is my first time commenting on a public library so I am a bit unsure of the workflow. so that is the reason why I am asking.

DusanFM commented 1 year ago

BTW, do you know if setting "origin": "http://www.youtube.com/" breaks some of youtube's user condition?

SvenTiigi commented 1 year ago

More information about changing the requirement of a dependency can be found here: https://developer.apple.com/documentation/xcode/adding-package-dependencies-to-your-app

In default the origin identifier is set to https://{BUNDLE-ID} which works perfectly fine but of course I can't guarantee that any other origin value also works 100% correct.

Closing this issue for now ✌️ The changes will be available with the next release.

SvenTiigi commented 1 year ago

The changes are now available with the latest version 1.5.0