-
Notifications
You must be signed in to change notification settings - Fork 230
Description
Describe the bug
When using audio descriptions that start at 00:00:00.000, the text to speech API will read the text without the video actually playing. Also, when browsing a video, if a audio description is found at that time frame, the text to speech API will be triggered and the video will also start playing automatically.
Version tested
Which version of AblePlayer are you reporting against?
- Main (the current release)
v4.7.0
To Reproduce
Steps to reproduce the behavior:
- Go to https://ableplayer-poc.vercel.app/ using Firefox 144.0 (only tested on MacOS 26.0 (25A354))
- Click on the D)) button and refresh the page.
- The audio description will start playing without playing the video. Sometimes the video will also automatically start playing.
Expected behavior
I would expect the audio description to only start playing when the video is playing.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
OS: MacOS 26.0 (25A354)
Browser: Firefox 144.0 (Chrome has it's own issues with the text to speech API unfortunately)
Additional context
I've fixed the problem by adding an extra check to the AblePlayer.prototype.showDescription method:
if (!this.hasClosedDesc || this.swappingSrc || !this.descOn || ( this.descMethod === 'video' && !this.prefDescVisible ) || !this.playing) {
return;
}Add the !this.playing conditional to only trigger the text to speech API when playing the video. I've not thoroughly checked for side effects. I think you are better able to do this. As far as I have tested is seems to be an improvement.
The VTT file that is used for the audio description (note the first line starting at 00:00:00.000):
WEBVTT
00:00:00.000 --> 00:00:01.051
[Vrouwelijke presentator met microfoon buiten op straat]
00:00:10.490 --> 00:00:10.990
[Waterschapper Roy]
00:00:29.350 --> 00:00:29.852
[Je ziet een gracht en diagonaal over de breedte van de gracht zijn luchtbellen zichtbaar in het water. Afval dat daardoor bijeen wordt verzamelt wordt door twee waterschappers op een boot uit het water gevist]
00:00:38.249 --> 00:00:40.249
[muziek en in beeld waterschappen.nl]