title: C++: Media Player using Qt
body: <p>I want to develop a media player using Qt. On the basis of the documentation I have done the following things:</p>
  
  <p><strong>pro file</strong></p>
  
  <pre><code>QT       += core gui multimedia
  QT += multimediawidgets
  greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
  
  TARGET = Player
  TEMPLATE = app
  
  
  SOURCES += main.cpp\
          mainwindow.cpp
  
  HEADERS  += mainwindow.h
  
  FORMS    += mainwindow.ui
  </code></pre>
  
  <p><strong>main.cpp file</strong></p>
  
  <pre><code>#include &lt;QApplication&gt;
  #include &lt;QtMultimediaWidgets/QVideoWidget&gt;
  #include &lt;QtMultimedia/QMediaPlayer&gt;
  #include &lt;QtMultimedia/QMediaPlaylist&gt;
  
  int main(int argc, char *argv[])
  {
      QApplication a(argc, argv);
  
      QMediaPlayer *player=new QMediaPlayer;
      QVideoWidget *videowidget=new QVideoWidget;
      QMediaPlaylist *playlist=new QMediaPlaylist;
      playlist-&gt;addMedia(QUrl("C:/Users/Administrator/Desktop/VideoLAN/VLC/stram.mp4"));
      player-&gt;setVideoOutput(videowidget);
  
      playlist-&gt;setCurrentIndex(1);
      player-&gt;setPlaylist(playlist);
      player-&gt;play();
      videowidget-&gt;show();
      return a.exec();
  }
  </code></pre>
  
  <p>As for the header file I have included <strong>mainwindow.h</strong></p>
  
  <p><strong>EDIT</strong></p>
  
  <p>All the erorrs are gone but now the output which is coming is:</p>
  
  <p><img src="https://i.stack.imgur.com/XSV99.png" alt="enter image description here"></p>
  
  <p>Where am I going wrong?</p>