admin管理员组

文章数量:1538724

谷歌浏览器不能自动播放,自调用不管用

<input  onclick="yuyin()" type="button">  
//点击可以播报
<script>
      var map = new SpeechSynthesisUtterance("学无止境");
        var yyerror = new SpeechSynthesisUtterance("我爱学习")
        function yuyin() {
            speechSynthesis.speak(map)
        }
        yuyin()

    </script>


解决办法在鼠标右击Chrome快捷图标=>属性=>快捷方式=>目标加入--autoplay-policy=no-user-gesture-required即可,如下图所示:

 

mac打开终端,输入

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --autoplay-policy=no-user-gesture-required

本文标签: 语音浏览器