Titanium Community Questions & Answer Archive

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

Set Remote Sound using AudioPlayer.setUrl

I have a audio player set up in my app that plays sounds from a folder on my site. I'm trying to use AudioPlayer.setUrl, but I don't see a working example. What I'm trying to use (that doesn't work) is:

sound = Titanium.Media.AudioPlayer.setUrl('http://www.mysite.org/opentracks/'+i+'.mp3');
sound.start();
— asked April 13th 2010 by Troy Taylor
  • audioplayer
  • remote
  • seturl
  • sound
0 Comments

1 Answer

  • You need to create an AudioPlayer, then use that method. Or you can do it all in one shot without using setUrl() at all:

    var player = Ti.Media.createAudioPlayer({url:'http://www.mysite.org/opentracks/'+i+'.mp3'});
    player.start();
    
    — answered August 21st 2011 by Tony Lukasavage
    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.