Skip to content

Conversation

@wutschel
Copy link
Collaborator

@wutschel wutschel commented Jan 23, 2026

Description

This PR is related to xbmc/xbmc#19344 which was raised and discussed long ago with Kodi developers.

Background

The app uses XBMC.GetInfoLabels to read information on audio/video codecs of the current playing item and image/exif data when showing images. This information is displayed in the NowPlaying overlay. I personally have a use case (and maybe others as well), where Kodi is running on a headless system for music playback and is minimized to tray. When minimizing Kodi the info labels just not updated anymore and keep the data from the last time they were updated in non-minimized mode. The right solution is to use Player.GetProperties which is always up-to-date.
Problem with Player.GetProperties is that this give an empty response for audiostrreams on Kodi versions < 19, and that Player.GetProperties does not provide audiostream's bits-per-sample and video stream's aspect ratio and resolution.

Approach

The approach taken is to let the app prefer data from Player.GetProperties by reading this first, and only fill empty fields with information coming from 'XBMC.GetInfoLabels'. This keeps supporting Kodi < 19, and improves the user experience for headless systems (as mine 😊).
Best would be to also see bits-per-sample, aspect ratio and resolution directly shared via Player.GetProperties, I might raise a feature request to Kodi.

As a side note: resolution can be derived from video's height by mimicking Kodi's logic to derive the resolution. For aspect ratio this does not work as expected, I saw differences for videos with dimensions of 352x288.

Summary for release notes

Improvement: NowPlaying overlay shows codec when Kodi is minimized to tray

Define three dedicated methods to handle audio, video and pictures.
Do not make hiresImage invisible for each call of loadCodecView before checking its visibility in case of audio. Instead, always keep this invisible for non-audio, and set the visibility in loadAudioCodecDetails.
Use Player.GetProperties as main source for audiostream info. If this is empty, like for Kodi < 19, fall back to formerly used XBMC.GetInfoLabels.
This also fixes missing or not changing audio codec info while Kodi is minimized, e.g. using headless setups.
Remind: Only XBMC.GetInfoLabels provides bits-per-sample.
Use Player.GetProperties as main source for videostream info. If this is empty, fall back to formerly used XBMC.GetInfoLabels.
Remind: Only XBMC.GetInfoLabels provides aspect and resolution directly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant