Live Radio streaming
Hi,
I am posting this question third time but still no one give me clue what should I do to run live streaming radio aacp file, here my code
var url = "http://demo.icy.ast.com/na-live-64";
var streamer = Ti.Media.createAudioPlayer();
streamButton.addEventListener('click',function()
{
streamer.url = url;
streamer.start();
});
Can anyone tell me about its solution? I have spent 2 days in it and still stuck in this problem.
3 Answers
-
Accepted Answer
Utpal - I posted a similar question some time ago. It seems that the AudioPlayer API does not support AAC, only mp3. Many people have never even heard of AAC which is a real shame as my radio station (Radio Caroline) also wants to stream an existing AAC stream and is stuck with mp3.
-
The host seems down. The following functions works for me in a streaming app and has some usefule events. NOTE: the reusable "sound" var in this example is declared outside of this function.
function loadAudio(s){ sound.release(); sound = Ti.Media.createAudioPlayer({url:s,preload:true,allowBackground:true}); sound.addEventListener('error', function(e){ if(e.message == "Unknown media error"){ // detect your specific error code here } }); sound.addEventListener('complete', function(){ // your skip code here }); sound.addEventListener('interrupted', function(){ // your code here }); sound.addEventListener('resume', function(){ // your code here }); sound.addEventListener('progress', function(e){ // your code here }); sound.start(); }
Maybe try using a simple mp3 hosted on your own as source to verify your code is good. You can implement a timeout using the progress event to detect network errors or null reponses.
Hope this helps,
Mike
-
Yes Patrick, you are right . I used mp3 server and my streaming run perfectly. but it won't allow aacp file to start. Thank You.