Loop audio? #555
-
Hello. This is a fairly simple question, but is there a way to loop audio? (Restarts automatically after the sound ends). I've tried using audio.on('ended') and creating a new ui.audio element, but depending on how long the site is up, can quickly bog down a system since they are not being deleted. |
Beta Was this translation helpful? Give feedback.
Answered by
falkoschindler
Mar 19, 2023
Replies: 1 comment 1 reply
-
That's a good question, @chook100! The HTML audio tag supports the attribute "loop". So you can simply add a ui.audio('https://cdn.pixabay.com/download/audio/2022/02/22/audio_d1718ab41b.mp3').props('loop') But NiceGUI should support this feature natively. I'll add it to the public API. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
chook100
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That's a good question, @chook100!
The HTML audio tag supports the attribute "loop". So you can simply add a
loop
prop:But NiceGUI should support this feature natively. I'll add it to the public API.