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: {
play (url) {
var urls;
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({
let newPlayer = new Howl({
autoSuspend: false,
html5: true,
preload: true,
src: urls,
src: [url],
})
console.log(this.player)
this.player.play()
newPlayer.play()
if(this.player) {
this.player.stop()
}
this.player = newPlayer
},
stop () {
if (this.player) {