Skip to content

Commit 2bc810d

Browse files
authored
fix(player): ensure that JAWS+IE announces the BPB and play button (videojs#5173)
Freedom Scientific's recommended workaround for JAWS + IE not announcing the first button after a video element which doesn't have its own native controls (See FreedomScientific/standards-support#78). Fixes videojs#4583
1 parent f5a6e61 commit 2bc810d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/js/player.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import * as middleware from './tech/middleware.js';
3232
import {ALL as TRACK_TYPES} from './tracks/track-types';
3333
import filterSource from './utils/filter-source';
3434
import {findMimetype} from './utils/mimetypes';
35+
import {IE_VERSION} from './utils/browser';
3536

3637
// The following imports are used only to ensure that the corresponding modules
3738
// are always included in the video.js package. Importing the modules will
@@ -579,8 +580,15 @@ class Player extends Component {
579580
});
580581
}
581582

582-
// set tabindex to -1 so we could focus on the player element
583+
// set tabindex to -1 to remove the video element from the focus order
583584
tag.setAttribute('tabindex', '-1');
585+
// Workaround for #4583 (JAWS+IE doesn't announce BPB or play button)
586+
// See https://github.com/FreedomScientific/VFO-standards-support/issues/78
587+
// Note that we can't detect if JAWS is being used, but this ARIA attribute
588+
// doesn't change behavior of IE11 if JAWS is not being used
589+
if (IE_VERSION) {
590+
tag.setAttribute('role', 'application');
591+
}
584592

585593
// Remove width/height attrs from tag so CSS can make it 100% width/height
586594
tag.removeAttribute('width');

0 commit comments

Comments
 (0)