Hi,
I have tried full day for the solution but nothing helped.
I have trying to play a mp3 file with the code below.
When i compile it, it works fine but when i put the swf in any php file and run on my server eg. http://localhost/test/test.php
It does not plays the sound. Please help me, i have wasted hours on this.
============CODE========================================
var audioPath:String = ''audio/Baalim.mp3'';
?
txtError.appendText(''AUDIO PATH:''+audioPath);
trace(''AUDIO PATH:''+audioPath);
var snd:Sound = new Sound();
snd.load(new URLRequest(audioPath));
snd.addEventListener(IOErrorEvent.IO_ERROR, _onIOError);
snd.addEventListener(ProgressEvent.PROGRESS, _onloadingSound);?
snd.addEventListener(Event.COMPLETE, _playSoundObj);
snd.addEventListener( SecurityErrorEvent.SECURITY_ERROR, _secHandler);
function _playSoundObj(e:Event){?
?trace(''\nAudio Played\n''+e);
?snd.play();?
}
function _onIOError(e:Event){
?trace(''\nAudio IO Error\n''+e);
}
function _onloadingSound(e:Event){
?trace(''\nAudio Loading\n''+e);?
}
function _secHandler(e:Event){
?trace(''\nAudio SECURITY_ERROR\n''+e);
}
you probably have a path (to your mp3) problem.?the path should be relative to the embedding html (if you have one) or to your php file if your php file is embedding the swf.
Problem to load mp3 when put on serverThanks for reply,
folder struture is as follows:
/test/index.html (path to File in which swf is embeded)
/test/myplayer.swf (swf file path)
/test/audio/Baalim.mp3 (mp3 file path)
i am accessing as : http://localhost/test/index.html
audio path in as code is as:
var audioPath:String = ''audio/Baalim.mp3'';
Not able to find where i am wrong
Please help.
Regards,
Gulam Mustafa
that path is ok.?if it works offline and not online, then you probably have a typo.?for example, Baalim.mp3 is the same as Baalim.MP3 offline but not online.
I have problem playing Mp3 files from 3rd party servers
if song is in the same server where the player is?the equalizer and ID3 tag works fine
but if not on the same server the song plays but without equalizer or song info
to see the error?try playing this song
Rihanna Mp3
http://www.roomp3.com/mp3-3178-Rihanna-Disturbia.html
that's not an error.?that's a cross-domain security issue which is not a factor for this op.
please create your own thread instead of piggy-backing a different issue here.
No comments:
Post a Comment