Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Contributor
DDmitriev
Posts: 2
Registered: ‎08-06-2012
My Device: several

MediaPlayer and SHOUTcast metadata

I have a problem with SHOUTcast streams: signal metaDataChanged() from MediaPlayer is not working properly.

My custom slot for this signal triggered only once when playback had just started, but I have never got this signal later during this playback.

 

I have tried it with two streams:

1) http://205.234.246.42:8100

2) http://ice.somafm.com/christmas

 

As I understand there is no possibility to put some raw data to the MediaPlayer instance or to mm-renderer, only URLs are supported, so I cannot parse the steam manually. 

 

I need to maintain stream's metadata up-to-date. What possible workaround can be there? 

 

I have an idea: download the stream to the file and attach it to mmr as a dynamically growing file, parse it manually and change files when metadata is changed. 

But i think that it may cause some lags in playback because of preparation/buffering when file sources are changing.

 

Thanks,

Dmitry

Retired
PBernhardt
Posts: 749
Registered: ‎12-16-2008
My Device: BlackBerry Z30

Re: MediaPlayer and SHOUTcast metadata

So, everything is working and playing correctly, but the metaDataChanged() signal is not being fired? If that's the case, it sounds like a bug and should be logged on DIT

 

Paul Bernhardt
Application Development Consultant
BlackBerry
@PBernhardt

Did this answer your question? Please accept this post as the solution.
Found a bug? Report it to the Developer Issue Tracker
Retired
s_rashid
Posts: 127
Registered: ‎02-27-2012
My Device: Bold

Re: MediaPlayer and SHOUTcast metadata

 

 

@DDmitriev:

 

Just a quick update on this. I just tested out one of your streams and it seems to be working fine for me. I did the following:

            MediaPlayer {
                id: myPlayer // URL with no spaces
                sourceUrl: "http://ice.somafm.com/christmas"
                property bool isPlaying: false
                onMediaStateChanged: {
                    if (myPlayer.mediaState == MediaState.Started) {
                        playButton.text = "Pause"
                        isPlaying = true;
                    } else if (myPlayer.mediaState == MediaState.Paused) {
                        playButtonUrl.text = "Play"
                        isPlaying = false;
                    } // onMediaStateChanged
                }
                
                onMetaDataChanged: {
                    console.log("player onMetaDataChanged");
                    console.log("--------------------------------bit_rate=" + myPlayer.metaData.bit_rate);
                    console.log("-----------------------------------genre=" + myPlayer.metaData.genre);
                    console.log("-----------------------------sample_rate=" + myPlayer.metaData.sample_rate);
                    console.log("-----------------------------------title=" + myPlayer.metaData.title);
                }
            } // MediaPlayer

 

Let us know if you got this issue fixed and if this helps.

 

Cheers,

Rashid