How to repeat video in Qt player



  • Hellow guys i build a video player in Qt uding qmediaplayer qtmultimedia
    now i want to repeat a video which i am playing
    could any one please help me in this

    Thanks



  • Hello,

    never used qmediaplayer but after quickly reading the class doc maybe you can try to

    @setPosition()@

    to the beginning when receiving signal

    @mediaStatusChanged(QMediaPlayer::EndOfMedia)@

    or check with

    @mediaStatus() @



  • You can look at vidiowidget example in Qt installation under examples. It gives good idea for you.



  • Dheerendra thanks
    however videowidget example donot have repeat function



  • You need to work with QMediaPlayer. You can use the play continuously. You can make this work in combination of Play and setPosition. VideoWidget is just display. Did you check the slider and play buttons ? This itself should help you make the repeat. Repeat is nothing but calling the play continuously. Hope this helps.



  • Marty ,Dheerendra
    Thank you very much it worked for me .



  • You can move this question to SOLVED state.



  • i have one more question related to ''repeat'' thing 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.Can u help me in this.



  • hi,

    maybe you should start another thread. This helps in referencing the questions and answers when searching for a solution in a search engine.

    By the way, 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


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.