我正在尝试将YouTube视频嵌入到我的iphone应用程序中.我正在使用UIWebView并从youtube加载嵌入代码作为html字符串.所以我有一个基本的html标记布局,我正在放置这个代码.
<embed id="yt" src="http://www.youtube.com/watch?v=L9szn1QQfas&fs=0" type="application/x-shockwave-flash" width="%width%" height="%height%"></embed>
Run Code Online (Sandbox Code Playgroud)
问题是视频始终以全屏模式打开.我已将我的webview属性allowInlineMediaPlayback更改为YES,_webview.allowsInlineMediaPlayback = YES;但它也不起作用.有没有办法在没有全屏的情况下从youtube播放视频?
我也试着像这样嵌入
<iframe title="YouTube video player" id="videoframe" width="%width%" height="%height%" src="http://www.youtube.com/embed/L9szn1QQfas?rel=0" frameborder="0"></iframe>
Run Code Online (Sandbox Code Playgroud)
还有这个
<object type="application/x-shockwave-flash" data="http://www.youtube.com/v/L9szn1QQfas" width="%width%" height="%height%">
<param name="movie" value="http://www.youtube.com/v/L9szn1QQfas" />
<param name="quality" value="high" />
<param name="allowFullScreen" value="false" />
<embed id="yt" src="http://www.youtube.com/v/L9szn1QQfas" type="application/x-shockwave-flash" width="%width%" height="%height%"></embed>
</object>
Run Code Online (Sandbox Code Playgroud)
谢谢.