Understanding Accessible Name Computation
lessonDuration 2m 17sFree
We'll use Chrome Dev Tools to understand where the accessible name comes and how the accessible name priority is computed depending on what attributes you use.
Browse
Find courses, lessons, articles, talks, and podcasts.
32 resources
Showing 1–24 · Page 1 of 2
lessonDuration 2m 17sFree
We'll use Chrome Dev Tools to understand where the accessible name comes and how the accessible name priority is computed depending on what attributes you use.
lessonDuration 5m 30s
We'll go over the work it takes to use ARIA to show why Semantic HTML is almost always the safer bet.
lessonDuration 39s
In this lesson, we use the element inspector in Chrome to test and improve our contrast to meet WCAG AA Contrast Ratio Standards. Resources: - [WebAIM - Contrast and Color Accessibility](https://webaim.org/articles/contrast/)
lessonDuration 1m 12sFree
lessonDuration 2m 16s
I suggest using the previously learned approach but keep in mind that it may lead to an overly complex markup. We also use the `aria-label` attribute, which can be used to override the text within a label element. **Think about:** Why would you use an `aria-label` instead of creating a visually hidden span?
lessonDuration 1m 52s
In this course, we'll be focusing on building an accessible component by using a built-in browser API with React to implement best practices in accessibility custom features. Everyone is responsible for accessibility, and we need to start creating features and websites with that in mind. The goal of this course is for you to exploit your understanding of HTML and aria, and be able to look at any common features and identify the different accessibility patterns. With this course you won't only learn about accessibility, but also will learn about `HTMLMediaElement` API, and state management in React.
lessonDuration 2m 51s
We will create two buttons labeled "rewind 15 seconds" and "fast forward 15 seconds." Then, we created two functions, `onRewind` and `onFastForward`, to adjust the current time of a media by 15 seconds. The `onRewind` function will use `Math.max` to ensure that the time does not go into negative, and the `onFastForward` function will use `Math.min` to set a max limit. These functions will be added to the click events of the corresponding buttons. Finally, it sets the new time for the media state and the audio reference. **Think about:** Why do you need the second parameter for `math.max` and `math.min`?
lessonDuration 3m 5s
React's `forwardRef` function allows a component to receive a ref that has been created outside of it. This can be useful in cases where you want to have a specific part of your component, such as a section of a long transcript or a specific part of an audio recording, referenced from outside the component. One example of when this might be useful is if you have a "listicle" type of audio, such as "5 things your tech resume needs", and you want to allow users to jump to specific parts of the audio. By converting the component to a forwarded ref component, you can create a ref in the parent component (in this case, the "App" component) and pass it into the audio component. This allows you to create a few buttons in the parent component that can control the audio ref and jump to specific audio sections. To convert a component to a forwarded ref component, you can use React's `forwardRef` function to wrap the component, and then remove the audio ref and replace all instances with the new ref. By doing this, you can now control the audio component, like play, pause and jump to a specific time, by interacting with the `audioRef` ref object created in the parent component and passed into the audio component. **Think about:** What ways to control the audio outside the component could help with accessibility?
lessonDuration 4m 49sFree
In this lesson we are going to create an `AudioPlayer` component that takes two props `src` and `transcript`, where it returns the audio element and renders the transcript, and we write some pseudo-code for the audio player to reference. **Think about**: What do we get for free with common HTML elements?
lessonDuration 4m 42s
We create an input range with a label, where the range is between 0 and 1 with a step of 0 - 1. The input's value should be determined by a ternary statement that checks if the volume is muted and sets it to 0 or to the current volume if not muted. An `onVolumeScrubberChange` function is also added that sets the volume to the event target value when the input value changes and updates the volume in the state and an audio reference. The `onVolumeChange` function does not need to be used and the logic needs to be adjusted to ensure that the volume can be updated and that it mutes when the volume reaches 0. **Think about:** Why do we have to add `audioRef.current.volume === 0` in addition to `audioRef.current.muted`?
lessonDuration 19m 26s
We are creating an accessible popup menu for a web application. It covers various concepts, including handling keyboard events, creating a new dropdown component for reuse, using arrow keys to navigate through buttons, using the Tab key to close the menu and go to the next item in the tab order, using the Escape key to close the menu and focus on the button that closes it, using the `aria-expanded` attribute to communicate whether the menu is open or closed, and the difference between the tab index values of 0 and -1. **Think about:** - Why tabindex -1? - Why would you use arrows versus tab key to navigate through the dropdown?
lessonDuration 1m 56s
In this lesson, we are creating a new state called `mediaTime` with an initial value of 0, updating sample text in the markup to display the value of `mediaTime`, and adding an event listener to the audio element for the `timeUpdate` event. In the `timeUpdate` event listener callback function, the `mediaTime` state is set to the audio element's current time, which can be accessed using the `audioRef.current.currentTime`. A function is added to the `onTimeUpdate` event of the audio element, to be able to track the current time. And a time formatter is added to format the time for displaying elapsed time and total time. **Think about:** How often does onTimeUpdate update? (every second, not every millisecond)
lessonDuration 1m 8s
In this lesson, we will create event listeners for the play and pause events on an audio player element and use these listeners to update the value of a variable called `isPlaying` that tracks the current state of the player (e.g., whether it is currently playing or paused). The event listeners, named `onPlay` and `onPause`, will be triggered when the user presses the play or pause button on the audio player element itself, not on a custom play button that may have been created.
course
- Web audio APIs include support for features that aren't available by default in the native HTML audio element. - The operating system includes basic controls - Custom controls must be accessible with a keyboard, and make sense to a screen reader - Don't hide the built-in controls until you know that your custom controls are working - Listening to what VoiceOver reads should inform the a11y information you include - VoiceOver says "Elapsed Time" on its own, so we wouldn't want to write it in our code. - `loadedmetadata` should have the duration to avoid glitches from new audio not being loaded. - Elements should be labeled with a unique `id`
lessonDuration 5m 55s
In this lesson, we are using HTML, accessibility concepts, and ARIA attributes to improve the time scrubber feature of an audio player. The goal is to make it accessible to users of screen readers so that the time scrubber announces the actual time (e.g. 12 minutes and 15 seconds) rather than just the value (e.g. 735). We are also creating a new folder called "helpers" in the "src" folder and a new file called "format time.js" within it to hold a function called "format human read time" that takes time as a parameter and returns the human-readable equivalent of that time. Additionally, the author debugs the code and uses console.log to check the variable. **Think about:** Why does a human-readable name help?
lessonDuration 4m 37s
In this lesson, we are creating the audio player interface more visually appealing using icons from the React Icons library and Font Awesome, in this process, we are also ensuring that the interface remains accessible to screen readers by providing text descriptions for the icons, first by using the `title` prop on each icon, and then by implementing a `visually hidden` technique that hides the text descriptions from sighted users but makes them available to screen readers. This involves copying and pasting some CSS code to create a visually-hidden class, adding an `aria-hidden` attribute to each icon, wrapping each icon in a React fragment, and then adding a `span` element above each icon with the corresponding text description and the `visually-hidden` class. **Think about:** - Why use `aria-hidden` or visually hide spans? - What value does this add to screen reader users?
lessonDuration 2m 55s
We are creating a toggle button for muting and unmuting an audio element using React hooks `useState` and `useRef`. It destructures `isMuted` from the `useState` hook and sets the initial state to false. The button's inner text is dependent on the state of `isMuted`, and a `toggleMute` function is created which sets `isMuted` to the opposite of its current state and also sets the `audioRef.current.muted` property to the opposite of `isMuted`. A `onVolumeChange` function is added to the audio element that sets the `isMuted` state based on the value of `audioRef.current.muted`. This allows the `isMuted` state to change even when the mute button on the audio element itself is pressed. **Think about:** - Why do we have to add `onVolumeChange` for instead of `onMuted`? - How can we use `onVolumeChange` to check for things being muted?
lessonDuration 1m 43s
We are creating a playback rate button in a React application. An array of rates is created, and each element of the array is mapped to a button. Each button is given an onClick handler that calls an anonymous function called `changeRate`. `changeRate` sets the playback rate of an audio element to the rate passed as an argument. When the button is pressed in the browser, it shows the new playback rate. **Think about:** We have all these states for volume, media time etc, why don't we have one for rate?
lessonDuration 2m 26s
We are creating an input of type range with an associated label, this input is to represent the current playback position in the audio, and the user will be able to change the playback position using the input. The input value is set to be the media time state, it is added a minimum value of 0 and a maximum value as the duration. The demonstration shows how the media time state updates accordingly when the user changes the time using the input range. A function called `onScrubberChange` is added, which takes in an event as an argument and `console.logs` the value of that event. The `onChange` event is added to the input, ensuring it works as expected. A variable sets the media time state and the current time on the audio ref. **Think about:** Why do we use the `event.target.value` to set the new `mediaTime` (reminder that the value of the range is bound to `mediaTime`....maybe take a look at that with the formatter)
lessonDuration 2m 15s
We created a duration state with an initial value of zero, then added an event listener to the audio element for the `loadedMetaData` event. In the event listener callback function, you set the duration state's value to be the audio element's current duration. This ensures that the value of the duration state is only set once the audio element metadata is loaded, allowing you to display the accurate total time of the audio file. **Think about:** Why do we need to set the duration on the `onLoadedMetadata` event? "The `onLoadedMetadata` event occurs when metadata for the specified audio/video has been loaded." You can read the docs [here](https://www.w3schools.com/tags/av_event_loadedmetadata.asp)
lessonDuration 2m 47s
We Introduce [MDN Media docs](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement) and all the APIs. In this lesson, we added the `useRef` and created an `audioRef` in our components. We also added the `ref` to the audio element to control it outside of the audio element. We use the `useState` hook, and we created an `isPlaying` state. And finally, we added a `button` that dynamically renders the text as pause and play depending on the `isPlaying` state. On click of that button, we toggle the `isPlaying` state, and depending on that state, we either pause or play it.
lessonDuration 2m 53sFree
In this video we are going to take the native HTML checkboxes and jazz them up while still ensuring they are keyboard accessible. We use pseudo-elements and pseudo-classes to replicate the focus and the ability to tab to custom checkboxes.
lessonDuration 1m 50sFree
We are going to use the the .filter() method on an array of countries so that we only return the country that matches a particular country code. This could be useful if you are in multinational organization and you want to return data only from that country's page.
lessonDuration 2m 18sFree
We talk about how to go about getting rid of the error "Missing Form Label" from your accessibility reports and why it's import. In this lesson, we mention the visually hidden class, which you can read about here: https://a11yproject.com/posts/how-to-hide-content/. Wave Tool Extension: For Chrome: https://chrome.google.com/webstore/detail/wave-evaluation-tool/jbbplnpkjmmeebjpijfedlgcdilocofh?hl=en-US For Firefox: https://addons.mozilla.org/en-US/firefox/addon/wave-accessibility-tool/