-
Notifications
You must be signed in to change notification settings - Fork 872
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Autoplay time limit #5871
Autoplay time limit #5871
Conversation
I know this pull request is still in draft state, but I think I have a different understanding of the feature request, so I wanted to mention it now, so we can already start a discussion around it. In FreeTube we have 3 different types of auto play:
From reading the feature request and pull request description I would have expected this pull request to affect the later two settings, so that when the timer ends it finishes playing the current video and then just stays there. However the code in this pull request seems to target the first one, so when the timer ends it will finish playing the current video, go to the next one and then stop there. That means when the timer expires, it still does a bunch of work to get the new data and process it, updates the UI, downloads new images. Loading the next video also means that it is likely to get marked as watched. |
That is indeed a fair interpretation and set of implications. My main consideration with modifying the autoplay setting (qua the second / third definitions) was that I didn't want to disable the persistent setting on this condition, and I was thinking that such a feature would necessitate us implementing the ability for non-permanent settings modifications, although I realize now that we could instead achieve this logic by a |
Handling it in Watch.js sounds like the best solution, you don't even need to change the logic in |
i.e., instead of 'start video automatically' autoplay
128f12a
to
fbe14dc
Compare
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
…at/time-limited-autoplay
Conflicts have been resolved. A maintainer will review the pull request shortly. |
One issue i see with this is the following case: Slider is set to 3hrs
Yeah i know you can move the slider but that isnt the issue here. Some people might not want this feature be on by default with no way for it to turn off. |
If the problem is the "people will complain about the default before checking the settings" issue like we had with the play button, I can change the default to 4 or even 5 hours. There's no one-size-fits-all default necessarily, because you run into a balancing issue of the % of people who are bothered by their videos going on too long while they're asleep / AFK versus the % of people who want to watch back-to-back 3+ hour videos without any pausing, adjusting fullscreen, changing the audio level, etc. I still think 3 is the closest magic number from my guesstimate, but open to hearing your opinion. To your latter concern, if we get a singular user for whom the max of 12 hours without user interaction is too small, we can talk once they make an issue for it; but our concerns should be proportional to # of affected users and degree of affectedness, and both of those metrics are quite small in this case. |
src/renderer/views/Watch/Watch.js
Outdated
@@ -1233,6 +1246,12 @@ export default defineComponent({ | |||
return | |||
} | |||
|
|||
if (this.blockVideoAutoplay) { | |||
showToast(this.$t('Canceled next video autoplay due to inactivity')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should stay visible for longer (1 hour?)
New users (new to this setting) will take time to realize the playlist is stopped and switch back and wondering why it's stopped
Also the text should mention the setting name if possible, but at least should include the value (e.g. 3h)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks better
3_600_000 | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am surprised that linter is ok with this o_0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It not only tolerates it: it enforces it to be like that. ¯\(ツ)/¯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason that is happening is because showToast(
and this.$t(
are both on the same line, so the linter sees this.$t
as having one level of indentation and showToast
as having none. That is why it forcing 3_600_000
and )
to have no indentation.
Moving this.$t
to its own line fixes the issue, as then the linter allows them both to have indentation:
It would also improve the general readability of that code snippet if the placeholder name in the translation string weren't so long e.g. {hours}
would already suffice, as there is only one placeholder in that string and there is enough context in the string and the code where it is used, to understand what the purpose of the placeholder is.
However as both things are stylistic issues and don't influence the functionality of the code, we can leave the cleanup for some future pull request.
Agreed. Also
Did i do something wrong? |
Interesting, did you increase volume, touch any unrelated keys (e.g., F10), something like that at any point? I'd recommend replacing line 1630 with a shorter time period as per the PR description to make your testing experience a bit easier |
No i really didnt touch my machine for more than an hour |
@efb4f5ff-1298-471a-8973-3d47447115dc Cannot replicate for recommended videos autoplay, user playlist autoplay, or remote playlist autoplay. I added logging statements on lines 1670 and 1671 of Watch.js as well, and did not see any unexpected behavior or condition triggering. If you could, replace this function in Watch.js as such to include these logging statements and see if you can replicate. This is using a 1s = 1hr time adjustment as well, but I tested at a smaller conversion rate and still could not replicate:
|
Silly question, but are you testing with autoplay enabled? The toast message is not intended to appear until the video ends. |
Yup autoplay is enabled.
ooooh my bad i interpreted this wrong. I thought the video would pause or something and show the toast message. I didnt know the video has to end first |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry about that, LGTM
3_600_000 | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason that is happening is because showToast(
and this.$t(
are both on the same line, so the linter sees this.$t
as having one level of indentation and showToast
as having none. That is why it forcing 3_600_000
and )
to have no indentation.
Moving this.$t
to its own line fixes the issue, as then the linter allows them both to have indentation:
It would also improve the general readability of that code snippet if the placeholder name in the translation string weren't so long e.g. {hours}
would already suffice, as there is only one placeholder in that string and there is enough context in the string and the code where it is used, to understand what the purpose of the placeholder is.
However as both things are stylistic issues and don't influence the functionality of the code, we can leave the cleanup for some future pull request.
Thanks GitHub for duplicating the comment lol. |
* Implement timer for next video to not play automatically * Update implementation to block next video autoplay i.e., instead of 'start video automatically' autoplay * Update variable name and add keyboard handling for ending timeout * Change autoplay timeout message to be more descriptive, and increase duration to 1 hr
Autoplay time limit
Pull Request Type
Related issue
closes #4270
Description
Implements time-limited autoplay feature which prevents the next video from playing automatically after X hours of 0 click or keydown events. This is set to a default of 3 hours, but it can be configured to be up to 12. This timer resets back to the start for every click or keydown event made at any time in the window. The closely related
Next Video Interval
EN-US label is also renamed toAutoplay Countdown Timer
to minimize user confusion regarding its meaning.This feature will be nice for folks like me who occasionally fall asleep to videos and have to reset watch history for a good chunk of them. It should also reduce net power draw and bandwidth expenditure for asleep or otherwise AFK users who neglected to hit the pause button.
To preemptively answer the question of "why not allow infinity," I don't think allowing indefinite automatic streaming regardless of user interaction is ever a desirable state for 99+% of our users. The default of 3 hours without any detected click or keyboard activity is a fine sweet spot for minimizing streaming to sleeping/AFK users, much more generous than YouTube's or Netflix's, to name a couple of similar examples. 12 hours of total inactivity before blocking autoplay should be more than enough for users with very particular edge cases.
Testing
Watch.js
:FreeTube/src/renderer/views/Watch/Watch.js
Line 1630 in 27f59e0
Desktop