Audio must not play automatically unless the user is made aware this will happen or a pause/stop/mute button is provided.
Audio in AV and interactive content can be disruptive for screen reader users because it can conflict with and speak over the screen reader. Unexpected audio may also distress users with cognitive or sensory sensitivity.
Users should be given a choice to opt in for auto-playing content audio. Where a pause/stop/mute button is provided instead, it must be fully and immediately accessible.
User preferences should persist.
Provide a button or link along with the controls for the audio playback that will start the audio. Do not call the play method directly after loading the audio in app unless creating the audio when initiated by the user.
AVAudioPlayer *audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:nil]; [audioPlayer prepareToPlay]; UIButton *playButton = [UIButton buttonWithType:UIButtonTypeCustom]; [playButton setTitle: NSLocalizedString(@"Play", @"Button title")]
AVAudioPlayer *audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:nil]; [audioPlayer prepareToPlay]; [audioPlayer play];
Video content should open in it's own screen using the native player. No action is needed for autoplay as Android automatically decreases the volume of playback in order to allow Talkback users to hear speech output. Consider forewarning new users.
<Button android:id="@+id/pause_button" android:src="@drawable/pause" android:contentDescription="@string/pause"/>
Do not play audio automatically unless there is a setting where the user can opt in before content is autoplayed or the user is forewarned.
- Activate a screen reader.
- Locate audio content that plays automatically.
- Check that the containing page does not play audio automatically when it loads while a screen reader is active, or that the user is pre-warned and a control is provided to stop or pause the audio.
Either of the following checks are true:
- Audio content does not play automatically when a screen reader is running.
- The user is pre-warned that audio will automatically play and there is a control to stop or pause the audio.