gpt4 book ai didi

ios - 如何在没有 UIWebView 的情况下播放 youtube 视频或在 youtube 视频开始使用 webview 播放时检测视频播放器?

转载 作者:可可西里 更新时间:2023-11-01 03:40:05 26 4
gpt4 key购买 nike

我需要在我的 iOS 应用程序中播放 YouTube 视频,并且在播放视频时我需要在视频上添加叠加层。

1.现在如何在 native 播放器中运行 youtube 视频?

2.如果我在 UIWebview 中播放视频,那么我如何检测到该视频是 播放以及如何在视频上添加叠加层?

最佳答案

MPMoviePlayerViewController 无法直接播放 youtube 视频 url。您需要在使用 url 加载 MPMoviePlayerViewController 之前提取 url。

你可以在我的 github repo 中看到一个工作演示:

试试这个: https://github.com/DpzAtMicRO/IOSYoutubePlayer

LBYoutubeExtractor 使用 JSON 提取 youtube Url。
在您的应用程序中使用它之前,请务必阅读 README.md。

问候

关于ios - 如何在没有 UIWebView 的情况下播放 youtube 视频或在 youtube 视频开始使用 webview 播放时检测视频播放器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13702306/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com