Tuesday, 15 July 2014

javascript - Web Speech crashes Safari iOS -



javascript - Web Speech crashes Safari iOS -

i'm working speech synthesis in mobile safari , have found unstable, when dom beingness manipulated during speaking. created simple test case crashes safari (or webview) on ios 7.1.1 on ipad (but runs fine on os x safari). have thought why next html page kill mobile safari?

<!doctype html> <html> <head> <title>speech bug</title> <script> function testfunc() { var elem = document.getelementbyid("textout"); var wordcount = 0, utterance = new speechsynthesisutterance("you'll notice safari on ios crash after clicking button several times."); utterance.onstart = function(event) { elem.innerhtml = ""; } utterance.onboundary = function (event) { elem.innerhtml += ++wordcount + "\n"; elem.scrolltop = wordcount * 22; } window.speechsynthesis.speak(utterance); } </script> </head> <body> <div id="textout" style="white-space: pre; font-size: 14pt; height: 100px; width: 50px; overflow: auto"></div> <button onclick="testfunc()">click fail</button> </body> </html>

javascript ios safari webspeech-api

No comments:

Post a Comment