From 01571e2e656ec188466a2507556f7c412097c531 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sun, 18 Aug 2024 13:03:04 +0200 Subject: [PATCH] [UI] Many improvements for the `media` UI. - Support for _Play_ / _Play (With Cache)_ options for YouTube videos. - Added `media.chromecast` and `media.gstreamer` UI panels. - Removed `media.omxplayer` - the plugin has been removed. - Enriched and improved the media info component. - Propagate the media loading state to all children components. - Persist query/search state on the URL. Closes: #422 --- .../backend/http/webapp/src/assets/icons.json | 6 +- .../webapp/src/components/Media/Controls.vue | 18 ++++- .../http/webapp/src/components/Media/View.vue | 2 + .../src/components/panels/Media/Browser.vue | 17 +++-- .../src/components/panels/Media/Header.vue | 27 +++++-- .../src/components/panels/Media/Index.vue | 69 ++++++++++++------ .../src/components/panels/Media/Info.vue | 72 ++++++++++++------- .../src/components/panels/Media/Item.vue | 3 + .../components/panels/Media/MediaImage.vue | 11 ++- .../src/components/panels/Media/Players.vue | 21 ++++-- .../panels/Media/Players/Chromecast.vue | 13 +++- .../Players/{Omxplayer.vue => GStreamer.vue} | 5 +- .../components/panels/Media/Players/Mixin.vue | 9 ++- .../panels/Media/Providers/Mixin.vue | 13 +++- .../panels/Media/Providers/YouTube.vue | 20 ++++-- .../Media/Providers/YouTube/Channel.vue | 21 ++++-- .../panels/Media/Providers/YouTube/Feed.vue | 21 ++++-- .../Media/Providers/YouTube/Playlist.vue | 2 + .../Media/Providers/YouTube/Playlists.vue | 31 +++++--- .../Media/Providers/YouTube/Subscriptions.vue | 2 + .../src/components/panels/Media/Results.vue | 7 ++ .../Index.vue | 3 +- .../panels/MediaGstreamer/Index.vue | 15 ++++ .../backend/http/webapp/src/utils/Text.vue | 4 ++ 24 files changed, 307 insertions(+), 105 deletions(-) rename platypush/backend/http/webapp/src/components/panels/Media/Players/{Omxplayer.vue => GStreamer.vue} (72%) rename platypush/backend/http/webapp/src/components/panels/{MediaOmxplayer => MediaChromecast}/Index.vue (72%) create mode 100644 platypush/backend/http/webapp/src/components/panels/MediaGstreamer/Index.vue diff --git a/platypush/backend/http/webapp/src/assets/icons.json b/platypush/backend/http/webapp/src/assets/icons.json index f95532ac3b..220a0cd44f 100644 --- a/platypush/backend/http/webapp/src/assets/icons.json +++ b/platypush/backend/http/webapp/src/assets/icons.json @@ -53,15 +53,15 @@ "linode": { "class": "fas fa-cloud" }, + "media.chromecast": { + "class": "fab fa-chromecast" + }, "media.jellyfin": { "imgUrl": "/icons/jellyfin.svg" }, "media.kodi": { "imgUrl": "/icons/kodi.svg" }, - "media.omxplayer": { - "class": "fa fa-film" - }, "media.mplayer": { "class": "fa fa-film" }, diff --git a/platypush/backend/http/webapp/src/components/Media/Controls.vue b/platypush/backend/http/webapp/src/components/Media/Controls.vue index c372370416..72fcd3e206 100644 --- a/platypush/backend/http/webapp/src/components/Media/Controls.vue +++ b/platypush/backend/http/webapp/src/components/Media/Controls.vue @@ -57,7 +57,7 @@
-
+
@@ -127,6 +127,7 @@ export default { mixins: [Utils, MediaUtils], emits: [ 'consume', + 'info', 'mute', 'next', 'pause', @@ -202,6 +203,9 @@ export default { }, trackImage() { + if (this.track?.images?.length) + return this.track.images[0].url + return this.track?.image || this.image }, }, @@ -405,6 +409,10 @@ button { overflow: hidden; align-items: center; + button { + background: none !important; + } + .row { width: 100%; display: flex; @@ -466,8 +474,14 @@ button { flex-direction: row; align-items: center; + .img-container { + max-width: 100%; + max-height: calc(100% + 3em); + } + .image { - margin-right: 0.75em; + padding: 0.5em; + max-height: 100%; } } } diff --git a/platypush/backend/http/webapp/src/components/Media/View.vue b/platypush/backend/http/webapp/src/components/Media/View.vue index 3b1f402e43..a80da9ab1f 100644 --- a/platypush/backend/http/webapp/src/components/Media/View.vue +++ b/platypush/backend/http/webapp/src/components/Media/View.vue @@ -9,6 +9,7 @@ :status="status" :track="track" @consume="$emit('consume', $event)" + @info="$emit('info', $event)" @mute="$emit('mute')" @next="$emit('next')" @pause="$emit('pause', $event)" @@ -33,6 +34,7 @@ export default { components: {Controls}, emits: [ 'consume', + 'info', 'mute', 'next', 'pause', diff --git a/platypush/backend/http/webapp/src/components/panels/Media/Browser.vue b/platypush/backend/http/webapp/src/components/panels/Media/Browser.vue index b224ed6b4d..9ae28c776f 100644 --- a/platypush/backend/http/webapp/src/components/panels/Media/Browser.vue +++ b/platypush/backend/http/webapp/src/components/panels/Media/Browser.vue @@ -1,9 +1,7 @@