I have noticed firefox is not performing responsivevoice's playback sometimes. So i decided to review responsivevoice.js code. And the conclusion was firefox doesn't like audio.src="" when it is already set.
NS_ERROR_DOM_INVALID_STATE_ERR (0x8053000B)
An attempt was made to use an object which is no longer usable.
And temporary workaround was this. I will contact responsivevoice and notify them about this issue. Until then we can use this function.
function responsiveVoiceFix (rv) {
var orgiFallback_audioPool_getAudio = rv.fallback_audioPool_getAudio;
rv.fallback_audioPool_getAudio = function () {
if (rv.fallback_audiopool_index >= rv.fallback_audiopool.length) {
rv.fallback_audiopool = [];
}
return orgiFallback_audioPool_getAudio.apply(this, arguments);
}
var origClearFallbackPool = rv.clearFallbackPool;
rv.clearFallbackPool = function () {
_.each(rv.fallback_audiopool, function (audio) {
audio.pause();
});
rv.fallback_audiopool = [];
return origClearFallbackPool.apply(this, arguments);
}
}
I have noticed firefox is not performing responsivevoice's playback sometimes. So i decided to review responsivevoice.js code. And the conclusion was firefox doesn't like
audio.src=""
when it is already set.And temporary workaround was this. I will contact responsivevoice and notify them about this issue. Until then we can use this function.
ResponsiveVoice version "1.5.8"