[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.
This commit is contained in:
Fabio Manganiello 2023-11-04 11:53:26 +01:00
parent b4bf30945a
commit 5478b90288
Signed by: blacklight
GPG key ID: D90FBA7F76362774
2 changed files with 6 additions and 6 deletions

View file

@ -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})
},
},
}

View file

@ -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')
},