Closed raszpl closed 1 week ago
hi! @raszpl
can start with if (this.storage.forced_play_video_from_the_beginning
, paused=
inside
2061
why not check !this.video_url.match(this.regex.video_time)
?
can start with
if (this.storage.forced_play_video_from_the_beginning
,paused=
inside
variable declarations on top of function are more readable, reading video?.paused is free, declaring empty let paused
just to fill it inside condition is more typing :)
why not check
!this.video_url.match(this.regex.video_time)
?
because "reverting implementation of https://github.com/code-charity/youtube/issues/2061 , bad idea, YT internally uses same parameter markers so we cant really distinguish between YT resuming and someone opening link with timestamp"
We can either respect forced_play_video_from_the_beginning
on all videos or users will complain its not working in some situations. It still fails sometime as explained in the Edit :( the later its being executed the more reliable it is, but at the cost of annoying jump if Autoplay is enabled. Bet option is to work on fully reliable autoplayDisable, I already have something almost working.
hi @raszpl,
youtube will add the t= parameter to the URL bar? under which circumstance? (then can keep !this.video_url.match(this.regex.video_time), when navigation to get there happened through a link or bookmark.) (and i'm just applying the principle of preparing for later, "hoarding comments & code. While Developer time is our only limit but this project might have double the meanningful code sooner than the "existing half" took https://github.com/code-charity/youtube/issues/2233#issuecomment-2090845175 )
youtube will add the t= parameter to the URL bar? under which circumstance?
https://github.com/code-charity/youtube/issues/2061#issuecomment-1985100295
wait, what is "#t=" ? Where did you saw "#t" usage? # (hash) is used for anchor navigation in links. Please post code links, those images are to "private-user-images" and often dont render at all :(
reverting implementation of https://github.com/code-charity/youtube/issues/2061 , bad idea, YT internally uses same parameter markers so we cant really distinguish between YT resuming and someone opening link with timestamp
this.elements.player.seekTo(0) rewinds, but with side effects of triggering play()
switch from this.elements.player.seekTo(0) to this.elements.video.currentTime = 0 didnt work. YT player actually reads currentTime and will hang while hammering currentTime(whatever) if it doesnt get what it wants :0. Back to seekTo(0) with optional check for paused.
Edit: further testing shows
video wont play at all and console shows
YT knows something is wrong and keeps trying :(
To make forcedPlayVideoFromTheBeginning reliable it would have to either trigger way late causing annoying rewind every time, or finally make autoplayDisable reliably stop without playing a single frame. Second option seems better.