Important: Please read the Qt Code of Conduct -

How to repeat a part of video in Qt player

  • i want to start a video from let say after one min and stop it after 3 min and start the video again from 1 min means like a loop and video is 7 min long.Could anyone help me in this.

  • maybe have a look at QTimer class : start the timer with method start(time) and make something in a slot when signal tiemout() is fired.

    if you need more control, use setPosition()

  • Qt Champions 2017

    There is no direct way to stop the video at specified duration.

    As Marty said,

    1. To start at 1 min, you use the setPosition(...).
    2. Use QTimer to fire timeout after 3 minutes. Use this as repeat timer.
    3. Now use stop() to stop the video.

    This you need to repeat.

  • I used mediaplayer.setPosition(7000) to seek the video till 7 sec an after that play normally but its not working mean the video is starting from the start only.could you please help

  • and if i used signal slot then how can i connect them to mediaplayer coz in the end its mediaplyer class which shuld receive the signal not the timer class and timeout() signal is related to timer class.

Log in to reply