3

I'm using an iframe to embed a youtube video in an app for android/iOS developed using jQuery mobile and phonegap build.

Testing it on my browser works fine.

On my device (android) I see the video thumbnail, but when I click on it the screen goes black, I see the controls (play, forward and backward) and the video doesn't start. On some other video I see the loading "circle" and after that the YT related videos.

I'm checking that the video is avaible for mobile

http://gdata.youtube.com/feeds/videos?alt=json&format=1,6&fields=entry[link/@rel='http://gdata.youtube.com/schemas/2007%23mobile']&max-result=10&category=Music&q="+mySong

Any help would be really appreciated.

2 Answers 2

1

This tutorial seems to work :

http://eisabainyo.net/weblog/2012/01/24/embed-a-youtube-video-iframe-in-phonegap-app/

Pay attention to this step:

Change/add the following values in PhoneGap.plist file of your app.

MediaPlaybackRequiresUserAction: NO AllowInlineMediaPlayback: YES OpenAllWhitelistURLsInWebView: YES ExternalHosts *.youtube.com *.ytimg.com 
Sign up to request clarification or add additional context in comments.

3 Comments

Thanks for the reply.I saw that article but I'm developing under Ubuntu and I did not created the file PhoneGap.plist. Have you any idea how can I generate it?
plist file are configuration files for IOS apps. they are generated automatically from xcode project (or CLI). You are developing for android, so you have'nt to deal with *.plist file but with the android config files. there's an equivalent for those configurations in there.
the best option is to use the Android native player. You can use it in this way: matiasmolinas.blogspot.com.ar/2013/11/…
0

The problem seemed to be related with the android version: on 4.0 the iframe/html5 version worked fine. The problem was on android 2.3.

I used a jqm plugin as a workaround in 2.3

4 Comments

I am facing the same problem. Which jqm plugin did you use? Was there anything else necessary to make it work on Android 2.3?
@Theo I used simonmacdonald.blogspot.ie/2011/11/… but this should work as well tikku.com/… Once I started using it (without anything else) it worked (not inside the app as I wanted but at least it's working)
Thanks for the response. 1. The PhoneGap workaround is based on using the external YouTube app. It doesn't deliver the best experience because you also see the video comments and other info (in portrait mode). 2. The Tikku Player avoids the black screen on 2.3 by detecting if Flash is installed and using that. Without Flash the playback reverts to the non-functioning native player. So this solution depends on the presence of Flash Player for Android which has been discontinued and only works on older certified devices: adobe.com/devnet-apps/flashruntimes/certified-devices.html
I guess there is no "perfect" solution and will have to make do with what's available.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.