我想使用带有互联网链接的QMediaplayer播放视频。我尝试通过将互联网链接传递给" setMedia"功能但发生错误:
" DirectShowPlayerService :: doRender:未解决的错误代码80040218"
示例代码是:
#include "mainwindow.h"
#include <QApplication>
#include <QMediaPlayer>
#include <QVideoWidget>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
//MainWindow w;
//w.show();
QMediaPlayer * player = new QMediaPlayer;
QVideoWidget * vw = new QVideoWidget;
player->setVideoOutput(vw);
player->setMedia(QUrl("http://21.179.127.116/Katy%20Perry%20-%20Roar%20(Official).mp4"));
vw->setGeometry(100,100,300,400);
vw->show();
player->play();
qDebug()<<player->state();
return a.exec();
}
我正在使用Qt Creator 3.5.1(企业版)