Skip to content

Commit

Permalink
Fix(mwpw-160681| MWPW-163031): Video accessibility for text long form. (
Browse files Browse the repository at this point in the history
#3619)

* new event added for autoplay videos

* combining the fixe for 163031
  • Loading branch information
sharath-kannan authored Feb 19, 2025
1 parent bc066ff commit 30374d3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion libs/blocks/adobetv/adobetv.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { createTag } from '../../utils/utils.js';

export default function init(a) {
a.classList.add('hide-video');
const bgBlocks = ['aside', 'marquee', 'hero-marquee'];
const bgBlocks = ['aside', 'marquee', 'hero-marquee', 'long-from'];
if (a.href.includes('.mp4') && bgBlocks.some((b) => a.closest(`.${b}`))) {
a.classList.add('hide');
if (!a.parentNode) return;
Expand Down
1 change: 1 addition & 0 deletions libs/utils/decorate.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ export function applyAccessibilityEvents(videoEl) {
pausePlayWrapper.addEventListener('keydown', handlePause);
}
if (videoEl.hasAttribute('autoplay')) {
videoEl.addEventListener('canplay', () => { videoEl.play(); });
videoEl.addEventListener('ended', () => { syncPausePlayIcon(videoEl); });
}
}
Expand Down

0 comments on commit 30374d3

Please sign in to comment.