链接“在 youtube 上观看”在 iOS UIWebView 中不起作用?

ane*_*yzm 5 youtube-api uiwebview ios

我已经嵌入了一个 youtube iFrame 来在 UIWebView 网页中播放视频。

“在 youtube 上观看”链接不起作用:

在此处输入图片说明

代码是:

<iframe name="player" id="player" src="http://www.youtube.com/embed/{$firstParsedVideo}?HD=1;rel=0;showinfo=0" width="279" height="155"></iframe>
Run Code Online (Sandbox Code Playgroud)

其中 $firstParsedVideo 是视频 ID。

我在 Cocoa Osx WebView 中做了同样的事情,它工作得很好。

谢谢

ane*_*yzm -1

它不起作用的原因是 Web 视图基本 URL 设置为本地。由于我的网络视图加载本地资源(图像),因此我需要将其设置为本地。但这意味着我无法加载在线资源(youtube 视频)。要么是其中之一,要么是另一个。