diff --git a/src/components/Player.vue b/src/components/Player.vue index 20860ca..7c2f658 100644 --- a/src/components/Player.vue +++ b/src/components/Player.vue @@ -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) {