Launching Youtube Links
I am trying to launch a youtube link with in my application, but after the video plays I am now in the you tube app and have to go back to the springboard to get back to my app. How do I get the application to launch the video then when the user is done it returns to my app?
tableview.addEventListener('click',function(e)
{
var w = Ti.UI.createWindow();
w.open(Titanium.Platform.openURL(e.row.url));
});
2 Answers
-
Accepted Answer
Hi,
After the YouTube video has completed, or the user clicks the 'done' button, you should find that you're back in the your app.
Is this not the case for you?
BTW: For YouTube, I suggest using a webView and putting the full Flash (yes, Flash) embed code for the video in the html for that webView. This will then create a thumbnail of the video for your users. Then Clicking this will open the YouTube player and do what I described above.
Even though it's Flash code on the iPhone, it will know what to do.
-
This may help somebody else:
you can download the following plugin for firefox and the get the mp4 url from there and use that for url in Titanium.Media.createVideoPlayerfirefox plugin:
https://addons.mozilla.org/en-US/firefox/addon/download-youtube/demo:
var youtubeURL= "http://o-o.preferred.dub06s01.v2.lscache5.c.youtube.com/videoplayback?sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Csource%2Cratebypass%2Ccp&fexp=910601%2C900810&itag=18&ip=217.0.0.0&signature=9EE86B79F89D239F65C083433C8D24F1BA3C1EFC.74C3113E0543748A6CD6C393459206CD082B914E&sver=3&ratebypass=yes&source=youtube&expire=1318024800&key=yt1&ipbits=8&cp=U0hQTVBNUl9FSkNOMF9IR1ZJOjJxREw5TVZEMGVv&id=bc124b31292e50d2&title=New%20Irish%20Cadbury%20Dairy%20Milk%20advert"; var activeMovie = Titanium.Media.createVideoPlayer({ url: youtubeURL, autoplay:true });