Search code examples
qtnokia

Nokia Qt: How to Play video from Phone Memory?


Can anyone tell me how to play video from phone memory??

EDITED :i have use this code for video Playing...

include "playvideo.h"  
include "ui_playvideo.h"  
include QFileDialog   
include phonon/backendcapabilities.h   
include phonon/videoplayer   
include "mainwindow.h"   

PlayVideo::PlayVideo(QWidget *parent) :   
    QMainWindow(parent),    
    ui(new Ui::PlayVideo)    
{
    ui->setupUi(this);

    videoPlay();
}   
void PlayVideo::videoPlay()    
{   
    QString fileName = QFileDialog::getOpenFileName(this, tr("Open Movie"), QDir::homePath());

    Phonon::VideoPlayer *player = new Phonon::VideoPlayer(Phonon::VideoCategory,ui->graphicsView );
    connect(player, SIGNAL(finished()), player, SLOT(deleteLater()));
    player->play(fileName);
}

but it gives me error:

undefined reference to -> Phonon::VideoPlayer(Phonon::VideoCategory,QWidget*)
undefined reference to -> Phonon::VideoPlayer(Phonon::Mediasource const&)

Any idea?

Thanks..


Solution

  • Use either Phonon or QtMultimediaKit APIs.

    For Phonon, there is a demo application in the Qt source tree (demos/qmediaplayer).

    QtMultimediaKit is part of the QtMobility project, so in order to use it you require both Qt and QtMobility to be installed (in your SDK, and on the target device). There is a demo application in the QtMobility source tree (demos/mediaplayer).