Doidgey Doidgey - 1 year ago 195
iOS Question

How to embed youtube video in Phonegap ios app

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.

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="" allowfullscreen></iframe>

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

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

Answer Source

try the below code hope it will help full for you

var video_embeded='PEfxz7PuI0g';

<object><param name="movie" value="'+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="'+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....

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download