zenorocha / voice-elements

:speaker: Web Component wrapper to the Web Speech API, that allows you to do voice recognition and speech synthesis using Polymer
http://zenorocha.github.io/voice-elements
1.36k stars 256 forks source link

voice-player crash the all app in firefox and all unsupported browsers #9

Closed jmorille closed 9 years ago

jmorille commented 10 years ago

In firefox, the code below throw a TypeError : this.speech is undefined

textChanged: function() {
                this.speech.text = this.text;
},

Some controls should be welcome in order to don't crash all app when this.speech is not initialize in created function. like

textChanged: function() {
    if ( this.speech) {
                this.speech.text = this.text;
   }
},
zenorocha commented 9 years ago

This should fix this problem: https://github.com/zenorocha/voice-elements/blob/master/src/voice-player.html#L29-L31

Thanks for reporting @jmorille!

zenorocha commented 9 years ago

And sorry for the delay :/