From: Colin Clark Date: Wed, 6 Sep 2023 09:51:05 +0000 (+0100) Subject: Fix #1185: Do you plan to embed video player like gthumb or pix has their own built... X-Git-Tag: v2.2~111 X-Git-Url: http://geeqie.org/cgi-bin/gitweb.cgi?p=geeqie.git;a=commitdiff_plain;h=41885ec4cb91e8b3e2f9ffe315b8dbd2953047ba Fix #1185: Do you plan to embed video player like gthumb or pix has their own built-in player? 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. --- diff --git a/plugins/meson.build b/plugins/meson.build index 7045fb16..0c0abcdb 100644 --- a/plugins/meson.build +++ b/plugins/meson.build @@ -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 index 00000000..861e9bd0 --- /dev/null +++ b/plugins/video-player/meson.build @@ -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 index 00000000..0c92c1b0 --- /dev/null +++ b/plugins/video-player/video-player.desktop.in @@ -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 diff --git a/src/filefilter.cc b/src/filefilter.cc index 5134cfc2..648aea7a 100644 --- a/src/filefilter.cc +++ b/src/filefilter.cc @@ -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) diff --git a/src/options.cc b/src/options.cc index c29a3440..30ca7e9e 100644 --- a/src/options.cc +++ b/src/options.cc @@ -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;