revblaze / AppleMusicUltra

Music Client for macOS. Upgrade your music experience with themes, styles, custom scripting and more. Uses WebKit and JavaScript.
398 stars 15 forks source link

MEDIA_KEY: [object Event] #6

Open programmhenry opened 4 years ago

programmhenry commented 4 years ago

After each song this message appears twice.

revblaze commented 4 years ago

Hey @programmhenry, how is the message presenting itself? Is it an alert or is it appearing in the console, etc.? I'll check it out, send a screenshot if possible – would be super helpful!

programmhenry commented 4 years ago

Screenshot 2020-04-14 at 12 46 24 Screenshot 2020-04-14 at 12 46 29

programmhenry commented 4 years ago

When I click on a song it starts and these two alters appear and every time a new song starts

revblaze commented 4 years ago

Super strange, I haven't come across this one yet. Is it specific to certain albums or does it appear with every song? Try out the build I just pushed and let me know if this continues to happen. I cleaned up a lot of the JavaScript code in the latest release.

Do any errors or bugs come with that alert? Or is the alert simply presenting itself – twice – upon every new song?

Regardless, sounds like a super annoying bug. If this continues to occur, I'll push out a hot fix that silences those alerts (forces them not to appear) until I figure out what's going on.

revblaze commented 4 years ago

EDIT: Oops, didn't mean to close this issue.

programmhenry commented 4 years ago

These two messages appear with each song. Since you are using WebKit I have tried something: I went to beta.music.apple.com and started a song there and see: Also there this error message appears every time.

revblaze commented 4 years ago

So the source – Apple Music Web Player Beta – is presenting the same alerts? In the meantime, I'll setup a listener for alerts that contain the title MEDIA_KEY: [object Event] and disable them from presenting themselves.

It's hard to debug this issue without being able to replicate it myself. Again, in the meantime, I'll create a workaround by mimicking the alerts that you are receiving and have them silenced upon prompt. You shouldn't notice it after that. Will update this issue when I get time in-between studying.

Let me know if you have any new developments on your end!

revblaze commented 4 years ago

UPDATE: Apple just took their Web Player out of beta and have seemed to fix a number of bugs. Clear your browser cache – maybe also restart your machine – and let me know if this issue isn't fixed.

I'm currently in the process of migrating Ultra for Music over to the new out-of-beta module. Will have to do some major restructuring.

programmhenry commented 4 years ago

I cleared my cache and restarted my machine. The Problem stays.

programmhenry commented 4 years ago

I tested the music.apple.com Website in Chrome and there isn´t the Problem

programmhenry commented 4 years ago

Screenshot 2020-04-21 at 21 08 50 This is what I get from the console in Safari

revblaze commented 4 years ago

Funny, Apple is building their web player with dedicated support for Safari. 3rd-party browsers are all using the industry web standards (disabled -webkit-blur effects, etc). Some of their experimental features must still be problematic with WebKit. Will look into the differences between the two (Safari and 3rd-party) and see if I can create a soft medium between the two.

programmhenry commented 4 years ago

Could you fix the problem?

grumero commented 4 years ago

You are on a Mac or Hackintosh?

revblaze commented 3 years ago

I've managed to silence the issue as a temporary workaround with the current build I'm developing of the new release, as it appears the error doesn't actually affect functionality. Although I haven't run into the issue since, I do remember that it forced the playback to either stop or restart entirely. I'll attempt to debug the issue. In the meantime, I've added additional checks to ensure playback will not be interrupted when this alert is silenced. I will be releasing the code should shortly. 🍻

The addition of TypeSwift in the coming release will allow me to debug and fix these issues in a more timely manner (the next time it occurs). See issue #11 for additional information (to be updated).