-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: error-display #8529
fix: error-display #8529
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8529 +/- ##
==========================================
- Coverage 82.65% 82.50% -0.15%
==========================================
Files 113 113
Lines 7605 7661 +56
Branches 1828 1848 +20
==========================================
+ Hits 6286 6321 +35
- Misses 1319 1340 +21 ☔ View full report in Codecov by Sentry. |
@harisha-swaminathan visually, this modification has the same effect. However, I have a question about accessibility. Shouldn't there be a narrated feedback after each error? Before this modification, if the player had focus and several errors occurred, there was a narrated feedback. Even if the feedback wasn't very descriptive, the user was informed that something had happened. This case can be tested as follows:
setTimeout(() => {
player.src('https://media-url.com/404.m3u8')
setTimeout(() => {
player.src('https://media-url.com/not-compatible.rtmp')
}, 15_000);
}, 10_000);
It is possible to provide a little more context on the error by modifying the script as follows: videojs.dom.$('.vjs-error-display .vjs-modal-dialog-content').id = 'vjs-modal-content-id';
videojs.dom.$('.vjs-error-display').setAttribute('aria-describedby', `${videojs.dom.$('.vjs-error-display').getAttribute('aria-describedby')}, vjs-modal-content-id`);
setTimeout(() => {
player.src('https://media-url.com/404.m3u8')
setTimeout(() => {
player.src('https://media-url.com/not-compatible.rtmp')
}, 15_000);
}, 10_000); |
Thank you @amtins This, somehow, isn't a problem when voiceOver accessibility is used on Mac. However, I'm able to reproduce it with a screen reader extension. Do you think "aria-live: polite" can be user here instead? Added that in the latest commit and it seems to work as expected. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- This change seems to be inline with the existing visible UX. We may want to consider a solution in the future that would allow the user to see both errors in the player modal and not just the last one to be generated.
- Because we can't guarantee the timing between errors, it's quite possible that
aria-live: polite
here could result in both errors being announced by a screen reader but I think that might actually be preferable to only hearing about the latest error emitted.
Description
This recent change closes the error modal and opens it again inorder to ensure that the error display component is updated with the new error message when consecutive errors occur.
But when this is used with the videojs-errors plugin, no error is displayed after the second error occurs. This is because when the error display is closed after the second error, error is cleared and set to null here.
Specific Changes proposed
The suggested change is to just update the modal's content with the latest error message instead of closing and opening the error display.
Requirements Checklist