Skip to content
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

Video Toggle Plugin #448

Merged
merged 9 commits into from
Nov 1, 2021
Merged

Video Toggle Plugin #448

merged 9 commits into from
Nov 1, 2021

Conversation

Araxeus
Copy link
Collaborator

@Araxeus Araxeus commented Oct 24, 2021

Resolves #392 , Resolves #149

Adds a button that allow switching between video and "song" mode (show thumbnail instead of video)

forceHide in options makes this plugin behave like the old hide-video-player (hide the whole main panel)

Screenshots of the button in action:
Video
Song

Also refined some plugin's description

Copy link
Owner

@th-ch th-ch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, but when the video toggle is enabled ("song" mode), I get TypeError: Only absolute URLs are supported in

const getImage = async (src) => {
(src is undefined - possibly linked to the video being overridden?)

plugins/video-toggle/back.js Outdated Show resolved Hide resolved
plugins/video-toggle/back.js Outdated Show resolved Hide resolved
@@ -77,6 +77,10 @@ const defaultConfig = {
"music_offtopic",
],
},
"video-toggle": {
enabled: false,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: we could add a migration so that people who had the old plugin enabled have this one enabled in the new version.

@Araxeus
Copy link
Collaborator Author

Araxeus commented Nov 1, 2021

Looks good overall, but when the video toggle is enabled ("song" mode), I get TypeError: Only absolute URLs are supported in

const getImage = async (src) => {
(src is undefined - possibly linked to the video being overridden?)

How are you getting an error in song-info? This plugin doesn't even use it nor change any of its data 😵

Where is it originating from? Did that happen in every song or just a few?

@th-ch I cannot reproduce this. could you please check what happened?

my guess is either u tested the wrong branch, or there are some songs which data?.videoDetails?.thumbnail?.thumbnails?.pop()?.url isn't valid for (in that case I would love an example)

anyways I don't think that problem is actually related to this PR but I'd love to know how did it happen

@Araxeus
Copy link
Collaborator Author

Araxeus commented Nov 1, 2021

Ok I think I figured this one out too. you were playing a video with low resolution of artworks and so when it calls thumbnails.pop() it actually removes the last thumbnail...

@Araxeus Araxeus force-pushed the new-hide-video-player branch from 99c5859 to 363903d Compare November 1, 2021 20:59
+forced push fix woupsie
@Araxeus Araxeus force-pushed the new-hide-video-player branch from 363903d to 0287b69 Compare November 1, 2021 21:04
Copy link
Owner

@th-ch th-ch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! ✅ - I cannot reproduce the src bug anymore so it looks fixed 🎉

plugins/video-toggle/front.js Outdated Show resolved Hide resolved
@th-ch th-ch merged commit c592a26 into th-ch:master Nov 1, 2021
@Araxeus
Copy link
Collaborator Author

Araxeus commented Nov 1, 2021

@th-ch Oh I forgot to add , { once: true, passive: true } to the apiloaded listener

could you add that in please? :)

@th-ch
Copy link
Owner

th-ch commented Nov 1, 2021

Sure! The listener has been fixed in cee2e06 and the plugin migration done in 953d6fe :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants