诺基亚 Qt:如何播放手机内存中的视频?
谁能告诉我如何播放手机内存中的视频?
已编辑:我使用此代码进行视频播放...
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&)
有什么想法吗?
谢谢..
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..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 Phonon 或 QtMultimediaKit API。
对于 Phonon,Qt 源代码树 (demos/qmediaplayer) 中有一个演示应用程序。
QtMultimediaKit 是 QtMobility 项目的一部分,因此为了使用它,您需要安装 Qt 和 QtMobility(在您的 SDK 中和目标设备上)。 QtMobility 源代码树 (demos/mediaplayer) 中有一个演示应用程序。
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).