iammert / RadioPlayerService

Android service library which uses AAC Player. Ready to use Radio Player Service.
254 stars 91 forks source link

How to show the songname ? #34

Closed Ishu25 closed 7 years ago

Ishu25 commented 7 years ago

I tried but unable to show song title and artist name in mainactivity using the code @Override public void onMetaDataReceived(String s, String s1) { //TODO Check metadata values. Singer name, song name or whatever you have.

}

Can you tell what coding should I do in this part of code for show songname and also in the notifications area. Thanks

iammert commented 7 years ago

Stream url should support metadata. I mean If you don't get notified with any metadata, then your stream url does not broadcast metadata.

Ishu25 commented 7 years ago

But logcat show this info which is right
IcyInputStream: Metadata string: StreamTitle='songname-artist'; but I am unable to display that info onto mainactivity. For that I have to do some more coding ? or what else I can do to show songname ?

Tyosensya commented 7 years ago

please give O code in the curtain pls.

hamdiwanis commented 7 years ago
@Override
    public void onMetaDataReceived(String identifier, final String data) {
        if ("StreamTitle".equals(identifier)) {
            runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    stateInfo.setText(data.toString());

                }
            });
        }
    }

hope it helps :)