A mobile app for listening to radio stations from around the globe
git clone git://soophie.de/verbal
11
loading: false,12
error: false,13
title: '- No song title available -',14
interval: null14
interval: null,15
resume: false16
};17
},18
components: {
42
console.log(error);43
}44
},44
setPlaying(playing, event = false) {45
if(this.error) {45
setPlaying(playing) {46
if(this.error || this.loading) {47
return;48
}49
this.playing = playing;50
this.$refs.player[this.playing ? 'play' : 'pause']();51
if(this.playing) {51
this.error = false;52
if(!event) {53
this.updateSong();54
}52
this.playing = false;53
this.loading = true;54
this.$refs.player.load();55
}56
},57
onPlay() {58
if(this.resume) {59
this.playing = false;60
this.loading = true;61
this.$refs.player.load();62
}63
},64
onPause() {65
this.playing = false;66
this.resume = true;67
},68
onLoad() {69
this.loading = false;70
this.playing = true;71
this.resume = false;72
this.updateSong();73
},74
onError(event) {
125
controls autoplay126
:src="station.stream_url"127
@loadeddata="onLoad"116
@play="setPlaying(true, true)"117
@pause="setPlaying(false, true)"128
@play="onPlay"129
@pause="onPause"130
@error="onError"131
class="select-none pointer-events-none w-0 h-0 opacity-0"132
>