This is an ex: for videoplayer using Qmediaplayer in meego netbook sdk.But this doesn't work and errors are shown
//.pro file
#-------------------------------------------------
#
# Project created by QtCreator 2011-08-25T14:33:25
#
#-------------------------------------------------
QT += core gui
QT +=multimedia
TARGET = videoplayer
CONFIG += meegotouch
TEMPLATE = app
target.path=/usr/local/bin
INSTALLS=target
SOURCES += main.cpp \
videoplayer.cpp
HEADERS += \
videoplayer.h
FORMS += \
videoplayer.ui
#-------------------------------------------------
#
# Project created by QtCreator 2011-08-25T14:33:25
#
#-------------------------------------------------
QT += core gui
QT +=multimedia
TARGET = videoplayer
CONFIG += meegotouch
TEMPLATE = app
target.path=/usr/local/bin
INSTALLS=target
SOURCES += main.cpp \
videoplayer.cpp
HEADERS += \
videoplayer.h
FORMS += \
videoplayer.ui
To copy to clipboard, switch view to plain text mode
//header file
#ifndef VIDEOPLAYER_H
#define VIDEOPLAYER_H
#include <QMainWindow>
#include <QtMultimediaKit/QMediaPlayer>
#include <QtMultimediaKit/QVideoWidget>
#include <QUrl>
namespace Ui {
class VIDEOPLAYER;
}
{
Q_OBJECT
public:
explicit VIDEOPLAYER
(QWidget *parent
= 0);
QMediaPlayer *player ;
QVideoWidget *widget;
/* videoWidget = new VideoWidget(this);
player->setVideoOutput(videoWidget); additional control*/
~VIDEOPLAYER();
private slots:
void on_pushButton_2_clicked();
void on_pushButton_clicked();
private:
Ui::VIDEOPLAYER *ui;
};
#endif // VIDEOPLAYER_H
#ifndef VIDEOPLAYER_H
#define VIDEOPLAYER_H
#include <QMainWindow>
#include <QtMultimediaKit/QMediaPlayer>
#include <QtMultimediaKit/QVideoWidget>
#include <QUrl>
namespace Ui {
class VIDEOPLAYER;
}
class VIDEOPLAYER : public QMainWindow
{
Q_OBJECT
public:
explicit VIDEOPLAYER(QWidget *parent = 0);
QMediaPlayer *player ;
QVideoWidget *widget;
/* videoWidget = new VideoWidget(this);
player->setVideoOutput(videoWidget); additional control*/
~VIDEOPLAYER();
private slots:
void on_pushButton_2_clicked();
void on_pushButton_clicked();
private:
Ui::VIDEOPLAYER *ui;
};
#endif // VIDEOPLAYER_H
To copy to clipboard, switch view to plain text mode
//cpp file
#include "videoplayer.h"
#include "ui_videoplayer.h"
#include <QtMultimediaKit/QMediaPlayer>
#include <QtMultimediaKit/QVideoWidget>
#include <QUrl>
#include <QDebug>
VIDEOPLAYER
::VIDEOPLAYER(QWidget *parent
) : ui(new Ui::VIDEOPLAYER)
{
ui->setupUi(this);
ui->pushButton_2->hide();
player = new QMediaPlayer(this);
player
->setMedia
(QUrl::fromLocalFile("test.avi"));
widget = new QVideoWidget(ui->frame);
widget->show();
player->setVideoOutput(widget);
player->play();
}
VIDEOPLAYER::~VIDEOPLAYER()
{
delete ui;
}
void VIDEOPLAYER::on_pushButton_2_clicked()
{
ui->pushButton->show();
ui->pushButton_2->hide();
player->pause();
}
void VIDEOPLAYER::on_pushButton_clicked()
{
player->play();
ui->pushButton->hide();
ui->pushButton_2->show();
}
#include "videoplayer.h"
#include "ui_videoplayer.h"
#include <QtMultimediaKit/QMediaPlayer>
#include <QtMultimediaKit/QVideoWidget>
#include <QUrl>
#include <QDebug>
VIDEOPLAYER::VIDEOPLAYER(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::VIDEOPLAYER)
{
ui->setupUi(this);
ui->pushButton_2->hide();
player = new QMediaPlayer(this);
player->setMedia(QUrl::fromLocalFile("test.avi"));
widget = new QVideoWidget(ui->frame);
widget->show();
player->setVideoOutput(widget);
player->play();
}
VIDEOPLAYER::~VIDEOPLAYER()
{
delete ui;
}
void VIDEOPLAYER::on_pushButton_2_clicked()
{
ui->pushButton->show();
ui->pushButton_2->hide();
player->pause();
}
void VIDEOPLAYER::on_pushButton_clicked()
{
player->play();
ui->pushButton->hide();
ui->pushButton_2->show();
}
To copy to clipboard, switch view to plain text mode
error:
c:/meegosdk_1.2/madde/toolchains/meego-sdk-i586-toolchain-1.1-w32_i686/meego-toolchain/bin/../lib/gcc/i586-meego-linux/4.5.0/../../../../i586-meego-linux/bin/ld.exe: cannot find -lQtMultimedia
collect2: ld returned 1 exit status
make: *** [videoplayer] Error 1
The process "C:\meegosdk_1.2\madde\bin\make.exe" exited with code 2.
Error while building project videoplayer (target: MeeGo)
When executing build step 'Make'
Bookmarks