Comparing version 0.7.1 to 0.7.2
@@ -342,3 +342,3 @@ "use strict"; | ||
if (!(0, _utils.isPunctuation)(word)) { | ||
if (word && !(0, _utils.isPunctuation)(word)) { | ||
this.dispatchBoundary({ | ||
@@ -357,2 +357,3 @@ word, | ||
if (this.target instanceof HTMLAudioElement) { | ||
const target = this.target; | ||
this.target.addEventListener('ended', this.dispatchEnd.bind(this)); | ||
@@ -363,3 +364,3 @@ this.target.addEventListener('canplay', this.dispatchReady.bind(this), { | ||
this.target.addEventListener('error', () => { | ||
const error = this.target.error; | ||
const error = target.error; | ||
this.dispatchError(error?.message); | ||
@@ -371,6 +372,6 @@ }); | ||
// Polly Speech Marks use milliseconds | ||
const currentTime = this.target.currentTime * 1000; | ||
const currentTime = target.currentTime * 1000; | ||
const mark = this.getPollySpeechMarkForAudioTime(currentTime); | ||
if (!this.paused) { | ||
if (mark && !this.paused) { | ||
this.dispatchBoundary({ | ||
@@ -377,0 +378,0 @@ word: mark.value, |
{ | ||
"name": "tts-react", | ||
"version": "0.7.1", | ||
"version": "0.7.2", | ||
"description": "React component to convert text to speech.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
62069
1612