Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. [SOLVED] vlc-qt fullscreen mode
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] vlc-qt fullscreen mode

Scheduled Pinned Locked Moved 3rd Party Software
4 Posts 2 Posters 4.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    skullhead
    wrote on 13 Apr 2014, 10:45 last edited by
    #1

    Hello everyone. I started studying vlc-qt and I have a problem. I have pasted vlcvideowidget in qwidget. Video works, but takes up only a small area in the corner of the main window.
    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
    @
    #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();
    @

    main.cpp
    @
    #include <QApplication>

    #include "DemoPlayer.h"

    int main(int argc, char *argv[])
    {
    QApplication app(argc, argv);
    DemoPlayer mainWindow;
    mainWindow.showfullscreen();
    return app.exec();
    }
    @

    DemoPlayer.h
    @
    #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_
    @

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 13 Apr 2014, 21:14 last edited by
      #2

      Hi and welcome to devnet,

      From just a quick overlook at the code (I haven't used that lib yet) you don't set any widget as DemoPlayer centralWidget so it's not managed for you

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • S Offline
        S Offline
        skullhead
        wrote on 14 Apr 2014, 05:00 last edited by
        #3

        Thanks for the quick reply! Now I understand)
        Topic may be closed.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 14 Apr 2014, 07:04 last edited by
          #4

          You're welcome !

          The current way of doing that is to prepend [solved] to the thread title (just edit the original post and modify the title)

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          1/4

          13 Apr 2014, 10:45

          • Login

          • Login or register to search.
          1 out of 4
          • First post
            1/4
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved