aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/VideoPlayer.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/VideoPlayer.cpp b/src/VideoPlayer.cpp
index 5d2bf3c..8020c3c 100644
--- a/src/VideoPlayer.cpp
+++ b/src/VideoPlayer.cpp
@@ -116,6 +116,16 @@ namespace QuickMedia {
remove(tmp_chapters_filepath);
}
+ static Path get_config_dir_xdg() {
+ Path path;
+ const char *xdg_config_home_p = getenv("XDG_CONFIG_HOME");
+ if(xdg_config_home_p)
+ path = xdg_config_home_p;
+ else
+ path = get_home_dir().join(".config");
+ return path;
+ }
+
VideoPlayer::Error VideoPlayer::launch_video_process(const char *path, const char *audio_path, sf::WindowHandle _parent_window, const std::string &title, const std::string &start_time) {
parent_window = _parent_window;
@@ -180,6 +190,11 @@ namespace QuickMedia {
else
args.push_back(ytdl_format.c_str());
+ std::string mpris_arg;
+ Path mpris_path = get_config_dir_xdg().join("mpv").join("scripts").join("mpris.so");
+ if(get_file_type(mpris_path) == FileType::REGULAR)
+ mpris_arg = "--script=" + mpris_path.data;
+
if(!use_system_mpv_config) {
args.insert(args.end(), {
"--no-config",
@@ -187,6 +202,9 @@ namespace QuickMedia {
"--vo=gpu,vdpau,x11",
"--hwdec=auto"
});
+
+ if(!mpris_arg.empty())
+ args.push_back(mpris_arg.c_str());
}
std::string force_media_title_arg;