From b491f81cda9cb542df1c1063d982e273e1794baf Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Tue, 14 Nov 2023 21:45:44 +0100 Subject: [PATCH] [media UI] Added loading spin overlay upon play. --- .../src/components/panels/Media/Index.vue | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/platypush/backend/http/webapp/src/components/panels/Media/Index.vue b/platypush/backend/http/webapp/src/components/panels/Media/Index.vue index 32c5259ef1..421684492a 100644 --- a/platypush/backend/http/webapp/src/components/panels/Media/Index.vue +++ b/platypush/backend/http/webapp/src/components/panels/Media/Index.vue @@ -195,15 +195,28 @@ export default { async play(item) { if (item?.type === 'torrent') { this.awaitingPlayTorrent = item.url + this.notify({ + text: 'Torrent queued for download', + image: { + iconClass: 'fa fa-magnet', + } + }) + await this.download(item) return } - if (!this.selectedPlayer.component.supports(item)) - item = await this.startStreaming(item, this.pluginName) + this.loading = true - await this.selectedPlayer.component.play(item, this.selectedSubtitles, this.selectedPlayer) - await this.refresh() + try { + if (!this.selectedPlayer.component.supports(item)) + item = await this.startStreaming(item, this.pluginName) + + await this.selectedPlayer.component.play(item, this.selectedSubtitles, this.selectedPlayer) + await this.refresh() + } finally { + this.loading = false + } }, async pause() {