如何在ios应用程序中集成youtube?

如何在ios应用程序中集成youtube?,ios,objective-c,swift,integration,youtube-data-api,Ios,Objective C,Swift,Integration,Youtube Data Api,我想在我的应用程序中集成youtube。并在表视图中显示视频,任何人都可以帮助我。 请详细说明如何在tableview中集成youtube和显示视频列表,或者我可以通过单击按钮下载这些视频 提前谢谢。 您可以通过cocoa pod集成它。您可以在UITableView中显示它 您不能直接从youtube下载youtube视频。我强烈建议您使用pod将youtube集成到应用程序中 pod 'youtube-ios-player-helper', :git =>'https://github

我想在我的应用程序中集成youtube。并在表视图中显示视频,任何人都可以帮助我。 请详细说明如何在tableview中集成youtube和显示视频列表,或者我可以通过单击按钮下载这些视频

提前谢谢。

您可以通过cocoa pod集成它。您可以在UITableView中显示它


您不能直接从youtube下载youtube视频。

我强烈建议您使用pod将youtube集成到应用程序中

pod 'youtube-ios-player-helper', :git =>'https://github.com/youtube/youtube-ios-player-helper', :commit=>'head'
这是它使用youtube的官方方式。试试看,你不需要自己编写html和css

示例用法

1) 在xib中添加
UIView
,并将其类更改为
YTPlayerView

@property(nonatomic, strong) IBOutlet YTPlayerView *playerView;
2) 为
YTPlayerView

@property(nonatomic, strong) IBOutlet YTPlayerView *playerView;
2) 在
ViewController.m中

NSDictionary *playerVars = @{
                                     @"playsinline"    : @1,
                                     @"showinfo"       : @0,
                                     @"rel"            : @0,
                                     @"controls"       : @1,
                                     @"origin"         : @"https://www.example.com", // this is critical
                                     @"modestbranding" : @1
                                     };

 [self.playerView loadWithVideoId:@"Youtube Video Id" playerVars:playerVars];
有关完整文档,请访问。

有关
Youtube提供的详细教程

查看此链接,这是一个完整的帮助,为您提供了一个很好的答案。谢谢,但在使用youtube之前,您能否为您的用户提供一些验证代码。以及获取视频、身份验证或下载所需的所有api。。。