Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to play video with libMpv in the same window with MainWidget according to the example qt-opengl? #32

Open
yarafa opened this issue Jun 8, 2020 · 3 comments

Comments

@yarafa
Copy link

yarafa commented Jun 8, 2020

In the example of qt_opengl, I move the code of set command of 'load file' into the constructor function of MainWidget, and want to play video automatically. But there are two windows as shownd in the picture below(the picture of first comment) when launching the app.

How can I set options or properties of libmpv to play video in the same window with MainWidget?

thx.

@yarafa
Copy link
Author

yarafa commented Jun 8, 2020

pic

@li-yuelun
Copy link

li-yuelun commented Jan 5, 2021

My program has only one in windows,has two windows in linux.
I want to know how to solve it on linux?
mpv.cpp
MpvWidget *widget = (MpvWidget *)this->parent(); int64_t wid = widget->winId(); mpv_set_option(mpvPlayer, "wid", MPV_FORMAT_INT64, &wid);
widget.cpp
ui->setupUi(this); QString qexeFullPath = QCoreApplication::applicationDirPath()+"/1.mp4"; ui->playWidget->setUrl(qexeFullPath); ui->playWidget->open();

@Hlongyu
Copy link

Hlongyu commented Oct 27, 2023

I think you should call mainwindow->show() before load video file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants