JavaScript speechSynthesis.speak() without user activation is no longer allowed since M71

后端 未结 6 1076
失恋的感觉
失恋的感觉 2021-01-11 11:15

I used speechSynthesis API in this way:

speechSynthesis.speak(new SpeechSynthesisUtterance(\"hello world\"));

But right now I get error aft

6条回答
  •  再見小時候
    2021-01-11 11:32

    If you set your site address as "trusted" in chrome://settings/content/sound it seems to enable sound and speech synthesis even without user interactions.

    I use Chrome in a TV just as a system monitor, using kiosk mode and without any user interactions. It doesn't even have keyboard and mouse. Still, I was able to enable in some versions of Chrome/Chromium, but not in others.

提交回复
热议问题