Skip to content

KDE/mpvqt

Repository files navigation

MpvQt is a libmpv wrapper for Qt Quick 2/Qml.

How to use

  • Create a class extending MpvAbstractItem
class MpvItem : public MpvAbstractItem
{
    Q_OBJECT
    QML_ELEMENT
    // ...
}
  • Add the class to a qml module
qt_add_qml_module(videoplayer
    URI com.example.mpvqt
    QML_FILES
        Main.qml
)

target_sources(videoplayer
    PRIVATE
        mpvitem.h mpvitem.cpp
)

or

qt_add_qml_module(videoplayer
    URI com.example.mpvqt
    QML_FILES
        Main.qml
    SOURCES
        mpvitem.h mpvitem.cpp
)
  • In your qml file import mpv import com.example.mpvqt
  • Then create an instance MpvItem {}, MpvItem is the class name extending MpvAbstractItem, if you want to use another name replace QML_ELEMENT with QML_NAMED_ELEMENT(VideoPlayer)

Config file

MpvQt loads a config file located at <config_folder>/mpvqt/mpvqt.conf, the file has to be manually created and is a regular mpv config file. The settings apply to all applications using MpvQt, applications can override the properties set in MpvQt's config file.

Applications using MpvQt

About

MpvQt is a libmpv wrapper for QtQuick2 and QML

Resources

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

No packages published

Contributors 10