Is Chrome and Firefox do not load the change in media source?

爱⌒轻易说出口 提交于 2019-12-12 02:43:36

问题


I tried this code in IE10 it works fine but not in Chrome or Firefox, if we made a call directly for the Google tts API URL in the Chrome or Firefox browser, it works first time only and then it will only load the same text from the script, if any change for the submitted text has happened from the script, no reading will occur. see the example below please!

 <head>
    <script>
      // audio= new Audio();
        function playit() {
                var toread=document.getElementById('texttoread').value;
                 var audio = new Audio();
                audio.src = 'http://translate.google.com/translate_tts?rel=noreferrer&ie=UTF-8&tl=en&q='+toread;
          //      audio.load();
                audio.play();
        }
    </script>
</head>
<body>
    <input id="texttoread"
        type="text" 
        value="say" 
    />
    <input 
        type="button" 
        value="say hi" 
        onclick="playit()"
    />

</body>

If any one can tell, that the incoming media will be saved to some sort of file or cashed, and this data somehow not directly rewritable again, what i believe is must be some kind of reset or clear.

来源:https://stackoverflow.com/questions/22242155/is-chrome-and-firefox-do-not-load-the-change-in-media-source

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!