But I need a full-screen mode. How do I make the videoframe takes all the mainwindow? I think it should be easy, but not for such a newbie like me)
I also have the following errors:
[00000000028e98b8] main interface error: no suitable interface module
[0000000002a45dc8] main vout display error: Failed to set on top
Here is the code.
DemoPlayer.cpp
Code: Select all
#include <vlc-qt/Common.h>
#include <vlc-qt/Instance.h>
#include <vlc-qt/Media.h>
#include <vlc-qt/MediaPlayer.h>
#include <vlc-qt/WidgetVideo.h>
#include "DemoPlayer.h"
#include <QtWidgets>
DemoPlayer::DemoPlayer(QWidget *parent)
: QMainWindow(parent),
_videowidget(0),
_media(0)
{
_instance = new VlcInstance(VlcCommon::args(), this);
_media = new VlcMedia("C:/promo/repeat.mp4", true, _instance);
_player = new VlcMediaPlayer(_instance);
_videowidget = new VlcWidgetVideo(_player,this);
_player->setVideoWidget(_videowidget);
_videowidget->show();
_player->open(_media);
_player->play();
Code: Select all
#include <QApplication>
#include "DemoPlayer.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
DemoPlayer mainWindow;
mainWindow.showfullscreen();
return app.exec();
}
Code: Select all
#ifndef DEMOPLAYER_H_
#define DEMOPLAYER_H_
#include <QMainWindow>
#include <QWidget>
class VlcInstance;
class VlcMedia;
class VlcMediaPlayer;
class VlcWidgetVideo;
class DemoPlayer : public QMainWindow
{
Q_OBJECT
public:
explicit DemoPlayer(QWidget *parent = 0);
public:
VlcInstance *_instance;
VlcMedia *_media;
VlcMediaPlayer *_player;
VlcWidgetVideo *_videowidget;
};
#endif // DEMOPLAYER_H_