g-fb / haruna

Moved to https://invent.kde.org/multimedia/haruna
https://invent.kde.org/multimedia/haruna
237 stars 19 forks source link

Add some user control over resuming video playback at last seen position #45

Closed dpalacio closed 3 years ago

dpalacio commented 3 years ago

Currently every single video last playback status is remembered and resumed at the last played point. This may not be ideal for very short videos, in my opinion. Besides, even for longer videos, I prefer to have control over this behavior. Some possible solutions to consider:

  1. On reopening a video with a recorded playback status, offer to resume at last seen point instead of doing so immediately.
  2. Offer the option to completely disable this feature.
  3. Consider not remembering the last seen position for short videos. I leave the definition of short videos open to discussion.

Thank you for this video player.

g-fb commented 3 years ago

Added an option to disable resuming and when it's enabled there's a popup with 2 buttons resume and restart.

You can test it with the beta version https://github.com/g-fb/haruna#beta

I might add some options to only save position for video longer than x and to always resume (skipping the popup).

dpalacio commented 3 years ago

Thank you very much. I want to test this but I have stumbled on a problem.

$ flatpak install flathub-beta com.georgefb.haruna
Buscando coincidencias…
error: The application com.georgefb.haruna/x86_64/beta requires the runtime org.kde.Platform/x86_64/5.15 which was not found

I already have the runtime installed KDE Application Platform org.kde.Platform 5.15 user

I'm not sure if this is my mistake. I googled the error message and I didn't get any useful result.

g-fb commented 3 years ago

Maybe you installed the Platform for single user. The commands in the readme are for system which can't access user runtimes/platforms.

https://docs.flatpak.org/en/latest/using-flatpak.html#system-versus-user

I think this is how to install for user.

flatpak remote-add --user flathub-beta https://flathub.org/beta-repo/flathub-beta.flatpakrepo
flatpak install --user flathub-beta com.georgefb.haruna
flatpak run --user --branch=beta com.georgefb.haruna
dpalacio commented 3 years ago

Thank you! I didn't know about user/system. I had used flatpak with Discover at first but switched to console to install Haruna beta.

The popup you added is perfect. However, I have noticed a few things:

  1. Haruna will sometimes resume playback without user input. I've seen it happen a few times when the resume time is very short, like a few seconds.
  2. The popup will go away and the player resume playback when you ignore it and click on the menus.
  3. Previously I had used Debian's provided Haruna packages and now I am running it from flathub's and, in the latter, there are no icons visible.

I've seen other video players that have this feature that start playback at once from the beginning and jump to the resume point when asked to. I merely suggest to do similar and start playing the video immediately from the start, instead of doing nothing when asked to to play a video. In case this is done, the popup should fade out when ignored after some time.

dpalacio commented 3 years ago

Toggling the "Save file position" option will make the current video pause very briefly, like a stutter. A minor thing but worth to know it happens.

dpalacio commented 3 years ago

It is great that it doesn't try to save the last seen timestamp for the last ten seconds but it should also reset it in that case because, otherwise, Haruna will keep offering me to resume playback at 10 seconds before the end every time I've watched the video in its entirety. It also should ignore and reset the seen timestamp for the first 10 seconds.

g-fb commented 3 years ago

Haruna will sometimes resume playback without user input. I've seen it happen a few times when the resume time is very short, like a few seconds.

If resume position is less than 5 seconds it should start from 0, but I only disabled the popup.

The popup will go away and the player resume playback when you ignore it and click on the menus.

Playback is started when popup closes, clicking outside the popup closes it, so playback starts. I'll most likely change this.

Previously I had used Debian's provided Haruna packages and now I am running it from flathub's and, in the latter, there are no icons visible.

Do you have Use Breeze icon theme checked in Settings > General ?

Toggling the "Save file position" option will make the current video pause very briefly, like a stutter. A minor thing but worth to know it happens.

Some left over code from copy pasting. Fixed 783c06b12be283d5c3a2432dd803d1565bb3b9a2

It is great that it doesn't try to save the last seen timestamp for the last ten seconds but it should also reset it

Yes, that's how I'll do it.

It also should ignore and reset the seen timestamp for the first 10 seconds.

This I'm not so sure. Currently it ignores the first 5 seconds.

dpalacio commented 3 years ago

If resume position is less than 5 seconds it should start from 0, but I only disabled the popup.

It also should ignore and reset the seen timestamp for the first 10 seconds.

This I'm not so sure. Currently it ignores the first 5 seconds.

In this case it doesn't start from 0 in my experience. Please check these videos.

https://user-images.githubusercontent.com/12900/108854684-22023600-75b6-11eb-980a-9069014b2371.mp4

https://user-images.githubusercontent.com/12900/108854698-2595bd00-75b6-11eb-9fd9-733150c3bca1.mp4

Previously I had used Debian's provided Haruna packages and now I am running it from flathub's and, in the latter, there are no icons visible.

Do you have Use Breeze icon theme checked in Settings > General ?

Yes, I have it checked. It shows missing or a blank page icon. I unchecked it and then no icons appeared.

P.S. Is there a need to save the watched time every second? Why not do it on loading a different video or quitting only?

g-fb commented 3 years ago

If resume position is less than 5 seconds it should start from 0, but I only disabled the popup. This I'm not so sure. Currently it ignores the first 5 seconds.

In this case it doesn't start from 0 in my experience. Please check these videos.

I know, that is how I wanted it to work, I just forgot to reset the position.

Is there a need to save the watched time every second?

Because there can be crashes, power outage.

Regarding icons, I don't know. I tested on openSUSE TW Gnome and Ubuntu 20.10 Mate and it was fine.

dpalacio commented 3 years ago

I know, that is how I wanted it to work, I just forgot to reset the position.

Ah, ok. I didn't understand before.

Because there can be crashes, power outage.

These are such rare occurances that I don't think one should handle or even consider them. Crashes ought to be fixed and power outages are a bigger problem. Besides, I don't know how much of an issue it is, but it may also be worth to consider physical media wear, like a solid state device.

Regarding icons, I don't know. I tested on openSUSE TW Gnome and Ubuntu 20.10 Mate and it was fine.

I believe you. I'll have to figure what's wrong on my side.

g-fb commented 3 years ago

These are such rare occurances

For some maybe. But not for me. Every time there a little storm my power goes out multiple times.

Crashes ought to be fixed

Again my case, GPU used to crash a lot in the past, at least once a day.

consider physical media wear, like a solid state device

Yeah, that might be something to consider.

g-fb commented 3 years ago

I updated the beta:

But I'm not sure whether to keep the popup or remove it.

dpalacio commented 3 years ago

popup only closes when one of the buttons is clicked

Perfect

popup buttons can be triggered with enter

Very nice

position is saved only between first 5 and last 10 seconds

I don't agree with these thresholds but it's a matter of preference.

position is reset when current position enters last 10 seconds

Great!

But I'm not sure whether to keep the popup or remove it.

Uhh, wait, what? Do you mean the popup you added for this issue? Do you have some different solution in mind?

For some maybe. But not for me. Every time there a little storm my power goes out multiple times.

I live in a similar situation. Please don't think I don't understand it.

g-fb commented 3 years ago

I don't agree with these thresholds but it's a matter of preference.

What do think would be better?

Uhh, wait, what? Do you mean the popup you added for this issue?

Yes, I don't think it's really needed. Now that it can be turned off and reset, are there situations when you want to restart the video instead of resuming it? And even if there are it's easy to do with the mouse, click the progress bar and drag it to the start.

And I'm also thinking about adding ways to reset/clear the position when opening a new video (from the app). Like double middle click on a playlist entry clears the position for the current video before opening the new one, middle click on the prev next buttons in the footer, keyboard shortcut.

dpalacio commented 3 years ago

What do think would be better?

The relevancy of the resume time measure varies among different types of content. Let's think of some. Song videos, television episodes, movies, funny videos.

From my experience a typical length of a video can fit these ranges: Song video: 3-6 minutes Television episode: 22-40 minutes Movie: 5400-7200 minutes Funny video: 0.5 - 2 minutes

The resume video function is the most relevant for TV episodes and movies where searching for the correct time mark to continue watching can be a bad experience. On the other hand, song and funny videos are always best viewed from the starting point. For the latter, the resume playback feature can be said to be detrimental to the enjoyment and a distraction on what the user wants to do: "just play the fricking video".

Imagine I want to use Haruna to play music videos I have already played before and thus, have their previous playback time saved. For every single video I open, Haruna won't actually play the video but will ask me if I want to resume or reset. For every video I want to play I have to do two or more clicks in different places, once in the file manager and then in the video player, instead of only one. This is why I recommend for Haruna to immediately start playback from the beginning instead of asking what to do and block until it gets an answer.

I would say that in the context of long running time videos, say, 10 minutes or more, 5 seconds is negligible. But the initial and final time save reset offsets won't matter much if for the user experience the UI can be ignored and it isn't obstructive. I think that whatever UI is offered should be subtle, non blocking and ephemeral.

Yes, I don't think it's really needed. Now that it can be turned off and reset, are there situations when you want to restart the video instead of resuming it?

Yes, certainly. There are videos that you always want to watch from the beginning. Videos like songs, memes, cute animals, probably more I can't think of right now.

And even if there are it's easy to do with the mouse, click the progress bar and drag it to the start.

What solution hurts more, "a single click to resume" or "click, hold, drag, lift to restart"? I think it's evident it's the latter.

And I'm also thinking about adding ways to reset/clear the position when opening a new video (from the app). Like double middle click on a playlist entry clears the position for the current video before opening the new one, middle click on the prev next buttons in the footer, keyboard shortcut.

I don't think having to deal with this actively is useful or desirable. If you want to keep the priority on video playback resuming, fine by me, but please don't make it more complicated. I suggest to drop this feature request.

g-fb commented 3 years ago

How about instead of an on/off option, I add a input field and the feature will be enabled only for videos longer than the number set in the field. Save position for videos longer than: x minutes 0 - save for all videos 10 - save only for videos longer that 10 minutes 9999 - basically disabling the feature

Also keeping the reset during the last 10 seconds .

dpalacio commented 3 years ago

No, the on/off option is fine. The saving of the playback time for short videos isn't a problem, at all. The deal breaker, for me, is the little details around the feature, like blocking playback, saving too often, or saving too early. I propose you keep it simple and keep the original on/off setting and nothing more: "on" resumes the video without question like you prefer; and "off" starts playback from the beginning like mpv does. I think this is the simplest and prettiest compromise. I suggest to keep it off by default.

g-fb commented 3 years ago

I changed it to an input field (spinbox), I like this better.

saving too often

I don't think that's a problem. It writes ~25 bytes every second, that's ~2 MB for 24 hours.

Beta is updated if you want to test.