connect(ui->horizontalSlider, SIGNAL(sliderMoved(int)), this, SLOT(setPosition(int)))
void MainWindow::setPosition(int position)
{
player->setPosition(position)
}
Phonon速度很慢,可别怪我,耐心等它蹦出来#include <QtGui>
#include <Phonon>
class VWidget : public QWidget
{
public:
VWidget (QWidget *parent = 0) : QWidget (parent) {
mediaObject = new Phonon::MediaObject (this)
videoWidget = new Phonon::VideoWidget (this)
Phonon::createPath (mediaObject, videoWidget)
audioOutput = new Phonon::AudioOutput (Phonon::VideoCategory, this)
Phonon::createPath (mediaObject, audioOutput)
mediaObject->setCurrentSource (QString ("R:/temp/release/demo.avi"))
mediaObject->play()
}
private:
Phonon::MediaObject *mediaObject
Phonon::VideoWidget *videoWidget
Phonon::AudioOutput *audioOutput
}
int main (int argc, char *argv[])
{
QApplication app (argc, argv)
VWidget *qWidget = new VWidget
qWidget->setMinimumSize (640, 480)
qWidget->show()
qApp->processEvents()
return app.exec()
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)