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();
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();