Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/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.
Marty last edited by
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()
There is no direct way to stop the video at specified duration.
As Marty said,
- To start at 1 min, you use the setPosition(...).
- Use QTimer to fire timeout after 3 minutes. Use this as repeat timer.
- 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.