Skip to main content
Participant
May 28, 2013
Answered

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

  • May 28, 2013
  • 1 reply
  • 1727 views

...

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

...

This topic has been closed for replies.
Correct answer 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 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
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);
}
}

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
May 29, 2013

copy and paste that code and test it so you can see what's being returned in your stream's metadata. 

if you still need help, copy and paste the trace output here.