How to change the music player cover image from Python?
#1
I've been trying to change the cover image shown by the music player during playback for a few days, no luck so far. This forum post seems to imply that infolabels can be changed through window properties, but setting i.e. MusicPlayer.Cover this way doesn't change the image in the player. I've also tried ListItem.setArt() for the current playlist item, without success.

Is this even possible? (I'm working with Kodi v19.)
Reply
#2
Another thing that didn't work is Player.updateInfoTag(), which explicitly mentions "info labels for currently playing item" in the documentation. I think this one puzzled me the most.
Reply
#3
More discoveries: Player.updateInfoTag() does work, but apparently only for script-style addons that use Player.play() to start the stream, not for plugin-style addons that use setResolvedUrl() to start the stream. I tried using Player.play() from a plugin-style addon, but unfortunately it didn't work.
Reply
#4
I guess that's the intended functionality. You can create a service extension with a monitor class that loops until Kodi is aborted. Inside instantiate a player object and listen to onAvSatrted events. On that callback, check for the path being played and if it is from your plugin extension (plugin://XXX) you can then use the updateinfotag call
Reply
#5
(2020-12-30, 23:36)enen92 Wrote: I guess that's the intended functionality. You can create a service extension with a monitor class that loops until Kodi is aborted. Inside instantiate a player object and listen to onAvSatrted events. On that callback, check for the path being played and if it is from your plugin extension (plugin://XXX) you can then use the updateinfotag call

That's what I've been doing and it works for scripts, but not plugins. So my plan now is to write a script-style addon with a minimal GUI for starting the streams, but using the built-in player (since I don't want to replicate the player GUI).
Reply

Logout Mark Read Team Forum Stats Members Help
How to change the music player cover image from Python?0