fix stuff; sound inline in admin

This commit is contained in:
bkfox
2020-09-16 15:12:05 +02:00
parent 35e7e407e7
commit 361cf88bb2
8 changed files with 36 additions and 64 deletions

View File

@ -38,7 +38,8 @@ export default {
data() {
return {
state: State.paused,
liveInfo: new LiveInfo(this.liveInfoUrl, this.liveInfoTimeout),
liveInfo: this.liveInfoUrl ? new LiveInfo(this.liveInfoUrl, this.liveInfoTimeout)
: null,
}
},
@ -55,7 +56,7 @@ export default {
loading() { return this.state == State.loading; },
onAir() {
return this.liveInfo.items && this.liveInfo.items[0];
return this.liveInfo && this.liveInfo.items && this.liveInfo.items[0];
},
buttonStyle() {
@ -83,7 +84,6 @@ export default {
},
toggle() {
console.log('tooogle', this.paused, '-', this.$refs.audio.src)
if(this.paused)
this.play()
else
@ -97,11 +97,11 @@ export default {
},
mounted() {
this.liveInfo.refresh()
this.liveInfo && this.liveInfo.refresh()
},
destroyed() {
this.liveInfo.drop()
this.liveInfo && this.liveInfo.drop()
},
}