captbaritone / webamp

Winamp 2 reimplemented for the browser
https://webamp.org
MIT License
9.7k stars 640 forks source link

Dragging files and double clicking the playlist doesn't always play music #1227

Open milkmuffin opened 11 months ago

milkmuffin commented 11 months ago

This issue is not reproducible on Firefox.

This is reproducible in Windows 10 & Chrome/Brave on a website that has a low MEI. This is probably related to https://developer.chrome.com/blog/autoplay/ You can see a website's MEI score by viewing chrome://media-engagement/

Personally, I am also able to reproduce this on webamp.org because it has a low MEI score.

Reproduction Steps

In the developer console, the following warning appears: The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu

In Chrome, the easiest way to have no MEI is to either create a new profile or use a guest window.. Incognito apparently is not sufficient to reset MEI.

milkmuffin commented 11 months ago

I have confirmed that the same reproductions step work with a website that has a high MEI.

The following script might be helpful if you're trying to test the Webamp player on another host.

document.body.replaceChildren([]);
const app = document.createElement('div');
app.id = 'app';
document.body.appendChild(app);
const script = document.createElement('script');
script.src = "https://unpkg.com/webamp";
script.addEventListener('load', () => {
  const webamp = new Webamp();
  webamp.renderWhenReady(app);
  });
document.head.appendChild(script);
milkmuffin commented 11 months ago

If you have intention to go back to a particular site and your MEI is still not high, you can also:

Refresh the website and verify that you can now drag and drop files and immediately play media.