Skip to content

media-time-display aria-description is incorrect when no time has elapsed #1299

Description

@hannahb-cogapp

Description of Issue

The aria-description for media-time-display is incorrect when the audio player first loads and the elapsed time is zero, it read " of 48 minutes, 10 seconds" instead of the more helpful "0 seconds of 48 minutes, 10 seconds":

Image

Bug

The bug is on (line 49 of time.ts)[https://github.com/muxinc/media-chrome/blob/main/src/js/utils/time.ts#L49]

timeUnitValue && is a falsy check so if the value is 0 the condition isn't met and timeString is left as ""

Suggested Fix

Change the return statement on line 61 of time.ts to return timeString || toTimeUnitPhrase(0, 2);

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions