Youtube and Phonegap integration.

2,381 views
Skip to first unread message

Ethernaly

unread,
Mar 15, 2012, 4:58:27 PM3/15/12
to phonegap
PLATFORM: IOS

Hello, when I play a youtube video embedded trough <object> from
phonegap, the video starts in full screen mode (and pushing the "DONE"
button, the iPhone switch back to the app).

I want to launch the Video in fullscreen trough <a
href="youtubelink">PLAY</a>. Is it possible? Is there some plugin?
Method?

Ethernaly

unread,
Mar 16, 2012, 12:30:36 PM3/16/12
to phonegap
Any suggestions?

Giacomo Balli

unread,
Mar 16, 2012, 1:10:09 PM3/16/12
to phonegap
use the video tag.

Ethernaly

unread,
Mar 16, 2012, 1:41:02 PM3/16/12
to phonegap
With youtube?

Giacomo Balli

unread,
Mar 17, 2012, 2:07:03 PM3/17/12
to phonegap
yes, make sure you use the mp4 version of the video (to avoid
potential issues).
Is it just predefined videos or do they depend on what the user does
(Search etc)?

On Mar 16, 6:41 pm, Ethernaly <ethern...@gmail.com> wrote:
> Withyoutube?
>
> On 16 Mar, 18:10, Giacomo Balli <giacomoba...@gmail.com> wrote:
>
>
>
>
>
>
>
> > use the video tag.
>
> > On Mar 16, 5:30 pm,Ethernaly<ethern...@gmail.com> wrote:
>
> > > Any suggestions?
>
> > > On 15 Mar, 21:58,Ethernaly<ethern...@gmail.com> wrote:
>
> > > > PLATFORM: IOS
>
> > > > Hello, when I play ayoutubevideo embedded trough <object> from

Ethernaly

unread,
Mar 17, 2012, 3:44:48 PM3/17/12
to phonegap
Something like this doesn't works.. could you please write an
example?

<video width="320" height="240" controls="controls">
  <source src="http://www.youtube.com/watch?v=95dYm8M2o3w" type="video/
mp4" />
</video>

in alternative I'll use mediaelement.js if it works.

Giacomo Balli

unread,
Mar 18, 2012, 5:14:10 AM3/18/12
to phonegap

@RandyMcMillan

unread,
Mar 18, 2012, 2:20:09 PM3/18/12
to phon...@googlegroups.com
Turn developer options on in your desktop safari

navigate to the youtube video you want

change user agent to iPhone in your developer options

you should see the iPhone version

press play on the video

press command option A 

to display the activity in your browser.

you should be able to find the 


link

send link to ChildBrowser



@RandyMcMillan

unread,
Mar 18, 2012, 2:31:44 PM3/18/12
to phon...@googlegroups.com

function onDeviceReady()

            {

                

                                

                if (window.innerHeight > "480")

                {

                    //http://www.youtube.com/watch?v=E0UV5i5jY50

                    

                    var loc = "http://o-o.preferred.atl14s01.v24.lscache1.c.youtube.com/videoplayback?el=watch&begin=0&yms=w74Hvrs1dlk&dnc=1&itag=18&ip=72.0.0.0&app=youtube_mobile&signature=6101C15438D118869F6F34D6F7DAE28BE1005372.3437322AB7CAEE9DF6FCA91B0203F01CC31551FA&sparams=begin%2Ccp%2Cid%2Cip%2Cipbits%2Citag%2Clen%2Cratebypass%2Csource%2Cexpire&len=202000&ratebypass=yes&source=youtube&expire=1332120251&sver=3&key=yt1&ipbits=8&cp=U0hSR1FNTl9KS0NOMl9JR1JDOnQ2NUd0b3E5Ym1o&id=134515e62e63639d";

                    

                        

                }

                else

                {

                    var loc = "http://o-o.preferred.atl14s01.v23.lscache6.c.youtube.com/videoplayback?el=watch&begin=0&yms=w74Hvrs1dlk&dnc=1&itag=18&ip=72.0.0.0&app=youtube_mobile&signature=A04BDD39AD4E9D99F5BAD9DD67256F3274277657.520C1455C2D5963BAEE05D1CC521E4DF5BB3A734&sparams=begin%2Ccp%2Cid%2Cip%2Cipbits%2Citag%2Clen%2Cratebypass%2Csource%2Cexpire&len=86000&ratebypass=yes&source=youtube&expire=1332118618&sver=3&key=yt1&ipbits=8&cp=U0hSR1FMVl9GUkNOMl9JRlpHOmE2NUd0b3A3Zmlv&id=ff686ce319923643";                    

                }

                

                Cordova.exec("ChildBrowserCommand.showWebPage", loc);


                //navigator.notification.alert("Welcome to the Cordova!")

            }

            

            </script>

        </head>

    <body onload="onBodyLoad()">

        <p id="deviceArray">Loading device properties...</p>

    </body>

</html>


Ethernaly

unread,
Mar 20, 2012, 9:11:03 AM3/20/12
to phonegap
this could be did only if I've a single video embedded directly in the
HTML.
I load a lots of videos dinamically from my online DB.
I also tried with mediaelement.js, it works on webapp (jqtouch/jquery
only) but not through phonegap.

@RandyMcMillan

unread,
Mar 22, 2012, 6:51:11 PM3/22/12
to phon...@googlegroups.com
Why not use ChildBrowser?

Dewang Shah

unread,
May 18, 2012, 7:17:12 AM5/18/12
to phon...@googlegroups.com
If you are still looking for a way to get the mp4 URL, you can use the GData API for YouTube - http://gdata.youtube.com/feeds/api/videos/YOURVIDEOID?v=2&prettyprint=true&alt=json

I am trying to get the video to play in fullscreen using the object tag but it just plays inline. Can I ask what exact tag you are using to get it to play in fullscreen?

Max

unread,
Sep 19, 2014, 4:53:58 AM9/19/14
to phon...@googlegroups.com
Hey!

Did you ever solve this? I currently have the same problem...
Reply all
Reply to author
Forward
0 new messages