[Interest] videoPlayer crashed

Brian Li lxgbrian at gmail.com
Sat Feb 18 11:54:55 CET 2012


Dear all:
I'm learning to use the Phonon in QT, followed up some examples in the help
document to setup one VideoPlayer, but when running this programe, it always
crashed, the example is so simple I don't known where is wrong.
#include <QtCore>
#include <QtGui>
#include <phonon>

 
int main(int argc, char *argv[]) {
    QApplication app(argc, argv);
 
    QWidget *widget = new QWidget;
    widget->setWindowTitle("Video Player");
    widget->resize(400,400);

    QString fileName = QFileDialog::getOpenFileName(0,
     ("Open videos"), "e:\\usr", ("All Files (*.*)")); 
 
    Phonon::VideoPlayer *player = new
Phonon::VideoPlayer(Phonon::VideoCategory, widget); 
    
    	
    player->load(Phonon::MediaSource(fileName));
 
    player->play();
 
    widget->show();
 
    return app.exec();
}

Anyone can give me a hand? The example is runned under Windows XP.





More information about the Interest mailing list