You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. how can I set aria-live off or completely remove the attribute?
I am live-loading a list of videos. When the player's DOM is read, the accessibility tool reads/enunciates all the new play buttons.
I've been trying the following and it works on Windows and Linux but not for Safari on MacOS using NVDA.
import * as React from 'react';
import * as PropTypes from 'prop-types';
import videojs from 'video.js';
export default function VideoJs({ onReady, options, srcObject, videoTitle }) {
function removeAriaLiveFromControlButtons(playerRef){
const playToggleContentTextElement = playerRef.current.getChild('ControlBar')
.getChild('playToggle').el().lastChild;
playToggleContentTextElement.removeAttribute('aria-live');
}
React.useEffect(() => {
// Make sure Video.js player is only initialized once
if (playerRef.current == null) {
const videoElement = document.createElement('video-js');
videoRef.current.appendChild(videoElement);
playerRef.current = videojs(videoElement, options, () => {
onReady && onReady(playerRef.current);
});
if (srcObject) {
playerRef.current.tech().el().srcObject = srcObject;
playerRef.current.tech().el().play();
} else {
playerRef.current.src(options.sources);
}
} else {
// Add aria-label with the video title to the play button
playerRef.current.controls(options.controls);
removeAriaLiveFromControlButtons(playerRef);
}
}, [options, videoRef]);
...
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi. how can I set aria-live off or completely remove the attribute?
I am live-loading a list of videos. When the player's DOM is read, the accessibility tool reads/enunciates all the new play buttons.
I've been trying the following and it works on Windows and Linux but not for Safari on MacOS using NVDA.
Thank you so much.
Beta Was this translation helpful? Give feedback.
All reactions