th-ch / youtube-music

YouTube Music Desktop App bundled with custom plugins (and built-in ad blocker / downloader)
https://th-ch.github.io/youtube-music/
MIT License
7.01k stars 427 forks source link

[Bug]: Plugin 'Ambiant Mode' #1641

Open KLalamex59 opened 5 months ago

KLalamex59 commented 5 months ago

Preflight Checklist

YouTube Music (Application) Version

3.2.2.0

Checklists

What operating system are you using?

Windows

Operating System Version

Windows 10 22H2

What arch are you using?

x64

Last Known Working YouTube Music (Application) version

No response

Reproduction steps

  1. Enable the plugin 'Ambiant Mode'.
  2. Play a song (working).
  3. Play a video (not working, need to disable/re-enable the plugin to make it work).

Expected Behavior

Reloading the plugin whenever links change might potentially resolve this issue, although I don't consider it an optimal optimization technique.

Actual Behavior

When the 'Ambient Mode' plugin is activated, it doesn't funtion properly when playing music with a video clip; it only works for songs without videos.

Enabled plugins

  1. Adblocker (In Player)
  2. Ambient Mode
  3. Blur Navigation Bar
  4. Captions Selector
  5. Compact Sidebar
  6. Discord Rich Presence
  7. Downloader
  8. In-App-Menu
  9. Lyrics Genius
  10. Music Together [Beta]
  11. Navigation
  12. Picture-In-Picture
  13. Playback Speed
  14. Precise Volume
  15. Skip Disliked Songs
  16. Taskbar Media Control
  17. Video Quality Changer
  18. Video Toggle

image

Additional Information

No response

JellyBrick commented 5 months ago

YouTube_Music_5ZKgoRU6Cb

It seems works

KLalamex59 commented 5 months ago

😴😴😴😴 image

Hadeik commented 4 months ago

https://drive.google.com/file/d/1fRATLaTWVXDJKBBgXFNcQIv18cWrnA98/view?usp=drive_link I have the same issue. this link is to video i google drive. (Windows 11 23H2 x64)

ArjixWasTaken commented 4 months ago

You can directly upload videos to GitHub, is your video so big that the upload fails? (also, the shared link is locked and it wants me to ask for access)

Hadeik commented 4 months ago

First yes it is too big 20MB (LIMIT 10) And second i gave everyone with link Access.

KLalamex59 commented 4 months ago

https://drive.google.com/file/d/1fRATLaTWVXDJKBBgXFNcQIv18cWrnA98/view?usp=drive_link I have the same issue. this link is to video i google drive. (Windows 11 23H2 x64)

Yeah i've the same... Now we just have to wait for him to decide to change "cannot-reproduce" 🤣🤣

frostybiscuit commented 3 months ago

I've had the same issue on my end and decided to tinker with it for a bit. I ended up getting it to work by reworking the plugin a bit and using CSS purely for positioning and sizing instead of JS calculations. It also fixes the issue where the ambient size is broken after switching to the mini-player and back. I have the branch ready locally, I would only need to get the permission to publish my branch and create the PR.

ArjixWasTaken commented 3 months ago

Just make a fork and open the PR?

frostybiscuit commented 3 months ago

Yeah, I might just do that. I don't have much free time lately but I'm sure I can get to do that sometime soon.

craftgeil commented 2 weeks ago

I have the same problem. Tried it with a completly fresh installtion, without any changes, besides enabling Ambient Mode.

Songs with static images work after a restart:

grafik

Songs with videos do not work after a restart:

grafik

Edit:

After some testing and experimenting, I found out that in the plugin "ambient-mode -> index.ts" const video = songVideo?.querySelector<HTMLVideoElement>('.html5-video-container > video'); gets run, before the video could load, resulting it to be "null" and not passing the if-check.

grafik

grafik

I think this could be fixed by checking if it actually loaded or waiting a bit before running this piece of code.