如何嵌入youtube视频在Phonegap ios应用程序 [英] How to embed youtube video in Phonegap ios app

查看:333
本文介绍了如何嵌入youtube视频在Phonegap ios应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找一个解决方案,但所有我可以找到的东西与旧版本的phonegap相关的东西。

I've been searching for a long time for a solution but all i can find are things related to the old versions of phonegap.

我基本上需要在我的应用程式中加入一些youtubes影片,但目前使用的包含程式码如下:

I basically need to include some youtubes videos on my app, but currently using a include code such as:

<iframe width="240" height="180" src="http://www.youtube.com/embed/PEfxz7PuI0g" allowfullscreen></iframe>

除了视频占用的空间之外,只显示一个灰色框。我使用phonegap 2.9.0和最新版本的xCode。我已尝试将网域设置为允许youtube,但这没有帮助:

This doesn't display anything apart from the space the video would take up, just a grey box. I'm using phonegap 2.9.0 and the latest version of xCode. I've tried setting the domains to allow youtube, but this didn't help:

MediaPlaybackRequiresUserAction: NO
AllowInlineMediaPlayback: YES
OpenAllWhitelistURLsInWebView: YES
ExternalHosts
          *.youtube.com
          *.ytimg.com

我相信这是用于ios的以前版本的phonegap应用程序。

I believe that was for previous versions of phonegap apps for ios. Can anyone help, it would be appreciated.

推荐答案

尝试下面的代码,希望它能帮助你。

try the below code hope it will help full for you

var video_embeded ='PEfxz7PuI0g';

var video_embeded='PEfxz7PuI0g';

<object><param name="movie" value="https://www.youtube.com/v/'+video_embeded+'&hl=en_US&feature=player_embedded&version=3"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="https://www.youtube.com/v/'+video_embeded+'?suggestedQuality=medium&hl=en_US&feature=player_embedded&version=3" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always"></embed></object>

这是对我充满的帮助....

this is help full for me....

这篇关于如何嵌入youtube视频在Phonegap ios应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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