unfoldedcircle / feature-and-bug-tracker

Feature and bug tracker repository for Unfolded Circle products
21 stars 0 forks source link

[bug] Media player image not always displaying #364

Open petercv opened 2 months ago

petercv commented 2 months ago

Is there an existing issue for this?

Description

I've created my own integration for Dune-HD players. While developing this integration I ran into a bug. When the integration is playing a media item I set the MEDIA_IMAGE_URL attribute to an image URL. The first time I do this for a certain image the remote displays the image fine. When the user stops playing the media item I clear the image (set it to an empty string or null). When the user then tries to play the same media item again I again set the MEDIA_IMAGE_URL, this time however the image isn't displayed. When you close the activity (not power off!) and open the activity again the image is displayed (even though no new metadata has been sent, so it uses the URL send earlier).

A workaround that works 90% of the time is instead of setting the image to an empty string, is setting the image to a data URL with a black pixel when stopping playback. This seems to make the remote know it now needs to display a different image and it properly displays the image. Same goes for playing a different item with a different image and then returning to the earlier item.

I think this might have not been noticed before because (some?) of the built-in integrations, at least the Apple TV integration, doesn't properly clear the image when playback is stopped (https://github.com/unfoldedcircle/feature-and-bug-tracker/issues/2). This way when you start playback of the same item again it is still displaying the image it was already displaying anyway. (This is also an annoying bug because it keeps displaying for example a Netflix image when I'm playing a totally different YouTube video).

How to Reproduce

  1. Play media item, set MEDIA_IMAGE_URL.
  2. Image is properly displayed on the remote.
  3. Stop playing media item, clear MEDIA_IMAGE_URL (set to empty string or null).
  4. Play same media item again, and set 'MEDIA_IMAGE_URL` again (to same image URL).
  5. Image is not displayed on the remote.

Expected behavior

Image should be displayed on the remote.

System version

v1.7.7

What part of the system affected by the problem?

UI

Additional context

My integration can be found here https://github.com/petercv/ucr2-integration-dunehd. It is loosely based on the Denon AVR / Apple TV integrations and I'm currently using the workaround of setting a black pixel image through a data URL when stopping playback of an item. This works almost perfectly, however when the remote goes to standby it also sometimes doesn't display the image anymore.