From 5478b9028846617c40e32427644bbc7ebdcef970 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sat, 4 Nov 2023 11:53:26 +0100 Subject: [PATCH] [Media UI] Start/stop streaming use the configured media plugin. The base `media` plugin is abstract, hence the `Media` panel needs to pass the current media plugin to the `Utils` mixins so it can pick the right action. --- .../backend/http/webapp/src/components/Media/Utils.vue | 8 ++++---- .../http/webapp/src/components/panels/Media/Index.vue | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/platypush/backend/http/webapp/src/components/Media/Utils.vue b/platypush/backend/http/webapp/src/components/Media/Utils.vue index 05ec8f38e9..b8310e9aed 100644 --- a/platypush/backend/http/webapp/src/components/Media/Utils.vue +++ b/platypush/backend/http/webapp/src/components/Media/Utils.vue @@ -54,7 +54,7 @@ export default { return ret.join(':') }, - async startStreaming(resource, download=false) { + async startStreaming(resource, pluginName, download=false) { let url = resource let subtitles = null @@ -65,7 +65,7 @@ export default { resource = {url: url} } - const ret = await this.request(`media.start_streaming`, { + const ret = await this.request(`${pluginName}.start_streaming`, { media: url, subtitles: subtitles, download: download, @@ -74,8 +74,8 @@ export default { return {...resource, ...ret} }, - async stopStreaming(mediaId) { - await this.request('media.stop_streaming', {media_id: mediaId}) + async stopStreaming(mediaId, pluginName) { + await this.request(`${pluginName}.stop_streaming`, {media_id: mediaId}) }, }, } 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 ea3933ff09..0432eace86 100644 --- a/platypush/backend/http/webapp/src/components/panels/Media/Index.vue +++ b/platypush/backend/http/webapp/src/components/panels/Media/Index.vue @@ -160,7 +160,7 @@ export default { } if (!this.selectedPlayer.component.supports(item)) - item = await this.startStreaming(item) + item = await this.startStreaming(item, this.pluginName) await this.selectedPlayer.component.play(item, this.selectedSubtitles, this.selectedPlayer) await this.refresh() @@ -187,7 +187,7 @@ export default { }, async view(item) { - const ret = await this.startStreaming(item, true) + const ret = await this.startStreaming(item, this.pluginName, true) window.open(ret.url, '_blank') },