2

I want to play video using QMediaplayer with internet link. I tried to do this by passing internet link to "setMedia" function but error occured:

"DirectShowPlayerService::doRender: Unresolved error code 80040218"

Example Code is:

#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();
}

I am using Qt Creator 3.5.1 (enterprise)

Mihriban Minaz
  • 3,043
  • 2
  • 32
  • 52
Gio
  • 21
  • 1
  • Possible duplicate of [QT5 Video render error code 80040218](http://stackoverflow.com/questions/20287688/qt5-video-render-error-code-80040218) – OnWhenReady Dec 17 '15 at 16:12
  • Try encoding the `(`, `)` in the url as `%28` and `%29`, respectively. – Frank Osterfeld Dec 17 '15 at 17:55
  • I installed "K-Lite Codec Pack Full" but now it throws other error: "DirectShowPlayerService::doSetUrlSource: Unresolved error code 80004005" and program doesnt shows anything... i also replaced (, ) with %28 and %29 but nothing is changed. the error is the same – Gio Dec 18 '15 at 16:05

0 Answers0