• 5143阅读
  • 2回复

关于phonon的视频播放,望高手解答 [复制链接]

上一主题 下一主题
 

只看楼主 正序阅读 楼主  发表于: 2008-09-01
— 本帖被 XChinux 从 General Qt Programming 移动到本区(2011-01-02) —
写了一个小程序,想用phonon来实现视频播放,代码如下:
#include <QApplication>
#include <QtGui>
#include <QtCore>
#include <phonon>
int main( int argc,char* argv[] )
{
    QApplication app( argc,argv );
    Phonon::VideoPlayer *player = new Phonon::VideoPlayer(Phonon::VideoCategory, 0);
    QObject::connect(player, SIGNAL(finished()), player, SLOT(deleteLater()));
    player->play(Phonon::MediaSource( "/root/demo.avi" ));
    player->show();
    return app.exec();
}
为什么视频只显示一贞,声音也没有?是不是缺少什么了

只看该作者 2楼 发表于: 2008-09-04
仔细看看资料其实很简单的,嘿嘿

只看该作者 1楼 发表于: 2008-09-02
自问自答:
在官网上有一句话是这样说的:If you need a persistent audio output don't use VideoPlayer but MediaObject, VideoPath and VideoOutput.
可见videoplayer是不可取的,要另想办法
快速回复
限100 字节
 
上一个 下一个