code-charity / youtube

[top~1 open YouTube & Video web-extension] Enrich your experience & choice! 🧰100+clever features📌set&forget📌Longest-standing(yet rare&tough alone. Please help/join🧩us👨‍👩‍👧‍👧) ..⋮ {playback|content discovery|player|extra buttons|distractions|related videos|shorts|ads|quality|codec|full tab|full screen}
http://improvedtube.com
Other
3.29k stars 499 forks source link

New feature: Disable video play on thumbnail hover #2315

Closed NikoboiNFTB closed 1 week ago

NikoboiNFTB commented 1 month ago

PROBLEM: Videos playing when hovering on thumbnail.

SOLUTION: Add option in General -> Thumbnails -> Disable autoplay on hover (for example)

ALTERNATIVES: I think that is the easiest option probably :D

RELEVANCE / SCOPE: I believe it would be. The default option could be "off" (vanilla youtube) but I think many people would like the feature. I don't see why anyone would want the video to start playing unless pressed.

"SIDE EFFECTS": I don't thinks so, possibly thumbnail buttons, but I doubt it. (I don't know any coding). Someone who might not want this feature could be someone who only watches short, 30 second or so videos, but if you only do that, watch shorts or tiktoks.

⚬ _CONTEXT_:

// Thank you!

SHORT Table (Summary)
Problem
Solution
Alternatives
Scope
Side effects
Context
ImprovedTube commented 1 month ago

hi! @NikoboiNFTB we got "Disable video playback on hover" (also compare: https://github.com/code-charity/youtube/issues/2225#issuecomment-2085136987 )

Let us know if we can improve structure and thus discovery of features (the static folders make limited sense, search & tags is more dynamic and we are free where to move, how to structure, how to group items, etc.)

raszpl commented 1 week ago

it doesnt work on search page:

https://github.com/code-charity/youtube/blob/85bf12458d10dbc15ab4d8da057da01b5d8e152d/js%26css/extension/www.youtube.com/general/general.js#L518-L531

looks for elem.matches("#content ytd-rich-item-renderer")

while on search page mouseenter event is bubbling thru

ytd-thumbnail.style-scope.ytd-video-renderer
div#dismissible.style-scope.ytd-video-renderer
ytd-video-renderer.style-scope.ytd-item-section-renderer
div#contents.style-scope.ytd-item-section-renderer
ytd-item-section-renderer.style-scope.ytd-section-list-renderer
div#contents.style-scope.ytd-section-list-renderer
ytd-section-list-renderer.style-scope.ytd-two-column-search-results-renderer
div#primary.style-scope.ytd-two-column-search-results-renderer
ytd-two-column-search-results-renderer.style-scope.ytd-search
div#container.style-scope.ytd-search
ytd-search.style-scope.ytd-page-manager
ytd-page-manager#page-manager.style-scope.ytd-app
div#content.style-scope.ytd-app
ytd-app
body
html
document

no match

works in subscriptions

...
ytd-rich-grid-media.style-scope.ytd-rich-item-renderer
div#content.style-scope.ytd-rich-item-renderer
ytd-rich-item-renderer.style-scope.ytd-rich-grid-row
...

probably should also look at #contents.ytd-item-section-renderer