@@ -84,6 +84,15 @@ export default {
}
},
+ imgUrl() {
+ let img = this.item?.image
+ if (!img) {
+ img = this.item?.images?.[0]?.url
+ }
+
+ return img
+ },
+
overlayIconClass() {
if (
this.item?.item_type === 'channel' ||
diff --git a/platypush/backend/http/webapp/src/components/panels/Media/Players.vue b/platypush/backend/http/webapp/src/components/panels/Media/Players.vue
index 6c9a8ccf4d..e2950fb9ed 100644
--- a/platypush/backend/http/webapp/src/components/panels/Media/Players.vue
+++ b/platypush/backend/http/webapp/src/components/panels/Media/Players.vue
@@ -9,8 +9,8 @@
@status="$emit('status', $event)" />
-
+
@@ -40,18 +40,20 @@
import Dropdown from "@/components/elements/Dropdown";
import DropdownItem from "@/components/elements/DropdownItem";
import Loading from "@/components/Loading";
+import Utils from '@/Utils'
import Chromecast from "@/components/panels/Media/Players/Chromecast"
import Kodi from "@/components/panels/Media/Players/Kodi";
import Mplayer from "@/components/panels/Media/Players/Mplayer";
import Mpv from "@/components/panels/Media/Players/Mpv";
-import Omxplayer from "@/components/panels/Media/Players/Omxplayer";
+import GStreamer from "@/components/panels/Media/Players/GStreamer";
import Vlc from "@/components/panels/Media/Players/Vlc";
export default {
name: "Players",
- components: {Loading, DropdownItem, Dropdown, Chromecast, Kodi, Mplayer, Mpv, Omxplayer, Vlc},
+ components: {Loading, DropdownItem, Dropdown, Chromecast, Kodi, Mplayer, Mpv, GStreamer, Vlc},
emits: ['select', 'status'],
+ mixins: [Utils],
props: {
pluginName: {
@@ -89,7 +91,16 @@ export default {
this.players.push(...players)
if (this.selectedPlayer == null && plugin.pluginName === this.pluginName && players.length > 0) {
- this.select(players[0])
+ const urlSelectedPlayer = this.getUrlArgs().player
+ let player = players[0]
+
+ if (urlSelectedPlayer?.length) {
+ player = players.find((p) => p.name === urlSelectedPlayer)
+ if (!player)
+ player = players[0]
+ }
+
+ this.select(player)
}
}))
} finally {
diff --git a/platypush/backend/http/webapp/src/components/panels/Media/Players/Chromecast.vue b/platypush/backend/http/webapp/src/components/panels/Media/Players/Chromecast.vue
index 2d4ff232e9..7d68711266 100644
--- a/platypush/backend/http/webapp/src/components/panels/Media/Players/Chromecast.vue
+++ b/platypush/backend/http/webapp/src/components/panels/Media/Players/Chromecast.vue
@@ -8,6 +8,7 @@ import Mixin from "@/components/panels/Media/Players/Mixin";
export default {
name: "Chromecast",
mixins: [Mixin],
+ emits: ['status'],
data() {
return {
name: 'Chromecast',
@@ -48,12 +49,20 @@ export default {
)?.status
},
- async play(resource, player) {
+ async play(resource, subs, player) {
if (!resource) {
return await this.pause(player)
}
- return await this.request(`${this.pluginName}.play`, {resource: resource.url, chromecast: this.getPlayerName(player)})
+ return await this.request(
+ `${this.pluginName}.play`,
+ {
+ resource: resource.url,
+ chromecast: this.getPlayerName(player),
+ subtitles: subs,
+ metadata: resource,
+ }
+ )
},
async pause(player) {
diff --git a/platypush/backend/http/webapp/src/components/panels/Media/Players/Omxplayer.vue b/platypush/backend/http/webapp/src/components/panels/Media/Players/GStreamer.vue
similarity index 72%
rename from platypush/backend/http/webapp/src/components/panels/Media/Players/Omxplayer.vue
rename to platypush/backend/http/webapp/src/components/panels/Media/Players/GStreamer.vue
index 7cff56def0..cc86625156 100644
--- a/platypush/backend/http/webapp/src/components/panels/Media/Players/Omxplayer.vue
+++ b/platypush/backend/http/webapp/src/components/panels/Media/Players/GStreamer.vue
@@ -6,13 +6,12 @@
import Mixin from "@/components/panels/Media/Players/Mixin";
export default {
- name: "Omxplayer",
mixins: [Mixin],
data() {
return {
iconClass: 'fa fa-tv',
- name: 'OMXPlayer',
- pluginName: 'media.omxplayer',
+ name: 'GStreamer',
+ pluginName: 'media.gstreamer',
}
},
}
diff --git a/platypush/backend/http/webapp/src/components/panels/Media/Players/Mixin.vue b/platypush/backend/http/webapp/src/components/panels/Media/Players/Mixin.vue
index 2dee88fd74..71249703b7 100644
--- a/platypush/backend/http/webapp/src/components/panels/Media/Players/Mixin.vue
+++ b/platypush/backend/http/webapp/src/components/panels/Media/Players/Mixin.vue
@@ -36,12 +36,17 @@ export default {
return await this.request(`${this.pluginName}.status`)
},
- async play(resource, subs) {
+ async play(resource, subs, _, opts) {
if (!resource) {
return await this.pause()
}
- return await this.request(`${this.pluginName}.play`, {resource: resource.url, subtitles: subs})
+ const args = {resource: resource.url, subtitles: subs, metadata: resource}
+ if (opts?.cache) {
+ args.cache_streams = true
+ }
+
+ return await this.request(`${this.pluginName}.play`, args)
},
async pause() {
diff --git a/platypush/backend/http/webapp/src/components/panels/Media/Providers/Mixin.vue b/platypush/backend/http/webapp/src/components/panels/Media/Providers/Mixin.vue
index 6979010108..0931983a88 100644
--- a/platypush/backend/http/webapp/src/components/panels/Media/Providers/Mixin.vue
+++ b/platypush/backend/http/webapp/src/components/panels/Media/Providers/Mixin.vue
@@ -22,6 +22,11 @@ export default {
default: '',
},
+ loading: {
+ type: Boolean,
+ default: false,
+ },
+
selectedPlaylist: {
default: null,
},
@@ -33,8 +38,14 @@ export default {
data() {
return {
- loading: false,
+ loading_: false,
}
},
+
+ computed: {
+ isLoading() {
+ return this.loading || this.loading_
+ },
+ },
}
diff --git a/platypush/backend/http/webapp/src/components/panels/Media/Providers/YouTube.vue b/platypush/backend/http/webapp/src/components/panels/Media/Providers/YouTube.vue
index a64b85ab47..4f1c52ba1b 100644
--- a/platypush/backend/http/webapp/src/components/panels/Media/Providers/YouTube.vue
+++ b/platypush/backend/http/webapp/src/components/panels/Media/Providers/YouTube.vue
@@ -1,6 +1,6 @@