Reflex Logo

Intro

Gallery

Hosting

Components

New

Learn

Components

API Reference

Onboarding

Library

/

Media

/

Audio

The audio component can display an audio given an src path as an argument. This could either be a local path from the assets folder or an external link.

rx.audio(
    url="https://www.learningcontainer.com/wp-content/uploads/2020/02/Kalimba.mp3",
    width="400px",
    height="32px",
)

If we had a local file in the assets folder named test.mp3 we could set url="/test.mp3" to view the audio file.

Audio component share with Video component.

PropTypeDescriptionValues
urlstr

The url of a video or song to play

playingbool

Set to true or false to pause or play the media

loopbool

Set to true or false to loop the media

controlsbool

Set to true or false to display native player controls.

lightbool

Set to true to show just the video thumbnail, which loads the full player on click

volumefloat

Set the volume of the player, between 0 and 1

mutedbool

Mutes the player

widthstr

Set the width of the player: ex:640px

heightstr

Set the height of the player: ex:640px

Event Triggers

See the full list of default event triggers
← StackImage →

Did you find this useful?

HomeGalleryChangelogIntroductionHosting