Application Output : MediaSource::Stream not yet handled
Hi All !
I have a code ...
Code:
QNetworkAccessManager *manager=new QNetworkAccessManager(this);
QNetworkRequest request(url); // url ="http://dev1.rainconcert.in/sax.mp3"
QNetworkReply *currentDownload = manager->get(request);
Phonon
::MediaObject *music
= Phonon
::createPlayer(Phonon
::MusicCategory, Phonon
::MediaSource((QIODevice*)currentDownload
));
music->play();
But the audio doesn't play and in Application Output "MediaSource::Stream not yet handled" is shown.
I have another code
Code:
QNetworkAccessManager *manager=new QNetworkAccessManager(this);
QNetworkRequest request(url); // url ="http://dev1.rainconcert.in/sax.mp3"
QNetworkReply *currentDownload = manager->get(request);
connect(currentDownload, SIGNAL(downloadProgress(qint64,qint64)), SLOT(downloadProgress(qint64,qint64)));
and slot 'downloadProgress' code
Code:
void MainWindow::downloadProgress(qint64 bytesReceived, qint64 bytesTotal)
{
ui->progressBar->setMaximum(bytesTotal);
ui->progressBar->setValue(bytesReceived);
if(!loaded && bytesReceived>1024){ // loaded is initially set to false
qDebug() << "Play Loading...";
Phonon
::MediaObject *music
= Phonon
::createPlayer(Phonon
::MusicCategory, Phonon
::MediaSource((QIODevice*)sender
()));
music->play();
loaded = true;
}
}
BUT I get the same result told above.
Now I need suggestion how to handle MediaSource Sreaming in QT.
please help me.