2021-09-01 20:07:11 -05:00
|
|
|
<template>
|
|
|
|
<div class="w-full min-h-screen h-full bg-bg text-white">
|
|
|
|
<app-appbar />
|
2021-09-12 18:37:08 -05:00
|
|
|
<div id="content" class="overflow-hidden" :class="playerIsOpen ? 'playerOpen' : ''">
|
2021-09-01 20:07:11 -05:00
|
|
|
<Nuxt />
|
|
|
|
</div>
|
|
|
|
<app-stream-container ref="streamContainer" />
|
2021-09-12 18:37:08 -05:00
|
|
|
<modals-downloads-modal ref="downloadsModal" @selectDownload="selectDownload" @deleteDownload="deleteDownload" />
|
2021-10-06 07:24:15 -05:00
|
|
|
<modals-libraries-modal />
|
2021-10-17 20:20:00 -05:00
|
|
|
<readers-reader />
|
2021-09-01 20:07:11 -05:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2021-09-12 18:37:08 -05:00
|
|
|
import { Capacitor } from '@capacitor/core'
|
|
|
|
import { Network } from '@capacitor/network'
|
2021-09-04 12:31:00 -05:00
|
|
|
import { AppUpdate } from '@robingenz/capacitor-app-update'
|
2021-09-12 18:37:08 -05:00
|
|
|
import AudioDownloader from '@/plugins/audio-downloader'
|
2021-09-21 07:11:59 -05:00
|
|
|
import MyNativeAudio from '@/plugins/my-native-audio'
|
2021-09-04 12:31:00 -05:00
|
|
|
|
2021-09-01 20:07:11 -05:00
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {}
|
|
|
|
},
|
|
|
|
computed: {
|
2021-09-12 18:37:08 -05:00
|
|
|
playerIsOpen() {
|
|
|
|
return this.$store.getters['playerIsOpen']
|
2021-09-01 20:07:11 -05:00
|
|
|
},
|
|
|
|
routeName() {
|
|
|
|
return this.$route.name
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
2021-10-06 07:24:15 -05:00
|
|
|
async connected(isConnected) {
|
2021-09-01 20:07:11 -05:00
|
|
|
if (this.$route.name === 'connect') {
|
|
|
|
if (isConnected) {
|
|
|
|
this.$router.push('/')
|
|
|
|
}
|
2021-09-12 18:37:08 -05:00
|
|
|
}
|
|
|
|
this.syncUserProgress()
|
2021-10-06 07:24:15 -05:00
|
|
|
|
|
|
|
// Load libraries
|
|
|
|
this.$store.dispatch('libraries/load')
|
2021-09-12 18:37:08 -05:00
|
|
|
},
|
|
|
|
updateAudiobookProgressOnServer(audiobookProgress) {
|
|
|
|
if (this.$server.socket) {
|
|
|
|
this.$server.socket.emit('progress_update', audiobookProgress)
|
|
|
|
}
|
|
|
|
},
|
|
|
|
syncUserProgress() {
|
|
|
|
if (!this.$store.state.user.user) return
|
|
|
|
|
|
|
|
var userAudiobooks = this.$store.state.user.user.audiobooks
|
|
|
|
var localAudiobooks = this.$store.state.user.localUserAudiobooks
|
|
|
|
var localHasUpdates = false
|
|
|
|
|
|
|
|
var newestLocal = { ...localAudiobooks }
|
|
|
|
for (const audiobookId in userAudiobooks) {
|
|
|
|
if (localAudiobooks[audiobookId]) {
|
|
|
|
if (localAudiobooks[audiobookId].lastUpdate > userAudiobooks[audiobookId].lastUpdate) {
|
|
|
|
// Local progress is more recent than user progress
|
|
|
|
this.updateAudiobookProgressOnServer(localAudiobooks[audiobookId])
|
2021-09-19 18:44:10 -05:00
|
|
|
} else if (localAudiobooks[audiobookId].lastUpdate < userAudiobooks[audiobookId].lastUpdate) {
|
2021-09-12 18:37:08 -05:00
|
|
|
// Server is more recent than local
|
|
|
|
newestLocal[audiobookId] = userAudiobooks[audiobookId]
|
2021-09-19 18:44:10 -05:00
|
|
|
console.log('SYNCUSERPROGRESS Server IS MORE RECENT for', audiobookId)
|
2021-09-12 18:37:08 -05:00
|
|
|
localHasUpdates = true
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
// Not on local yet - store on local
|
|
|
|
newestLocal[audiobookId] = userAudiobooks[audiobookId]
|
2021-09-19 18:44:10 -05:00
|
|
|
console.log('SYNCUSERPROGRESS LOCAL Is NOT Stored YET for', audiobookId, JSON.stringify(newestLocal[audiobookId]))
|
2021-09-12 18:37:08 -05:00
|
|
|
localHasUpdates = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (const audiobookId in localAudiobooks) {
|
|
|
|
if (!userAudiobooks[audiobookId]) {
|
|
|
|
// Local progress is not on server
|
|
|
|
this.updateAudiobookProgressOnServer(localAudiobooks[audiobookId])
|
2021-09-01 20:07:11 -05:00
|
|
|
}
|
|
|
|
}
|
2021-09-12 18:37:08 -05:00
|
|
|
|
|
|
|
if (localHasUpdates) {
|
|
|
|
console.log('Local audiobook progress has updates from server')
|
|
|
|
this.$localStore.setAllAudiobookProgress(newestLocal)
|
|
|
|
}
|
2021-09-01 20:07:11 -05:00
|
|
|
},
|
|
|
|
initialStream(stream) {
|
|
|
|
if (this.$refs.streamContainer && this.$refs.streamContainer.audioPlayerReady) {
|
|
|
|
this.$refs.streamContainer.streamOpen(stream)
|
|
|
|
}
|
2021-09-02 12:19:26 -05:00
|
|
|
},
|
2021-09-04 12:31:00 -05:00
|
|
|
async clickUpdateToast() {
|
|
|
|
var immediateUpdateAllowed = this.$store.state.appUpdateInfo.immediateUpdateAllowed
|
|
|
|
if (immediateUpdateAllowed) {
|
|
|
|
await AppUpdate.performImmediateUpdate()
|
2021-09-02 12:19:26 -05:00
|
|
|
} else {
|
2021-09-04 12:31:00 -05:00
|
|
|
await AppUpdate.openAppStore()
|
2021-09-02 12:19:26 -05:00
|
|
|
}
|
|
|
|
},
|
2021-09-12 18:37:08 -05:00
|
|
|
// showUpdateToast(availableVersion, immediateUpdateAllowed) {
|
|
|
|
// var toastText = immediateUpdateAllowed ? `Click here to update` : `Click here to open app store`
|
|
|
|
// this.$toast.info(`Update is available for v${availableVersion}! ${toastText}`, {
|
|
|
|
// draggable: false,
|
|
|
|
// hideProgressBar: false,
|
|
|
|
// timeout: 10000,
|
|
|
|
// closeButton: false,
|
|
|
|
// onClick: this.clickUpdateToast()
|
|
|
|
// })
|
|
|
|
// },
|
2021-09-04 12:31:00 -05:00
|
|
|
async checkForUpdate() {
|
2021-10-16 10:08:13 -05:00
|
|
|
console.log('Checking for app update')
|
2021-09-04 12:31:00 -05:00
|
|
|
const result = await AppUpdate.getAppUpdateInfo()
|
|
|
|
if (!result) {
|
|
|
|
console.error('Invalid version check')
|
2021-09-02 12:19:26 -05:00
|
|
|
return
|
|
|
|
}
|
2021-10-16 10:08:13 -05:00
|
|
|
console.log('App Update Info', JSON.stringify(result))
|
2021-09-04 12:31:00 -05:00
|
|
|
this.$store.commit('setAppUpdateInfo', result)
|
2021-09-12 18:37:08 -05:00
|
|
|
if (result.updateAvailability === 2) {
|
|
|
|
setTimeout(() => {
|
2021-09-19 18:44:10 -05:00
|
|
|
this.$toast.info(`Update is available! Click to update.`, {
|
2021-09-12 18:37:08 -05:00
|
|
|
draggable: false,
|
|
|
|
hideProgressBar: false,
|
2021-09-19 18:44:10 -05:00
|
|
|
timeout: 20000,
|
|
|
|
closeButton: true,
|
|
|
|
onClick: this.clickUpdateToast
|
2021-09-12 18:37:08 -05:00
|
|
|
})
|
|
|
|
}, 5000)
|
|
|
|
}
|
|
|
|
},
|
|
|
|
onDownloadProgress(data) {
|
|
|
|
var progress = data.progress
|
2021-09-19 18:44:10 -05:00
|
|
|
var audiobookId = data.audiobookId
|
2021-09-04 12:31:00 -05:00
|
|
|
|
2021-09-12 18:37:08 -05:00
|
|
|
var downloadObj = this.$store.getters['downloads/getDownload'](audiobookId)
|
|
|
|
if (downloadObj) {
|
|
|
|
if (this.$refs.downloadsModal) {
|
|
|
|
this.$refs.downloadsModal.updateDownloadProgress({ audiobookId, progress })
|
|
|
|
}
|
|
|
|
this.$toast.update(downloadObj.toastId, { content: `${progress}% Downloading ${downloadObj.audiobook.book.title}` })
|
|
|
|
}
|
|
|
|
},
|
2021-09-19 18:44:10 -05:00
|
|
|
onDownloadFailed(data) {
|
|
|
|
if (!data.audiobookId) {
|
|
|
|
console.error('Download failed invalid audiobook id', data)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
var downloadObj = this.$store.getters['downloads/getDownload'](data.audiobookId)
|
|
|
|
if (!downloadObj) {
|
|
|
|
console.error('Failed to find download for audiobook', data.audiobookId)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
var message = data.error || 'Unknown Error'
|
|
|
|
this.$toast.update(downloadObj.toastId, { content: `Failed. ${message}.`, options: { timeout: 5000, type: 'error' } }, true)
|
|
|
|
this.$store.commit('downloads/removeDownload', downloadObj)
|
|
|
|
},
|
2021-09-12 18:37:08 -05:00
|
|
|
onDownloadComplete(data) {
|
2021-09-19 18:44:10 -05:00
|
|
|
if (!data.audiobookId) {
|
|
|
|
console.error('Download compelte invalid audiobook id', data)
|
|
|
|
return
|
|
|
|
}
|
2021-09-12 18:37:08 -05:00
|
|
|
var downloadId = data.downloadId
|
|
|
|
var contentUrl = data.contentUrl
|
2021-09-19 18:44:10 -05:00
|
|
|
var folderUrl = data.folderUrl
|
|
|
|
var folderName = data.folderName
|
|
|
|
var storageId = data.storageId
|
|
|
|
var storageType = data.storageType
|
|
|
|
var simplePath = data.simplePath
|
2021-09-12 18:37:08 -05:00
|
|
|
var filename = data.filename
|
2021-09-19 18:44:10 -05:00
|
|
|
var audiobookId = data.audiobookId
|
|
|
|
var size = data.size || 0
|
|
|
|
var isCover = !!data.isCover
|
|
|
|
|
2021-10-18 19:40:05 -05:00
|
|
|
console.log(`Download complete "${contentUrl}" | ${filename} | DlId: ${downloadId} | Is Cover? ${isCover}`)
|
2021-09-19 18:44:10 -05:00
|
|
|
var downloadObj = this.$store.getters['downloads/getDownload'](audiobookId)
|
|
|
|
if (!downloadObj) {
|
|
|
|
console.error('Failed to find download for audiobook', audiobookId)
|
|
|
|
return
|
|
|
|
}
|
2021-09-12 18:37:08 -05:00
|
|
|
|
2021-09-19 18:44:10 -05:00
|
|
|
if (!isCover) {
|
2021-09-12 18:37:08 -05:00
|
|
|
// Notify server to remove prepared download
|
|
|
|
if (this.$server.socket) {
|
2021-09-16 19:58:04 -05:00
|
|
|
this.$server.socket.emit('remove_download', audiobookId)
|
2021-09-12 18:37:08 -05:00
|
|
|
}
|
|
|
|
|
2021-09-19 18:44:10 -05:00
|
|
|
this.$toast.update(downloadObj.toastId, { content: `Success! ${downloadObj.audiobook.book.title} downloaded.`, options: { timeout: 5000, type: 'success' } }, true)
|
2021-09-12 18:37:08 -05:00
|
|
|
|
2021-09-19 18:44:10 -05:00
|
|
|
delete downloadObj.isDownloading
|
|
|
|
delete downloadObj.isPreparing
|
|
|
|
downloadObj.contentUrl = contentUrl
|
|
|
|
downloadObj.simplePath = simplePath
|
|
|
|
downloadObj.folderUrl = folderUrl
|
|
|
|
downloadObj.folderName = folderName
|
|
|
|
downloadObj.storageType = storageType
|
|
|
|
downloadObj.storageId = storageId
|
|
|
|
downloadObj.basePath = data.basePath || null
|
|
|
|
downloadObj.size = size
|
|
|
|
this.$store.commit('downloads/addUpdateDownload', downloadObj)
|
|
|
|
} else {
|
|
|
|
downloadObj.coverUrl = contentUrl
|
|
|
|
downloadObj.cover = Capacitor.convertFileSrc(contentUrl)
|
|
|
|
downloadObj.coverSize = size
|
|
|
|
downloadObj.coverBasePath = data.basePath || null
|
|
|
|
console.log('Updating download with cover', downloadObj.cover)
|
|
|
|
this.$store.commit('downloads/addUpdateDownload', downloadObj)
|
2021-09-12 18:37:08 -05:00
|
|
|
}
|
|
|
|
},
|
|
|
|
async checkLoadCurrent() {
|
|
|
|
var currentObj = await this.$localStore.getCurrent()
|
|
|
|
if (!currentObj) return
|
|
|
|
|
|
|
|
console.log('Has Current playing', currentObj.audiobookId)
|
|
|
|
var download = this.$store.getters['downloads/getDownload'](currentObj.audiobookId)
|
|
|
|
if (download) {
|
|
|
|
this.$store.commit('setPlayingDownload', download)
|
|
|
|
} else {
|
|
|
|
console.warn('Download not available for previous current playing', currentObj.audiobookId)
|
|
|
|
this.$localStore.setCurrent(null)
|
|
|
|
}
|
|
|
|
},
|
2021-09-19 18:44:10 -05:00
|
|
|
async onMediaLoaded(items) {
|
2021-09-12 18:37:08 -05:00
|
|
|
var jsitems = JSON.parse(items)
|
|
|
|
jsitems = jsitems.map((item) => {
|
|
|
|
return {
|
|
|
|
filename: item.name,
|
2021-09-19 18:44:10 -05:00
|
|
|
size: item.size,
|
|
|
|
contentUrl: item.uri,
|
2021-09-12 18:37:08 -05:00
|
|
|
coverUrl: item.coverUrl || null
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2021-09-19 18:44:10 -05:00
|
|
|
var downloads = await this.$sqlStore.getAllDownloads()
|
2021-10-18 19:40:05 -05:00
|
|
|
|
2021-09-19 18:44:10 -05:00
|
|
|
for (let i = 0; i < downloads.length; i++) {
|
|
|
|
var download = downloads[i]
|
|
|
|
var jsitem = jsitems.find((item) => item.contentUrl === download.contentUrl)
|
|
|
|
if (!jsitem) {
|
|
|
|
console.error('Removing download was not found', JSON.stringify(download))
|
|
|
|
await this.$sqlStore.removeDownload(download.id)
|
|
|
|
} else if (download.coverUrl && !jsitem.coverUrl) {
|
|
|
|
console.error('Removing cover for download was not found')
|
|
|
|
download.cover = null
|
|
|
|
download.coverUrl = null
|
|
|
|
download.size = jsitem.size || 0
|
|
|
|
this.$store.commit('downloads/addUpdateDownload', download)
|
|
|
|
this.$store.commit('audiobooks/addUpdate', download.audiobook)
|
2021-09-12 18:37:08 -05:00
|
|
|
} else {
|
2021-09-19 18:44:10 -05:00
|
|
|
download.size = jsitem.size || 0
|
2021-09-12 18:37:08 -05:00
|
|
|
this.$store.commit('downloads/addUpdateDownload', download)
|
|
|
|
this.$store.commit('audiobooks/addUpdate', download.audiobook)
|
|
|
|
}
|
2021-09-19 18:44:10 -05:00
|
|
|
}
|
2021-09-12 18:37:08 -05:00
|
|
|
|
|
|
|
this.checkLoadCurrent()
|
2021-09-21 07:11:59 -05:00
|
|
|
this.$store.dispatch('audiobooks/setNativeAudiobooks')
|
2021-09-12 18:37:08 -05:00
|
|
|
},
|
|
|
|
selectDownload(download) {
|
|
|
|
this.$store.commit('setPlayOnLoad', true)
|
|
|
|
this.$store.commit('setPlayingDownload', download)
|
|
|
|
},
|
|
|
|
async deleteDownload(download) {
|
|
|
|
console.log('Delete download', download.filename)
|
|
|
|
|
|
|
|
if (this.$store.state.playingDownload && this.$store.state.playingDownload.id === download.id) {
|
|
|
|
console.warn('Deleting download when currently playing download - terminate play')
|
|
|
|
if (this.$refs.streamContainer) {
|
|
|
|
this.$refs.streamContainer.cancelStream()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (download.contentUrl) {
|
2021-09-19 18:44:10 -05:00
|
|
|
await AudioDownloader.delete(download)
|
2021-09-12 18:37:08 -05:00
|
|
|
}
|
|
|
|
this.$store.commit('downloads/removeDownload', download)
|
|
|
|
},
|
2021-09-19 18:44:10 -05:00
|
|
|
async onPermissionUpdate(data) {
|
|
|
|
var val = data.value
|
|
|
|
console.log('Permission Update', val)
|
|
|
|
if (val === 'required') {
|
|
|
|
console.log('Permission Required - Making Request')
|
|
|
|
this.$store.commit('setHasStoragePermission', false)
|
|
|
|
} else if (val === 'canceled' || val === 'denied') {
|
|
|
|
console.error('Permission denied by user')
|
|
|
|
this.$store.commit('setHasStoragePermission', false)
|
|
|
|
} else if (val === 'granted') {
|
|
|
|
console.log('User Granted permission')
|
|
|
|
this.$store.commit('setHasStoragePermission', true)
|
2021-09-12 18:37:08 -05:00
|
|
|
|
2021-09-19 18:44:10 -05:00
|
|
|
var folder = data
|
|
|
|
delete folder.value
|
|
|
|
console.log('Setting folder', JSON.stringify(folder))
|
|
|
|
await this.$localStore.setDownloadFolder(folder)
|
|
|
|
} else {
|
|
|
|
console.warn('Other permisiso update', val)
|
|
|
|
}
|
|
|
|
},
|
|
|
|
async initMediaStore() {
|
2021-09-12 18:37:08 -05:00
|
|
|
// Request and setup listeners for media files on native
|
2021-09-19 18:44:10 -05:00
|
|
|
AudioDownloader.addListener('permission', (data) => {
|
|
|
|
this.onPermissionUpdate(data)
|
|
|
|
})
|
2021-09-12 18:37:08 -05:00
|
|
|
AudioDownloader.addListener('onDownloadComplete', (data) => {
|
|
|
|
this.onDownloadComplete(data)
|
|
|
|
})
|
2021-09-19 18:44:10 -05:00
|
|
|
AudioDownloader.addListener('onDownloadFailed', (data) => {
|
|
|
|
this.onDownloadFailed(data)
|
|
|
|
})
|
2021-09-12 18:37:08 -05:00
|
|
|
AudioDownloader.addListener('onMediaLoaded', (data) => {
|
|
|
|
this.onMediaLoaded(data.items)
|
|
|
|
})
|
|
|
|
AudioDownloader.addListener('onDownloadProgress', (data) => {
|
|
|
|
this.onDownloadProgress(data)
|
|
|
|
})
|
2021-09-19 18:44:10 -05:00
|
|
|
|
|
|
|
await this.$localStore.loadUserAudiobooks()
|
|
|
|
await this.$localStore.getDownloadFolder()
|
|
|
|
|
|
|
|
var userSavedSettings = await this.$localStore.getUserSettings()
|
|
|
|
if (userSavedSettings) {
|
|
|
|
this.$store.commit('user/setSettings', userSavedSettings)
|
|
|
|
}
|
|
|
|
|
|
|
|
var downloads = await this.$sqlStore.getAllDownloads()
|
|
|
|
if (downloads.length) {
|
|
|
|
var urls = downloads
|
|
|
|
.map((d) => {
|
|
|
|
return {
|
|
|
|
contentUrl: d.contentUrl,
|
|
|
|
coverUrl: d.coverUrl || '',
|
|
|
|
storageId: d.storageId,
|
|
|
|
basePath: d.basePath,
|
|
|
|
coverBasePath: d.coverBasePath || ''
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.filter((d) => {
|
|
|
|
if (!d.contentUrl) {
|
|
|
|
console.error('Invalid Download no Content URL', JSON.stringify(d))
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
return true
|
|
|
|
})
|
|
|
|
|
|
|
|
AudioDownloader.load({
|
|
|
|
audiobookUrls: urls
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
var checkPermission = await AudioDownloader.checkStoragePermission()
|
2021-10-18 19:40:05 -05:00
|
|
|
console.log('Storage Permission is' + checkPermission.value)
|
2021-09-19 18:44:10 -05:00
|
|
|
if (!checkPermission.value) {
|
|
|
|
console.log('Will require permissions')
|
|
|
|
} else {
|
|
|
|
console.log('Has Storage Permission')
|
|
|
|
this.$store.commit('setHasStoragePermission', true)
|
|
|
|
}
|
2021-09-12 18:37:08 -05:00
|
|
|
},
|
|
|
|
async setupNetworkListener() {
|
|
|
|
var status = await Network.getStatus()
|
|
|
|
this.$store.commit('setNetworkStatus', status)
|
|
|
|
|
|
|
|
Network.addListener('networkStatusChange', (status) => {
|
|
|
|
console.log('Network status changed', status.connected, status.connectionType)
|
|
|
|
this.$store.commit('setNetworkStatus', status)
|
|
|
|
})
|
|
|
|
}
|
2021-09-01 20:07:11 -05:00
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
if (!this.$server) return console.error('No Server')
|
|
|
|
|
|
|
|
this.$server.on('connected', this.connected)
|
|
|
|
this.$server.on('initialStream', this.initialStream)
|
|
|
|
|
2021-09-19 18:44:10 -05:00
|
|
|
if (this.$store.state.isFirstLoad) {
|
|
|
|
this.$store.commit('setIsFirstLoad', false)
|
|
|
|
this.setupNetworkListener()
|
|
|
|
this.checkForUpdate()
|
|
|
|
this.initMediaStore()
|
|
|
|
}
|
2021-09-21 07:11:59 -05:00
|
|
|
|
|
|
|
// For Testing Android Auto
|
|
|
|
MyNativeAudio.addListener('onPrepareMedia', (data) => {
|
|
|
|
var audiobookId = data.audiobookId
|
|
|
|
var playWhenReady = data.playWhenReady
|
|
|
|
|
|
|
|
var audiobook = this.$store.getters['audiobooks/getAudiobook'](audiobookId)
|
|
|
|
|
|
|
|
var download = this.$store.getters['downloads/getDownloadIfReady'](audiobookId)
|
|
|
|
this.$store.commit('setPlayOnLoad', playWhenReady)
|
|
|
|
if (!download) {
|
|
|
|
// Stream
|
|
|
|
this.$store.commit('setStreamAudiobook', audiobook)
|
|
|
|
this.$server.socket.emit('open_stream', audiobook.id)
|
|
|
|
} else {
|
|
|
|
// Local
|
|
|
|
this.$store.commit('setPlayingDownload', download)
|
|
|
|
}
|
|
|
|
})
|
2021-09-19 18:44:10 -05:00
|
|
|
},
|
|
|
|
beforeDestroy() {
|
|
|
|
if (!this.$server) {
|
|
|
|
console.error('No Server beforeDestroy')
|
|
|
|
return
|
|
|
|
}
|
|
|
|
console.log('Default Before Destroy remove listeners')
|
|
|
|
this.$server.off('connected', this.connected)
|
|
|
|
this.$server.off('initialStream', this.initialStream)
|
2021-09-01 20:07:11 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
#content {
|
|
|
|
height: calc(100vh - 64px);
|
|
|
|
}
|
2021-09-12 18:37:08 -05:00
|
|
|
#content.playerOpen {
|
2021-10-16 15:50:13 -05:00
|
|
|
height: calc(100vh - 236px);
|
2021-09-01 20:07:11 -05:00
|
|
|
}
|
|
|
|
</style>
|