mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Content server: Read aloud: Fix clicking on a word to skip reading aloud to that word causing word highlighting to stop working. Fixes #2086661 [When read aloud, highlight not synchronized](https://bugs.launchpad.net/calibre/+bug/2086661)
This commit is contained in:
parent
3e957aa58b
commit
e17ea5203a
@ -135,7 +135,10 @@ class Client:
|
||||
self.onevent('pause')
|
||||
|
||||
def speak(self, text):
|
||||
self.current_utterance = None
|
||||
ut, self.current_utterance = self.current_utterance, None
|
||||
if ut:
|
||||
ut.onstart = ut.onpause = ut.onend = ut.onerror = ut.onresume = None
|
||||
ut.removeEventListener('boundary', self.utterance_boundary_reached)
|
||||
if text and text.length:
|
||||
self.current_utterance = self.create_utterance(text)
|
||||
window.speechSynthesis.speak(self.current_utterance)
|
||||
|
Loading…
x
Reference in New Issue
Block a user