I’m building a PhoneGap Build app that needs to play video. Unfortunately, no native capabilities work, and using HTML5 across all platforms/phones seems to be dubious. Enter launching the phone’s native video player.
Problem is, whenever I do this, the window loads up a new, blank page which then launches the native player. After the native player is done, I get brought back to the black page, which then fully reloads the app. I’ve tried this in the browser as well, and get the same thing.
I’d like a flow that goes “Click => native player launched => native player done => return to app” like what goes down on m.youtube.com. Can’t figure it out.
In javascript, I’ve tried standard stuff (location.href, window.location.redirect, window.location.reload.) I’ve also dug into the code on m.youtube.com, I don’t see anything that would result in this functionality. I tried directly copy-pasting the rtsp:// link into my app, and got the same white page redirect situation that I do with my own http:// video links.
Help here would be awesome. I wouldn’t be surprised if this solution exists somewhere on StackOverflow or the Googs, but I’ve searched for 3 hours and am finding it quite hard to filter the insane variety of search results that come from the search terms I’m using. Let me know if any more information would be helpful. It’s kind of worthless, but here’s the basic code I’ve thrown together for this (it’s in Sencha Touch, just FYI):
{
name : 'video',
padding : '0 10 0 10',
html : '<a href=javascript:window.location.reload("rtsp://v6.cache3.c.youtube.com/CjYLENy73wIaLQl067BbAoc9uRMYDSANFEIJbXYtZ29vZ2xlSARSBWluZGV4YOuLh9TnzLTcTQw=/0/0/0/video.3gp")>LINK</a>',
},
This isn’t really a successful answer, but after obsessively researching this, everything I found indicated that this wasn’t possible with PhoneGap Build. I ended up moving to regular PhoneGap and used the VideoPlayer plugin as a result.