using the browser api speechSynthesis.resume() I'm trying to resume a paused speech on android chrome
I've tested the code below on chrome desktop version 78.0.3904.97 on mac os mojave and it resumes a speech without any problem after the speech is paused. But the same code can not resume a speech on android chrome version 77.x and 78.x
steps to reproduce
- run the code below
- press play to hear a speech
- pause the speech midway
- press resume
- speech is resumed on desktop chrome but not on android chrome
is this a bug in chrome?
<!DOCTYPE html>
<html>
<head>
<title>Parcel Sandbox</title>
<meta charset="UTF-8" />
</head>
<body>
<button id="play">Play</button>
<button id="pause">Pause</button>
<button id="resume">Resume</button>
<div id="data"></div>
<script>
const play = document.getElementById("play");
const pause = document.getElementById("pause");
const resume = document.getElementById("resume");
play.addEventListener("click", function() {
document.getElementById("data").innerText = "play";
var utterance = new SpeechSynthesisUtterance(
"1 2 3 4 5 6 7 8 9 10 11 12 13 14 15"
);
utterance.lang = "en-US";
speechSynthesis.cancel();
speechSynthesis.speak(utterance);
});
pause.addEventListener("click", function() {
document.getElementById("data").innerText = "pause";
speechSynthesis.pause();
});
resume.addEventListener("click", function() {
document.getElementById("data").innerText = "resume";
speechSynthesis.resume();
});
</script>
</body>
</html>