Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/98.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何在应用程序中打开youtube视频?_Ios_Swift_Youtube - Fatal编程技术网

Ios 如何在应用程序中打开youtube视频?

Ios 如何在应用程序中打开youtube视频?,ios,swift,youtube,Ios,Swift,Youtube,我想在我的应用程序中播放youtube视频。但我想通过点击图像(按钮)打开一个全屏视频。我不想创建UIWebview。有可能吗?使用此pod: 您还可以在库的帮助下更改其他配置设置。使用此pod: 您还可以在library的帮助下更改其他配置设置。请点击以下链接: 这是youtube提供的帮助程序,您可以安装此pod,并可以使用第二个链接了解如何集成到您的应用程序中 请点击以下链接: 这是youtube提供的帮助程序,您可以安装此pod,并可以使用第二个链接了解如何集成到您的应用程序中 它是

我想在我的应用程序中播放youtube视频。但我想通过点击图像(按钮)打开一个全屏视频。我不想创建UIWebview。有可能吗?

使用此pod:

您还可以在库的帮助下更改其他配置设置。

使用此pod:


您还可以在library的帮助下更改其他配置设置。

请点击以下链接:

这是youtube提供的帮助程序,您可以安装此pod,并可以使用第二个链接了解如何集成到您的应用程序中


请点击以下链接:

这是youtube提供的帮助程序,您可以安装此pod,并可以使用第二个链接了解如何集成到您的应用程序中


它是什么playerViewController?@NaberApp它是ViodeoViewController我只是忘记了更改名称,因为它是我现有项目中的代码:)它是什么playerViewController?@NaberApp它是ViodeoViewController我只是忘记了更改名称,因为它是我现有项目中的代码:)你试过使用库吗?你试过使用库吗?
func StartVideo() {

        let ViodeoViewController = AVPlayerViewController()
        self.present(ViodeoViewController, animated: true, completion: nil)

        XCDYouTubeClient.default().getVideoWithIdentifier("KHIJmehK5OA") { (video: XCDYouTubeVideo?, error: Error?) in
            if let streamURL = video?.streamURLs[XCDYouTubeVideoQuality.HD720.rawValue] {
                ViodeoViewController.player = AVPlayer(url: streamURL)
            } else {
                self.dismiss(animated: true, completion: nil)
            }
        }
}