Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

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));
});
— asked April 6th 2010 by Christian Sullivan
  • api
  • iphone
  • mobile
  • video
  • youtube
0 Comments

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.

    — answered April 6th 2010 by Kosso
    permalink
    1 Comment
    • Hi Kosso,

      So, to run youtube video within the app I have to use Flash??? And use webView? Do you know Apple is rejecting apps with webView?
      Is there no solution to run youtube video with app view?

      — commented February 18th 2014 by Gustavo Severo
  • 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.createVideoPlayer

    firefox 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
    });
    
    — answered October 7th 2011 by Andres Arguello Pitt
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.