From b25f024a04aacd4151ea49650b32cbe0b722d542 Mon Sep 17 00:00:00 2001 From: Gary Katsevman Date: Fri, 7 Sep 2018 08:56:11 -0700 Subject: [PATCH] fix: make sure all attributes are updated before applying to tag (#5416) Fixes #5309 --- src/js/player.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/js/player.js b/src/js/player.js index 17168f8f8..f8d8d2552 100644 --- a/src/js/player.js +++ b/src/js/player.js @@ -591,18 +591,28 @@ class Player extends Component { // set tabindex to -1 to remove the video element from the focus order tag.setAttribute('tabindex', '-1'); + attrs.tabindex = '-1'; + // Workaround for #4583 (JAWS+IE doesn't announce BPB or play button) // See https://github.com/FreedomScientific/VFO-standards-support/issues/78 // Note that we can't detect if JAWS is being used, but this ARIA attribute // doesn't change behavior of IE11 if JAWS is not being used if (IE_VERSION) { tag.setAttribute('role', 'application'); + attrs.role = 'application'; } // Remove width/height attrs from tag so CSS can make it 100% width/height tag.removeAttribute('width'); tag.removeAttribute('height'); + if ('width' in attrs) { + delete attrs.width; + } + if ('height' in attrs) { + delete attrs.height; + } + Object.getOwnPropertyNames(attrs).forEach(function(attr) { // don't copy over the class attribute to the player element when we're in a div embed // the class is already set up properly in the divEmbed case