Hey everyone,
I’m currently working on an iOS app (Swift + UIKit, might move parts to SwiftUI later) where I need to display and play videos from YouTube. I’ve seen a few different approaches like using WKWebView with embedded players, the iFrame API, or third-party wrappers.
My main concerns are performance, smooth playback, and staying within YouTube’s terms (so no shady workarounds). I also want to avoid heavy memory usage or UI lag, especially when multiple videos are shown in a list (like a feed).
For those who’ve implemented this before:
-
Is
WKWebViewstill the recommended approach, or are there better modern solutions? -
Any tips for handling autoplay, caching, or thumbnail previews efficiently?
-
How do you deal with cell reuse if videos are inside a
UITableView/UICollectionView?
Would really appreciate hearing what’s worked well (or not worked) in real-world apps. Thanks!