Vimeo embedded video will not play in PhoneGap application, but the same HTML works without PhoneGap

I am using PhoneGap / Cordova 1.5.0, this is my HTML page:

<html>
<head></head>
<body>
<iframe src="http://player.vimeo.com/video/38799240?title=0&amp;byline=0&amp;portrait=0" width="400" height="225" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
</body>
</html>

Using Motorola Droid 2 with Android 2.3.3 installed, if I pulled this HTML page in a normal browser, I can play the video as expected.

But if I make the HTML page of my index.html HTML in the PhoneGap project, I can see the thumbnail of the video and the play button, but clicking on it only takes a second to bring up the play button on the counter, and the video doesn't work. Don't play.

I found several posts that make it sound like a source origin problem, some say you can use a wildcard, for example *, others said that it is like a perl regular expression, so you use regex-wildstar, i.e.: .*, I tried a lot versions in res / xml / cordova.xml, for example:

<access origin="http://127.0.0.1*"/>
<access origin="http://player.vimeo.com*"/>
<access origin="http://*.vimeocdn.com*" />
<access origin="http://*.vimeo.com*" />
<access origin="http://vimeo.com*" />

This is not like the effect.

I have not tested this in the iPhone PhoneGap environment yet.

Thank!

+5
source share
2 answers

You cannot include an external video (vimeo / youtube) in a telephone stumbling block. you need to point to the actual video or just open the video that you already have in the childbrowser (using an image with a video as a trigger would be nice).

0
source

Vimeo iFrame iOS, . Phonegap 3.2.0 . ,

NSString* embedHTML = @"<html><head>\
<style type=\"text/css\">\body {\background-color: #000000;\
color: white;}</style></head><body style=\"margin:0\">\
<iframe width=\"512\" height=\"374\" src=\"http://player.vimeo.com/video/60331941\" frameborder=\"0\" allowfullscreen></iframe></body></html>";

NSString* html = [NSString stringWithFormat:embedHTML, urlVideo];

[customWebView loadHTMLString:html baseURL:nil];

URL- config.xml.

<access origin="*.vimeo.com" />
<access origin="*.vimeocdn.com" />

phonegap. , objective-C . html.

, !

0

All Articles