How put in a Loop a video
-
Hi folks,
I want reproduce a video continuously and to do that I try to put in service a playlist with a single item a set Loop attribute but also the single reproduction fails and I don't understand why.
Here my code :videoWidget = new QVideoWidget; player = new QMediaPlayer; playlist = new QMediaPlaylist(player); playlist->addMedia(QUrl::fromLocalFile("/home/root/textmp4.mp4")); qDebug() << "playlist error: " << playlist->error(); player->setVideoOutput(videoWidget); // player->setMedia(QUrl("gst-pipeline: multifilesrc location=textmp4.mp4 ! decodebin ! waylandsink name=\"qtvideosink\"")); videoWidget->show(); playlist->setCurrentIndex(1); player->play(); qDebug() << "mediaStatus: " << player->mediaStatus() << "error: " << player->error();any suggestion ? Thanks
-
Hi,
What happens ?
Which error are you getting ? -
@SGaist The problem is that the video doesn't start
-
@SGaist The problem is that the video doesn't start
@Ratataplam
What does yourqDebug()output, don't you think you should tell us?
What doesplaylist->currentIndex()return?
Is the parameter of1correct forsetCurrentIndex(1)with your singleaddMedia()call (I do not know)?
After your code do you allow the Qt event loop to run?
Should you slot onto other signals likeloadFailed()?