diff --git a/ffplayout/frontend/pages/player.vue b/ffplayout/frontend/pages/player.vue index 537748de..6b5874ea 100644 --- a/ffplayout/frontend/pages/player.vue +++ b/ffplayout/frontend/pages/player.vue @@ -10,14 +10,14 @@ - - - + + +
{{ timeStr }}
- +
{{ timeLeft }}
@@ -92,7 +92,7 @@
- + @@ -280,12 +280,6 @@ export default { }, filters: { - filename (path) { - if (path) { - const pathArr = path.split('/') - return pathArr[pathArr.length - 1] - } - }, secondsToTime (sec) { return new Date(sec * 1000).toISOString().substr(11, 8) } @@ -295,7 +289,8 @@ export default { return { isLoading: false, isPlaying: '', - today: this.$dayjs().format('YYYY-MM-DD'), + listDate: this.$dayjs().format('YYYY-MM-DD'), + interval: null, extensions: '', videoOptions: {}, previewOptions: {}, @@ -320,14 +315,13 @@ export default { }, watch: { - today (date) { + listDate (date) { this.getPlaylist() } }, async created () { await this.getConfig() - await this.getStatus() this.extensions = this.configPlayout.storage.extensions.join(' ') @@ -349,6 +343,14 @@ export default { } await this.getPlaylist() + + this.interval = setInterval(() => { + this.$store.dispatch('playlist/animClock', { dayStart: this.configPlayout.playlist.day_start }) + }, 5000) + }, + + beforeDestroy () { + clearInterval(this.interval) }, methods: { @@ -382,7 +384,7 @@ export default { }, async getPlaylist () { await this.$store.dispatch('auth/inspectToken') - await this.$store.dispatch('playlist/getPlaylist', { dayStart: this.configPlayout.playlist.day_start, date: this.today }) + await this.$store.dispatch('playlist/getPlaylist', { dayStart: this.configPlayout.playlist.day_start, date: this.listDate }) }, showModal (src) { this.previewSource = src.split('/').slice(-1)[0] @@ -431,7 +433,7 @@ export default { this.configPlayout.playlist.day_start, this.playlist)) }, async resetPlaylist () { - await this.$store.dispatch('playlist/getPlaylist', { dayStart: this.configPlayout.playlist.day_start, date: this.today }) + await this.$store.dispatch('playlist/getPlaylist', { dayStart: this.configPlayout.playlist.day_start, date: this.listDate }) }, async savePlaylist () { await this.$store.dispatch('auth/inspectToken') @@ -442,14 +444,14 @@ export default { await this.$axios.post( 'api/playlist/', - { data: { channel: this.$store.state.playlist.playlistChannel, date: this.today, program: saveList } } + { data: { channel: this.$store.state.playlist.playlistChannel, date: this.listDate, program: saveList } } ) } } } -