有谁能告诉我如何从手机记忆中播放视频?
已编辑:我已将此代码用于视频播放...
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&)
有什么想法吗?
谢谢..
答案 0 :(得分:1)
使用Phonon或QtMultimediaKit API。
对于Phonon,Qt源代码树(demos / qmediaplayer)中有一个演示应用程序。
QtMultimediaKit是QtMobility项目的一部分,因此为了使用它,您需要安装Qt和QtMobility(在SDK中和目标设备上)。 QtMobility源代码树(演示/媒体播放器)中有一个演示应用程序。