Fix #1185: Do you plan to embed video player like gthumb or pix has their own built...
authorColin Clark <colin.clark@cclark.uk>
Wed, 6 Sep 2023 09:51:05 +0000 (10:51 +0100)
committerColin Clark <colin.clark@cclark.uk>
Wed, 6 Sep 2023 09:51:05 +0000 (10:51 +0100)
https://github.com/BestImageViewer/geeqie/issues/1185

Implement a plugin that uses xdg-open to run an external video player on
video files.

New users will have class video files selected, the "Play video with
left click" selected, and the "Play with" option set to the the new
plugin.

Existing users will need to select the options themselves.

plugins/meson.build
plugins/video-player/meson.build [new file with mode: 0644]
plugins/video-player/video-player.desktop.in [new file with mode: 0644]
src/filefilter.cc
src/options.cc

index 7045fb1..0c0abcd 100644 (file)
@@ -20,7 +20,7 @@ subdir('random-image')
 subdir('rotate')
 subdir('symlink')
 subdir('tethered-photography')
-
+subdir('video-player')
 
 i18n.merge_file(
     input : 'template.desktop.in',
diff --git a/plugins/video-player/meson.build b/plugins/video-player/meson.build
new file mode 100644 (file)
index 0000000..861e9bd
--- /dev/null
@@ -0,0 +1,20 @@
+# This file is a part of Geeqie project (https://www.geeqie.org/).
+# Copyright (C) 2008 - 2022 The Geeqie Team
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#
+
+i18n.merge_file(
+    input : 'video-player.desktop.in',
+    output : 'video-player.desktop',
+    type : 'desktop',
+    po_dir : podir,
+    install : true,
+    install_dir : desktopdir)
diff --git a/plugins/video-player/video-player.desktop.in b/plugins/video-player/video-player.desktop.in
new file mode 100644 (file)
index 0000000..0c92c1b
--- /dev/null
@@ -0,0 +1,21 @@
+[Desktop Entry]
+Version=1.0
+Type=Application
+Name=Video player
+Comment=Display videos in Geeqie
+
+# Requires xdg-utils
+
+Exec=xdg-open %f
+
+# Desktop files that are usable only in Geeqie should be marked like this:
+Categories=X-Geeqie;
+OnlyShowIn=X-Geeqie;
+
+TryExec=xdg-open
+
+# If you want to run a plugin in full-screen mode and wish full-screen
+# to be maintained:
+X-Geeqie-Keep-Fullscreen=true
+
+Icon=geeqie
index 5134cfc..648aea7 100644 (file)
@@ -293,14 +293,14 @@ void filter_add_defaults()
        filter_add_if_missing("rw2", "Panasonic raw format", ".rw2", FORMAT_CLASS_RAWIMAGE, FALSE, TRUE, TRUE);
 
        /* video files */
-       filter_add_if_missing("mp4", "MP4 video file", ".mp4;.m4v;.3gp;.3g2", FORMAT_CLASS_VIDEO, FALSE, FALSE, FALSE);
-       filter_add_if_missing("3gp", "3GP video file", ".3gp;.3g2", FORMAT_CLASS_VIDEO, FALSE, FALSE, FALSE);
-       filter_add_if_missing("mov", "MOV video file", ".mov;.qt", FORMAT_CLASS_VIDEO, FALSE, FALSE, FALSE);
-       filter_add_if_missing("avi", "AVI video file", ".avi", FORMAT_CLASS_VIDEO, FALSE, FALSE, FALSE);
-       filter_add_if_missing("mpg", "MPG video file", ".mpg;.mpeg;.mts;.m2ts", FORMAT_CLASS_VIDEO, FALSE, FALSE, FALSE);
-       filter_add_if_missing("mkv", "Matroska video file", ".mkv;.webm", FORMAT_CLASS_VIDEO, FALSE, FALSE, FALSE);
-       filter_add_if_missing("wmv", "Windows Media Video file", ".wmv;.asf", FORMAT_CLASS_VIDEO, FALSE, FALSE, FALSE);
-       filter_add_if_missing("flv", "Flash Video file", ".flv", FORMAT_CLASS_VIDEO, FALSE, FALSE, FALSE);
+       filter_add_if_missing("mp4", "MP4 video file", ".mp4;.m4v;.3gp;.3g2", FORMAT_CLASS_VIDEO, FALSE, FALSE, TRUE);
+       filter_add_if_missing("3gp", "3GP video file", ".3gp;.3g2", FORMAT_CLASS_VIDEO, FALSE, FALSE, TRUE);
+       filter_add_if_missing("mov", "MOV video file", ".mov;.qt", FORMAT_CLASS_VIDEO, FALSE, FALSE, TRUE);
+       filter_add_if_missing("avi", "AVI video file", ".avi", FORMAT_CLASS_VIDEO, FALSE, FALSE, TRUE);
+       filter_add_if_missing("mpg", "MPG video file", ".mpg;.mpeg;.mts;.m2ts", FORMAT_CLASS_VIDEO, FALSE, FALSE, TRUE);
+       filter_add_if_missing("mkv", "Matroska video file", ".mkv;.webm", FORMAT_CLASS_VIDEO, FALSE, FALSE, TRUE);
+       filter_add_if_missing("wmv", "Windows Media Video file", ".wmv;.asf", FORMAT_CLASS_VIDEO, FALSE, FALSE, TRUE);
+       filter_add_if_missing("flv", "Flash Video file", ".flv", FORMAT_CLASS_VIDEO, FALSE, FALSE, TRUE);
 }
 
 GList *filter_to_list(const gchar *extensions)
index c29a344..30ca7e9 100644 (file)
@@ -137,8 +137,8 @@ ConfOptions *init_options(ConfOptions *options)
        options->mousewheel_scrolls = FALSE;
        options->image_lm_click_nav = TRUE;
        options->image_l_click_archive = FALSE;
-       options->image_l_click_video = FALSE;
-       options->image_l_click_video_editor = nullptr;
+       options->image_l_click_video = TRUE;
+       options->image_l_click_video_editor = g_strdup("video-player.desktop");
        options->open_recent_list_maxsize = 10;
        options->recent_folder_image_list_maxsize = 10;
        options->place_dialogs_under_mouse = FALSE;