Hi,
I’m trying to integrate QtMultimedia to my qt5 projet (structured with cmake 2.8). When i run the build, i get the following error :
fatal error: QtMultimedia/QMediaPlaylist : No such file or directory
In the CMakeLists.txt i added the following line (but i doesn’t solved the problem) :
SET(QT_USE_QTMULTIMEDIA TRUE)
Here is my code :
#include <QtMultimedia/QMediaPlaylist>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QMediaPlaylist * playlist = new QMediaPlaylist;
playlist->addMedia(QUrl("/home/user/Video-Sans titre-0.mpeg"));
playlist->setCurrentIndex(1);
QMediaPlayer * player = new QMediaPlayer;
player->setPlaylist(playlist);
QVideoWidget * videoWidget = new QVideoWidget;
player->setVideoOutput(videoWidget);
videoWidget->show();
player->play();
return a.exec();
}
Thanks.
↧