Streaming / playing internet radio using QMediaPLayer
Does anyone know how to stream / play an internet radio source using QMediaPlayer? I have tried as follows,but it does not work... Nothing happens.
player = new QMediaPlayer;
player->setMedia(QUrl("http://www.p4.no/lyttesenter/p4_norge.m3u"));
player->setVolume(50);
player->play();
Do I have to start messing with network requests and such?
Regards, Ivar
Re: Streaming / playing internet radio using QMediaPLayer
Does your code work if you give it the QUrl to a local mp3 file on your own PC?
Re: Streaming / playing internet radio using QMediaPLayer
I got it to work now, the problem was that I was trying to play an URL pointing to a playlist, and not a file... Downloading the content of the playlist and then using the code above works. Anyone interested can check my project here:
https://github.com/ivareske/QtInternetRadio
Note that it is far from finished!