un audio per volta
This commit is contained in:
parent
f1e914293e
commit
af60069515
1 changed files with 7 additions and 14 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue