un audio per volta

This commit is contained in:
boyska 2023-03-19 11:07:21 +00:00
parent f1e914293e
commit af60069515

View file

@ -48,24 +48,17 @@ export default {
}, },
methods: { methods: {
play (url) { play (url) {
var urls; let newPlayer = new Howl({
if (url === undefined) {
const rnd = Math.random()
urls = [
'https://stream.radioblackout.org/blackout.ogg?rnd=' + rnd,
'https://stream.radioblackout.org/blackout.mp3'
]
} else {
urls = [url]
}
this.player = new Howl({
autoSuspend: false, autoSuspend: false,
html5: true, html5: true,
preload: true, preload: true,
src: urls, src: [url],
}) })
console.log(this.player) newPlayer.play()
this.player.play() if(this.player) {
this.player.stop()
}
this.player = newPlayer
}, },
stop () { stop () {
if (this.player) { if (this.player) {