-
Notifications
You must be signed in to change notification settings - Fork 237
Open
Labels
Description
When initializing in description.js, all clickevents on document are removed instead of only the newly added one.
Specifically, this causes a problem with "collapse" in Bootstrap v4. Here it also listens to click on the document, which doesn't work after this function removes all click eventlistener on document. Line 198:
ableplayer/scripts/description.js
Lines 187 to 208 in b0635e8
| if (context === 'init') { | |
| // handle a click on anything, in case the user | |
| // clicks something before they click 'play' or 'prefs' buttons | |
| // that would allow us to init speech before it's needed | |
| $(document).on('click',function() { | |
| var greeting = new SpeechSynthesisUtterance('Hi!'); | |
| greeting.volume = 0; // silent | |
| greeting.rate = 10; // fastest speed supported by the API | |
| thisObj.synth.speak(greeting); | |
| greeting.onstart = function(e) { | |
| // utterance has started | |
| $(document).off('click'); // unbind the click event listener | |
| } | |
| greeting.onend = function(e) { | |
| // should now be able to get browser voices | |
| // in browsers that require a click | |
| thisObj.getBrowserVoices(); | |
| if (thisObj.descVoices.length) { | |
| thisObj.speechEnabled = true; | |
| } | |
| }; | |
| }); |
Reactions are currently unavailable