Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Swift Package Manager Support #411

Merged
merged 3 commits into from
Dec 10, 2021
Merged

Conversation

ivanlisovyi
Copy link
Contributor

@ivanlisovyi ivanlisovyi commented Sep 18, 2020

Context

This PR adds support for Swift Package Manager Installation using SPM 5.3. Closes #396.

Notable Changs

  • Renamed Classes directory to Sources. This aligns the directory name with SPM default directory name requirement and since the directory now contains Assets folder, I think Sources name is a better match.
  • Fixes broken unit tests by migrating them from UIWebView to WKWebView and fixing all the issues that appeared after the migration. Updated OCMock to 3.7.1 to make the block with arguments invocations easier.
  • Moved Assets folder from youtube-ios-player-helper to Source to match SPM requirements.
  • Changed podspec file to match the changes above
  • Fixed source files paths in youtube-ios-player-helper to match the changes above.
  • Updated the README.md with the paragraph about the Swift Package Manager installation.
  • Fixed some warnings in the example project.

Tested

  • Using Cocoapods and Xcode 11.6
  • Using Carthage and Xcode 11.6
  • Using SPM 5.3 and Xcode 12

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@ivanlisovyi
Copy link
Contributor Author

@googlebot I signed it!

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@julioarregoitia
Copy link

Please, add the SPM support

@ramunasjurgilas
Copy link

For me it is failing:
image

@davdroman
Copy link

davdroman commented Jan 25, 2021

@ramunasjurgilas you gotta specify the fork's URL @ master branch, not a version tag.

Screen Shot 2021-01-25 at 22 53 47

@davdroman
Copy link

Could someone please get this merged? 🙏

@ivanlisovyi there's a merge conflict FYI.

ivanlisovyi added 3 commits February 22, 2021 18:35
- Add support for Swift Package Manager (SPM 5.3 required)
- Fix failing unit tests
- Remove redudant unit tests due to public API changes
- Fix warnings for test target
@SaavyGirl
Copy link

SaavyGirl commented Feb 28, 2021 via email

@cassianodialpad
Copy link

+1 on this!

@iTwenty
Copy link

iTwenty commented Apr 4, 2021

+1. Get this merged!

@stephanheilner
Copy link

👍🏼

@johnnypeterson
Copy link

👍 Get this merged!

@wilg
Copy link

wilg commented May 12, 2021

@todd-patterson Can you get this merged or tag who can? Very important for modern iOS development.

@wilg
Copy link

wilg commented May 12, 2021

Or perhaps @rcvrgs? Can you get this merged or tag who can? Very important for modern iOS development.

@acosmicflamingo
Copy link

@todd-patterson @rcvrgs Do you guys hear that? It's a crowd chanting!

"Let's Go YouTube Developers; Let's Go!"
thump
thump
thump thump
thump

✺◟( ͡° ͜ʖ ͡°)◞✺ ✺◟( ͡ ͜ ʖ ͡ )◞✺ ✺◟(◕‿◕✿)◞✺
✺◟( ͡ ͜ ʖ ͡ )◞✺ ✺◟( ͡° ͜ʖ ͡°)◞✺ ✺◟( ͡ ͜ ʖ ͡ )◞✺
✺◟(◕‿◕✿)◞✺ ✺◟( ͡ ͜ ʖ ͡ )◞✺ ✺◟( ͡° ͜ʖ ͡°)◞✺

We got this!!! Let's bring it home! Let's merge this PR :D

@domagojstankovic
Copy link

Can we get this merged? Would be really helpful! Thanks!

@wilg
Copy link

wilg commented Jul 7, 2021

I've filed a ticket with Google asking for them to ensure this package has a maintainer to look at issues like this! Hopefully that helps! https://issuetracker.google.com/issues/192913796

@wilg
Copy link

wilg commented Jul 7, 2021

(Please don't brigade the ticket, just put link for cross reference.)

Copy link

@klaasscho1 klaasscho1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@alternegro
Copy link

LGTM!

@hbanzon
Copy link

hbanzon commented Aug 11, 2021

Hoping this gets merged 🤞

@Tibimac
Copy link

Tibimac commented Sep 15, 2021

@googlebot or @google-admin Could you please merge this pull request as everything seems good and ready for prod (works well on fork, no conflict ... ).
Thanks a lot in advance! 🙏🏻❤️

@wilg
Copy link

wilg commented Sep 15, 2021

Seems like this thing isn't gonna get merged unless somebody knows somebody at YouTube engineering.

@SvenTiigi
Copy link

To all who are still waiting for this PR to be merged 😅

I’ve have created my own Swift Package named YouTubePlayerKit with SPM support.

https://github.com/SvenTiigi/YouTubePlayerKit

YouTubePlayerKit works basically the same way as youtube-ios-player-helper does but comes with extended support for SwiftUI, Combine, async/await and runs on iOS & macOS.

Maybe some people find this helpful ✌️

@acosmicflamingo
Copy link

acosmicflamingo commented Sep 26, 2021

@SvenTiigi Dang; seems really promising! I think the big question is whether Apple will accept apps with this framework. It's one thing to mention in an App Store review "Hey this is officially made by YouTube itself; they'd never develop something that break its own TOS" and another to take it at your word that YouTube TOS are not broken :) Of course, I trust you but will those in the App Store Review panel?

Edit: WOW you made the "What's New" framework! You definitely know your stuff :D I really hope Apple will not complain about integrating it; I will be the first to use it if that's the case 💯

@SvenTiigi
Copy link

Hi @acosmicflamingo as YouTubePlayerKit has just been released I currently have no proof that an App including this framework will definitely pass the App Store Review.

But in my opinion I think this shouldn't cause a problem because at the end YouTubePlayerKit simply displays a WKWebView which loads the YouTube player in an iFrame by making use of the official YouTube iFrame Player API exactly like youtube-ios-player-helper does.

@acosmicflamingo
Copy link

@SvenTiigi That is so cool. Great work!!!

@cassianodialpad
Copy link

whether Apple will accept apps with this framework

@acosmicflamingo This shouldn't be a problem, we did the same thing internally and it has been published to AppStore already.

@SvenTiigi Great job!

@brol1dev
Copy link
Contributor

I verified the PR in the forked repo using:

  • Cocoapods and Xcode 13.0.
  • SPM 5.3 and Xcode 13.0. Created a quick sample app in Swift to verify the player library successfully plays a video.

Thank you for the PR @ivanlisovyi. LGTM!

@todd-patterson
Copy link
Collaborator

Thanks @ivanlisovyi ! Very comprehensive.
Discussed and reviewed with @rcvrgs

Sorry everyone for the long delay on the merge.

@todd-patterson todd-patterson merged commit cebd3ae into youtube:master Dec 10, 2021
@Tibimac
Copy link

Tibimac commented Dec 10, 2021

@todd-patterson Too late, I switched to the great "YouTubePlayerKit" made by @SvenTiigi, far better than the official YouTube-helper, videos loads faster, API is better and far more modern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for Swift Package Manager