诺基亚Qt:如何从手机记忆中播放视频?

时间:2011-01-19 11:00:31

标签: qt nokia

有谁能告诉我如何从手机记忆中播放视频?

已编辑:我已将此代码用于视频播放...

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);
}

但它给了我错误:

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

有什么想法吗?

谢谢..

1 个答案:

答案 0 :(得分:1)

使用PhononQtMultimediaKit API。

对于Phonon,Qt源代码树(demos / qmediaplayer)中有一个演示应用程序。

QtMultimediaKit是QtMobility项目的一部分,因此为了使用它,您需要安装Qt和QtMobility(在SDK中和目标设备上)。 QtMobility源代码树(演示/媒体播放器)中有一个演示应用程序。