gvhung / as3mp3streamplayer

Automatically exported from code.google.com/p/as3mp3streamplayer
0 stars 0 forks source link

Problems with playing a stream #11

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
i'm having problems with playing a stream. i tried

import fly.sound.*;
var strm:MP3StreamPlayer = new MP3StreamPlayer();
strm.playStream("http://213.251.141.62:8006");

but it won't play me anything. the whole thing is installed correctly i
think. there are no compiler errors or anything. i also tried this code
which i got from here:

package
{
    import flash.display.Sprite;
    import flash.events.*;
    import flash.utils.ByteArray;
    import flash.media.Sound;

    import fly.sound.MP3StreamPlayer;
    import fly.sound.events.SoundBufferEvent;
    import fly.sound.events.TitleChangeEvent;

    public class StreamAudio extends Sprite
    {
        private var _mp3StreamPlayer:MP3StreamPlayer;
        private var _sound:Sound;

        public function StreamAudio()
        {
            _mp3StreamPlayer = new MP3StreamPlayer();
            _mp3StreamPlayer.addEventListener(TitleChangeEvent.TITLE_CHANGE,
_titleChangeHandler);
            _mp3StreamPlayer.addEventListener(SoundBufferEvent.BUFFER_EMPTY, _test);
            _mp3StreamPlayer.addEventListener(SoundBufferEvent.BUFFERING, _test);
            _mp3StreamPlayer.addEventListener(ProgressEvent.PROGRESS, _test);
            _mp3StreamPlayer.addEventListener(Event.COMPLETE,_completeHandler);
            _mp3StreamPlayer.addEventListener(SoundBufferEvent.BUFFERING, _buffering);
            _mp3StreamPlayer.playStream("http://localhost:8000");
        }

        private function _titleChangeHandler(e:TitleChangeEvent):void
        {
            trace(e.title);
        }

        private function _buffering(e:SoundBufferEvent):void
        {
            trace(e.entriesLoaded, "/", e.entriesTotal);
        }

        private function _test(e:Event):void
        {
            trace("test", e.type);
        }

        private function _completeHandler(e:Event):void
        {
            //_sound = _mp3StreamPlayer.sound;
            //_sound.play();
        }

    }

}

but it doesn't work either. how can i test the thing without making my own
shoutcast server? is there any password needed for playing shoutcast music?

all i need to do is play a shoutcast stream. can somebody help me with that?

thx in advance

Original issue reported on code.google.com by kalangab...@gmail.com on 22 Jun 2009 at 1:08

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
it seems ther shoutcast runs aac format and not mp3 which seems not to be 
working.
at the moment im sitting myself here and trying to solve this issue.

ill let you know if i find anything

Original comment by protot...@gmail.com on 14 Jul 2009 at 10:10

GoogleCodeExporter commented 9 years ago
Have you solved the issue?

You really need to read this: 
http://www.adobe.com/devnet/flashplayer/articles/fplayer9_security_print.html

And then this: 
http://www.adobe.com/devnet/flashplayer/articles/socket_policy_files.html

You won't be able to test it in browser if you do not install your own 
shoutcast server and provide a socket policy file.

Original comment by jaya...@gmail.com on 17 Jul 2010 at 3:15