当youtube视频开始使用webview播放时,如何在没有UIWebView的情况下播放youtube视频或检测视频播放器? [英] How to play youtube video without UIWebView or detect video player when youtube video start playing using webview?

查看:179
本文介绍了当youtube视频开始使用webview播放时,如何在没有UIWebView的情况下播放youtube视频或检测视频播放器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I need to play youtube video in my iOS application and while video is playing I need to add an overlay on video.

1.现在我怎样才能运行youtube原生播放器中的视频?

1.Now how can i run youtube video in native player?

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

2.if I play video in UIWebview then how can i detect that video is playing and how to add overlay on the video?

推荐答案

MPMoviePlayerViewController 无法直接播放youtube视频网址。你需要提取使用网址加载 MPMoviePlayerViewController 之前的网址。

MPMoviePlayerViewController cannot directly play youtube video urls.You need to extract the url before loading MPMoviePlayerViewController with the url.

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

you can see a working demo in my github repo:

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

LBYoutubeExtractor 使用JSON提取youtube Url。

请在您的申请中使用之前阅读README.md。

LBYoutubeExtractor extracts the youtube Url with JSON.
Please do read the README.md before you use this in your application.

问候

这篇关于当youtube视频开始使用webview播放时,如何在没有UIWebView的情况下播放youtube视频或检测视频播放器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆