Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How put in a Loop a video

How put in a Loop a video

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 824 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Ratataplam
    wrote on last edited by SGaist
    #1

    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

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What happens ?
      Which error are you getting ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      R 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        What happens ?
        Which error are you getting ?

        R Offline
        R Offline
        Ratataplam
        wrote on last edited by
        #3

        @SGaist The problem is that the video doesn't start

        JonBJ 1 Reply Last reply
        0
        • R Ratataplam

          @SGaist The problem is that the video doesn't start

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @Ratataplam
          What does your qDebug() output, don't you think you should tell us?
          What does playlist->currentIndex() return?
          Is the parameter of 1 correct for setCurrentIndex(1) with your single addMedia() call (I do not know)?
          After your code do you allow the Qt event loop to run?
          Should you slot onto other signals like loadFailed()?

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved