Results 1 to 3 of 3

Thread: The same question : Phonon how can i loop a video?

  1. #1
    Join Date
    Aug 2011
    Posts
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default The same question : Phonon how can i loop a video?

    i find the same question here,but it not work in my qt;

    so i now i have the same question:

    one video how can loop?

    this is my code :

    mainwindow.h
    Qt Code:
    1. #ifndef MAINWINDOW_H
    2. #define MAINWINDOW_H
    3.  
    4. #include <QMainWindow>
    5. #include <phonon>
    6. #include <QUrl>
    7.  
    8. namespace Ui {
    9. class MainWindow;
    10. }
    11.  
    12. class MainWindow : public QMainWindow
    13. {
    14. Q_OBJECT
    15.  
    16. public:
    17. explicit MainWindow(QWidget *parent = 0);
    18. ~MainWindow();
    19.  
    20. public slots:
    21. void finishedone();
    22.  
    23. private:
    24. Ui::MainWindow *ui;
    25. Phonon::MediaObject *media;
    26.  
    27. };
    28.  
    29. #endif // MAINWINDOW_H
    To copy to clipboard, switch view to plain text mode 

    mainwindow.cpp
    Qt Code:
    1. #include "mainwindow.h"
    2. #include "ui_mainwindow.h"
    3.  
    4. MainWindow::MainWindow(QWidget *parent) :
    5. QMainWindow(parent),
    6. ui(new Ui::MainWindow)
    7. {
    8. ui->setupUi(this);
    9.  
    10. Phonon::MediaObject *media = new Phonon::MediaObject(this);
    11. media->setCurrentSource(Phonon::MediaSource(QString("d:/1.mp3")));
    12.  
    13. Phonon::VideoWidget *videoWidget = new Phonon::VideoWidget(this->centralWidget());
    14. Phonon::createPath(media, videoWidget);
    15.  
    16. Phonon::AudioOutput *ao = new Phonon::AudioOutput(Phonon::VideoCategory);
    17. Phonon::createPath(media, ao);
    18.  
    19. media->play();
    20. connect(media, SIGNAL(finished()), this, SLOT(finishedone()));
    21.  
    22. }
    23.  
    24. MainWindow::~MainWindow()
    25. {
    26. delete ui;
    27. }
    28.  
    29. void MainWindow::finishedone()
    30. {
    31. media->play();
    32. }
    To copy to clipboard, switch view to plain text mode 
    this code just play once? can i loop it ?

    thanks ..

  2. #2
    Join Date
    Aug 2011
    Posts
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: The same question : Phonon how can i loop a video?

    why nobody reply me ?

    everyone thinks this problem is simple ?

    come on baby, i need help !~

  3. #3
    Join Date
    Aug 2011
    Posts
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: The same question : Phonon how can i loop a video?

    i have resolved this problem, whatever thanks in advanced!~

Similar Threads

  1. Phonon - how to loop a video file
    By Mrdata in forum Newbie
    Replies: 6
    Last Post: 24th July 2015, 18:31
  2. Phonon video streaming
    By frknml in forum Qt Tools
    Replies: 1
    Last Post: 3rd November 2010, 06:24
  3. Playing video using Phonon video widget
    By Leolander in forum Newbie
    Replies: 0
    Last Post: 26th February 2010, 06:15
  4. Replies: 3
    Last Post: 5th July 2009, 17:22
  5. Video freezes during mpeg video playback using Phonon
    By davejames in forum Qt Programming
    Replies: 2
    Last Post: 12th January 2009, 08:45

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.