-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Audio
hernan edited this page Aug 20, 2020
·
2 revisions
Lottie doesn't have a built-in support for audio layers so it depends on other libraries to play audio.
If the howler library is in the global scope and lottie finds the Howl constructor, Lottie will take care of the rest. https://github.com/goldfire/howler.js/ Example:
<script>https://cdnjs.cloudflare.com/ajax/libs/howler/2.2.0/howler.min.js</script>
<script>https://cdnjs.cloudflare.com/ajax/libs/bodymovin/5.6.10/lottie.min.js</script>
<script>
lottie.loadAnimation({
container: element, // the dom element that will contain the animation
renderer: 'svg',
loop: true,
autoplay: true,
path: 'data.json' // the path to the animation json
});
</script>