Vote count:
0
I'mm trying to stream music from the internet using Qt, but this peace of code doesn't really work (and I think it should :) ):
//////////
void MainWindow::play()
{
player_ = new QMediaPlayer(this, QMediaPlayer::StreamPlayback);
player_->setMedia(QUrl("http://ift.tt/1sbltUs"));
//// When I use this line, it actually works :)
////player_->setMedia(QUrl::fromLocalFile("C:\\music\\Knjiga Zalbe\\01. Couvert.mp3"));
player_->setVolume(50);
player_->play();
}
And then I just call the code from main:
QApplication a(argc, argv);
MainWindow w;
w.show();
w.play();
I've tried checking out different answers in StackOverflow, but they don't seem to be working for me as well :( .
Anyone has any ideas? :)
asked 18 secs ago
Qt Music streaming
Aucun commentaire:
Enregistrer un commentaire