Skip to content

Commit b25f024

Browse files
authored
fix: make sure all attributes are updated before applying to tag (videojs#5416)
Fixes videojs#5309
1 parent 6d6bfd1 commit b25f024

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/js/player.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,18 +591,28 @@ class Player extends Component {
591591

592592
// set tabindex to -1 to remove the video element from the focus order
593593
tag.setAttribute('tabindex', '-1');
594+
attrs.tabindex = '-1';
595+
594596
// Workaround for #4583 (JAWS+IE doesn't announce BPB or play button)
595597
// See https://github.com/FreedomScientific/VFO-standards-support/issues/78
596598
// Note that we can't detect if JAWS is being used, but this ARIA attribute
597599
// doesn't change behavior of IE11 if JAWS is not being used
598600
if (IE_VERSION) {
599601
tag.setAttribute('role', 'application');
602+
attrs.role = 'application';
600603
}
601604

602605
// Remove width/height attrs from tag so CSS can make it 100% width/height
603606
tag.removeAttribute('width');
604607
tag.removeAttribute('height');
605608

609+
if ('width' in attrs) {
610+
delete attrs.width;
611+
}
612+
if ('height' in attrs) {
613+
delete attrs.height;
614+
}
615+
606616
Object.getOwnPropertyNames(attrs).forEach(function(attr) {
607617
// don't copy over the class attribute to the player element when we're in a div embed
608618
// the class is already set up properly in the divEmbed case

0 commit comments

Comments
 (0)