AudioAttachment

Renders audio attachment controls inside MessageList and MessageComposer. This is the default component for the AudioAttachment prop.

Best Practices

  • Playback is handled internally through the shared audio-player state store; you don't wire up load/progress/play-pause callbacks yourself.
  • Use hideProgressBar, showTitle, and showSpeedSettings to tune what the row displays.
  • Respect concurrent playback settings from the Channel/Audio provider.
  • Provide clear play/pause affordances and accessibility labels.
  • Test on both iOS and Android for consistent audio behavior.

Props

PropDescriptionType
itemAudio item to render. Contains playback metadata such as id, type ('audio' | 'voiceRecording'), duration, waveform_data, asset_url, title, and mime_type.AudioAttachmentType
messageMessage object the attachment belongs to. Used to scope the audio player instance.LocalMessage
hideProgressBarWhen true, the progress/waveform bar isn't rendered. Defaults to false.boolean
showTitleWhen true, the file title (or "Voice Message") is shown. Defaults to true.boolean
showSpeedSettingsWhen true, the playback-speed button is shown. Defaults to false.boolean
isPreviewSet to true when the attachment is rendered as a preview in the message input. Defaults to false.boolean
indicatorNode rendered in place of the progress info while a local attachment is uploading.React.ReactNode
containerStyleAdditional style applied to the outer container.StyleProp<ViewStyle>
stylesStyle overrides for container, playPauseButton, speedSettingsButton, durationText, and leftContainer.object
testIDTest identifier for the component.string