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

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

Open
milkmuffin opened this issue Aug 12, 2023 · 2 comments
Open

Comments

@milkmuffin
Copy link

milkmuffin commented Aug 12, 2023

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

  • (optional) Open a "Guest" session in Chrome
  • Freshly load the website with the Webamp player. Ensure you don't click anywhere
  • If no files exist in the playlist, drag one in. (Note: It must be dragged and not added via another button)
  • Double click on an item in the playlist
  • Verify that the track appears in the Main Window but appears to be stuck at 00:00; does not play and no audio is playing
  • Click anywhere else on the screen and then verify that the music begins the play (Pressing a key also appears to start the music)

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
Copy link
Author

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
Copy link
Author

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

  • go to "Site settings" by clicking to the left of the hostname
  • Scroll down and find "Sound" and change this from "Automatic (default") to "Allow"

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

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

No branches or pull requests

1 participant