2

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 (エンタープライズ) を使用しています

4

0 に答える 0