Skip to main content
Participant
May 28, 2013
해결됨

how to display the title and artist of a song from a shoutcast radio stream aacplus?

  • May 28, 2013
  • 1 답변
  • 1724 조회

...

I'm building a player for a radio that transmits in aacPlus. I searched for information, and I have understood that to use the onMetaData method from de netStream classd. But I do not know how.

Can anyone help? Please

Thanks, greetings

Miguel

...

이 주제는 답변이 닫혔습니다.
최고의 답변: kglad

:

var video:Video = new Video(); 
addChild(video); 
var nc:NetConnection = new NetConnection();
nc.connect(null); 
var ns:NetStream = new NetStream(nc);
ns.client = this;

video.attachNetStream(ns);
ns.play(your stream);  

function onMetaData(eObj:Object):void {
for(var s:String in eObj){
trace(s,eObj);
}
}

1 답변

kglad
Community Expert
kgladCommunity Expert답변
Community Expert
May 28, 2013

:

var video:Video = new Video(); 
addChild(video); 
var nc:NetConnection = new NetConnection();
nc.connect(null); 
var ns:NetStream = new NetStream(nc);
ns.client = this;

video.attachNetStream(ns);
ns.play(your stream);  

function onMetaData(eObj:Object):void {
for(var s:String in eObj){
trace(s,eObj);
}
}

MLCasellas작성자
Participant
May 29, 2013

...

Thank you very much, kglad :-) But I'm completely new to programming in flash and do not understand how I proceed to extract the title and artist ... can you explain me the code? please...

...

kglad
Community Expert
Community Expert
June 3, 2013

...

Done! :-)

Thanks kglad for your help I learned to use Ctrl + Enter...

Well, I finally managed to learn how to do it. This is the code and it works:

function onMetaData(eObj:Object):void {

     

   for(var s:String in eObj){

      songTitle.text = eObj.StreamTitle;        

         }     

        

You can see the player running on the web that I created for web-radio of my friend Sir Flansi:

http://www.flansinnata.ch

Greetings! :-)

...


you're welcome.