诺基亚 Qt:如何播放手机内存中的视频?

发布于 2024-10-12 17:46:45 字数 994 浏览 5 评论 0原文

谁能告诉我如何播放手机内存中的视频?

已编辑:我使用此代码进行视频播放...

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

始于初秋 2024-10-19 17:46:45

使用 PhononQtMultimediaKit 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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文