FooSoft / yomichan

Japanese pop-up dictionary extension for Chrome and Firefox.
https://foosoft.net/projects/yomichan
Other
1.07k stars 230 forks source link

Auto-play search result audio - playback issue #2055

Open grospoulpe opened 2 years ago

grospoulpe commented 2 years ago

Description It's been a while I've got that problem. When I scan a word (displaying the popup with all the corresponding definition), I can see a blue flash line on top, but no audio playback. Then I try again, no blue flash line (for an already scanned word), but then audio playback works for all words I scan in the current page. If I refresh the page, or go to another one: same problem; during the first scan, no audio play back. (but works on the next scan, or if I use a playback keyboard shortcut)

Browser version Chrome Version 97.0.4692.99 (Official Build) (64-bit) Microsoft Edge Version 97.0.1072.76 (Official build) (64-bit)

Yomichan version Yomichan 21.10.31.1

Exported settings file (If you think it might be relevant, create a settings export file using the Export Settings button on the settings page; zip or rename the resulting file to .txt to attach to the issue.)

archiif commented 2 years ago

I'm assuming you're using Auto-play search result audio? If so, I'm also having the same issue. You should consider renaming the issue's title for clarity.

I don't have an exact set of reproduction steps, but I think the bug behaves roughly like the way you described. Though in my case auto-play will also stop working randomly on other occasions, but I can't figure out an exact pattern.

toasted-nutbread commented 2 years ago

This may be due to the following error that occurs when trying to play audio:

play() failed because the user didn't interact with the document first. https://goo.gl/xX8pDD

Basically this error is indicating that the user is expected to interact with the webpage before anything is allowed to be auto-played. So if you click on the page before scanning, the sound should play. Otherwise this error will silently occur.

However, I don't think this has always been the case for Chrome extensions. This may be a bug/regression.

toasted-nutbread commented 2 years ago

This has been reported as a Chromium bug in https://bugs.chromium.org/p/chromium/issues/detail?id=1312816, tracked in #2107.