Play audio

This commit is contained in:
2022-02-28 21:38:05 +01:00
parent ddba6c9fa1
commit 75e3c4d746
7 changed files with 55 additions and 1 deletions

View File

@@ -0,0 +1,20 @@
<script>
export default {
props: ['src', 'icon'],
methods: {
playSound: function(src) {
console.log('/assets/media/' + src);
var audioElement = document.createElement('audio');
audioElement.setAttribute('src', '/assets/media/' + src);
audioElement.play();
}
},
}
</script>
<template>
<span @click="playSound(src)" ><i class="fa ml-1 fa-play-circle"></i></span>
</template>