Bug 378613 - Add auto preview support for audio files (dolphin/phonon)
Summary: Add auto preview support for audio files (dolphin/phonon)
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 18.04.1
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
: 205422 207729 233455 263981 281765 301133 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-04-10 11:48 UTC by Pekka Helenius
Modified: 2019-06-23 14:38 UTC (History)
12 users (show)

See Also:
Latest Commit:
Version Fixed In: 19.08.0


Attachments
Dolphin autoplay - partial implementation (4.35 KB, patch)
2017-04-10 11:48 UTC, Pekka Helenius
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pekka Helenius 2017-04-10 11:48:09 UTC
Created attachment 104938 [details]
Dolphin autoplay - partial implementation

As I've seen this been requested several times around the internet and I saw it on Ubuntu 10.04 LTS Nautilus & on recent Caja file manager versions (MATE desktop), I'd really like to implement the feature as an alternative option in Dolphin. The feature is handy especially for previewing small audio files.

I've done partial implementation but it's not perfect. There are several major (but quite trivial) issues still to be resolved:

1) Stop playback once the Dolphin window (where the audio preview is being played) is inactivated and window focus lost

2) Get system default media player (Amarok, VLC, etc.) and stop preview playback if the specific track (or any track) is opened in the player

3) If the default media player is currently playing any music track (or video file), do not play a preview since it could distract user

4) Apply autoplay only for audio mimetypes (as it does in Nautilus/Caja)

My partial implementation as an attachment, missing features described above. Please, feel free to edit the patch file if needed.
Comment 1 Rog131 2017-04-10 17:23:59 UTC
KDE Forums (Brainstorm) - Dolphin Video audio play hovering the file: https://forum.kde.org/viewtopic.php?f=83&t=92269
Comment 2 Pekka Helenius 2017-04-10 17:57:32 UTC
Yep, I'm aware of that topic. However, the latest post is over 3 years ago so I think it's time to refresh this topic. The last post which explains how to implement the feature has several problems:

- It's for KDE4 Dolphin (okay, very trivial to re-implement the code in KDE5 Dolphin)

- It doesn't store (save) settings, so the autoplay checkbox must be re-enabled every time Dolphin is opened

- It does autoplay for videos as well. Would this be intended/good or not, don't know. I may prefer the autoplay should only apply for audio files.

- It doesn't have any delay for autoplay (meaning that if you hover cursor above a media file, the autoplay starts immediately. I prefer ~1 sec delay for autoplay)
Comment 3 Nate Graham 2017-08-18 14:57:41 UTC
Thanks for the patch (even if incomplete)! Please host it on Phabricator so it doesn't get lost.

https://phabricator.kde.org/

Add "KDE Applications" and "Dolphin" as review groups.
Comment 4 Pekka Helenius 2017-08-25 13:16:27 UTC
Hi Nate!

As you requested: https://phabricator.kde.org/D7539

I hope this helps!
Comment 5 Nate Graham 2017-09-03 02:20:40 UTC
*** Bug 207729 has been marked as a duplicate of this bug. ***
Comment 6 Nate Graham 2017-09-03 02:21:19 UTC
*** Bug 205422 has been marked as a duplicate of this bug. ***
Comment 7 Nate Graham 2017-09-03 02:21:26 UTC
*** Bug 233455 has been marked as a duplicate of this bug. ***
Comment 8 Nate Graham 2017-09-03 02:21:33 UTC
*** Bug 263981 has been marked as a duplicate of this bug. ***
Comment 9 Nate Graham 2017-09-03 02:21:43 UTC
*** Bug 281765 has been marked as a duplicate of this bug. ***
Comment 10 Nate Graham 2017-09-03 02:21:55 UTC
*** Bug 301133 has been marked as a duplicate of this bug. ***
Comment 11 Julian Steinmann 2018-06-09 14:55:39 UTC
Updated the status of this ticket to reflect the current situation. As already mentioned in D7539, it'd be better from a security perspective if we could sandbox this in Phonon, but this is a rather big change and will probably require quite a lot of work.
Comment 12 Méven Car 2019-03-21 10:27:03 UTC
I have a new patch proposal :
https://phabricator.kde.org/D19782
Comment 13 Méven Car 2019-06-23 14:38:21 UTC
Git commit e6c1b97d67f6b6c6d4ad935db14241b041b3fca4 by Méven Car.
Committed on 23/06/2019 at 14:38.
Pushed by meven into branch 'master'.

Allow dolphin to auto-play previewed media file, click on preview to play/pause videos or audio

Summary:
It is based on D19844.

I did my best to avoid glitches hence the amount of code touched.

Retry after @pekkah D7539
Moved the setting to the information panel context menu, no more timer

Settings screenshot :
{F6700220}

This would mach the same feature in the open/save dialog (although not equivalent)
{F6696456}
FIXED-IN: 19.08.0
GUI: New information panel context menu option

Test Plan:
Without auto play
  - in dolphin with the information panel opened, and the auto media play feature is disabled (right on the information panel)
  - hover over media files
  - the behavior is the same as before the patch

With auto play
  - in dolphin with the information panel opened, and the auto media play feature is enabled
  - hover over media files
  - media is played automatically
  - hover over another media file, the new media is previewed

Use audio or video file as media.

Reviewers: #dolphin, elvisangelaccio, ngraham

Reviewed By: #dolphin, elvisangelaccio, ngraham

Subscribers: ngraham, broulik, kfm-devel, pekkah

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D19782

M  +4    -0    src/panels/information/dolphin_informationpanelsettings.kcfg
M  +8    -0    src/panels/information/informationpanel.cpp
M  +27   -6    src/panels/information/informationpanelcontent.cpp
M  +7    -0    src/panels/information/informationpanelcontent.h
M  +35   -21   src/panels/information/phononwidget.cpp
M  +16   -4    src/panels/information/phononwidget.h

https://commits.kde.org/dolphin/e6c1b97d67f6b6c6d4ad935db14241b041b3fca4