-
Notifications
You must be signed in to change notification settings - Fork 557
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
Fix loadeddata/metadata video events rarely not firing (+other small fixes) #477
Fix loadeddata/metadata video events rarely not firing (+other small fixes) #477
Conversation
b279b99
to
6dbed73
Compare
(We spent 9 hours. And he couldn't play Forza Horizon 5 for this period. Just saying :p) |
035bd56
to
6726e26
Compare
68f556d
to
8c5ac17
Compare
@th-ch This PR should probably be merged before the others to allow fixing merge conflicts if needed Also would be nice if you could add me on Discord |
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 good, thanks for the improvements! ✅
Fix #473
I've been testing stuff with @FiestaLake over on discord
it seems some users had a bug with the video events:
dataloaded
ormetadataloaded
not firing, and also thevideo.src
property wasn't changing,this PR makes use of the api's
videodatachange
event (specifically when its internal name isdataloaded
) and populates it on the video element so that it can be accessed easily with the newsrcChanged
video event(This allows plugins to know when a new video started in a bug free way)
this PR also change the way songInfo send callbacks (page-title update was messy, would send alot of updates for no reason)
now songInfo is sent everytime playback is started and
isPaused
+elapsedSeconds
are updated when playback is paused\unpaused\seekedOther small included fixes
fix a grey thumbnail issue that occasionally occurred in video-toggle plugin because the
thumbnail.src
was overridden by the website after it was set programmatically (fixed using a mutation observer)fix weird aspect ratio of thumbnail in song-info and video-toggle using
url.split("?")[0]
to filter query from thumbnail-url that resulted in cropped thumbnails(only when a video is present and the url is
i.ytimg.com/vi/videoid/quality.jpg?query
and not when the player is in song mode and the url islh3.googleusercontent.com/verylongid=w544-h544-l90-rj
)speed up sponsorblock plugin by using
ipcMain.on("video-src-changed")
instead ofregisterCallback()
(which is slower)185ebbf fix playlist downloading that was broken in last update (fix Error: No playlist ID found #497)
it also changes the default way of getting the playlistId to 'Currently-Shown-Playlist OR Currently-Playing-Playlist' (it was the other way around before which made less sense IMO)
fix disable-autoplay plugin for some people with slower internet, below is a short explanation of how it works:
youtube-music/plugins/disable-autoplay/front.js
Lines 3 to 12 in 92452f8
on video start 2 events are always sent,
dataloaded
first and thendataupdated
. the video tries to start between these 2 events and thats why it pauses on time update between them. (this is method is independent of internet speed)also its important to note that
dataloaded
is only happen on video load whiledataupdated
might happen at other times