WTH is with the flashing image in the media player card for an Android TV

I have both an Nvidia Shield, and a Sony Android TV.

I have them added to Home Assistant with the official Android ADB integration (can’t remember the exact name).

I have media player cards for them.

The media player cards show a still image of the screen on each Android TV device, this is amazing!

What kinda sucks though, is that everytime a new screengrab is fetched every few seconds, the image in the media player disappears for a second or two, while it loads the new one.

It really spoils the look of my wall tablet, and is quite distracting.

I have seen this reported in the GitHub before, but I think it was never addressed as may have been an off topic reply to a separate issue.

I have seen others that have experienced this issue, so I know it’s not just a problem with my set up.

It’s not just the official media player card that this bug affects, I have seen it with the custom mini media player card too.

I can provide a screen capture video of the issue if that helps.

Cheers dudes, Choo Choo

I have the same issue with the built-in media player card, the artwork reloads every 10 seconds and takes half a second to re appear making the interface repeatively flash. I made an animated .gif to show the issue… It would be nice if the refreshed artwork would fade over the old image!

HA-MediaPlayer-Card-PythonADB-ArtReloadsTooOften

2 Likes

Just wanted to post an update on a quick solution, in case this is useful for anyone.

So I did a bunch of updates today…

Took HA from v0.112.x -> v0.114.4

I also updated all my HACS integrations and frontend components.

It seems that the Mini Media Player (https://github.com/kalkih/mini-media-player) custom component has implemented a fix/workaround for the image flashing. Using this component there is now a fade between image captures. HA’s built-in media control component still suffers from the flashing, so i’m moving to the Mini Media Player for now.

3 Likes

Looks like the fix was a style adjustment: https://github.com/kalkih/mini-media-player/pull/402/files. I tried looking through the frontend code to find a place to apply a similar change but I am braindead when it comes to JS/TS so hopefully someone else who has the right experience sees this and can make the corresponding change

From a quick cursory glance, it seems that the mini media player was already keeping the previous image in the DOM when loading a new image, making a CSS based transition a trivial change to the existing code.

I’ve no idea whether the home assistant media control card follows the same principle, but it’s certainly one solution.

If I already had a HA Dev environment set up, I’d be up for putting together a Pull Request, but I can’t spare the time to set one up right now. Would probably be a trivial task to implement a solution for someone that is already set up to code on the project.

Found the card, it does seem like the old image is available: https://github.com/home-assistant/frontend/blob/994a39723123e65e76de100c68b2c19d96b7d18c/src/panels/lovelace/cards/hui-media-control-card.ts#L501-L513

I think this is the area that would need to be updated? https://github.com/home-assistant/frontend/blob/994a39723123e65e76de100c68b2c19d96b7d18c/src/panels/lovelace/cards/hui-media-control-card.ts#L790-L801

That’s about as far as I can go lol

There would need to be a bit more of a change. We planned on eventually creating a controller for the media card. So that if the image changed to undefined we would wait a second before switching unless the new image came in. I don’t think there is a good css solution in our card

This was the original PR but I never finished it

It’s a good write up of what needs to be done. In another world that had more free time I’d be happy to jump in and finish it off, but alas!

Good work though, it lists the problems along with a solution the team is happy with. Hopefully someone picks this up eventually :+1:

any progress on this? I’m ont he latest release and still have the flashing (disapearing, reapearing) images. Is there a workaround / non official addon I can use as mediacard which has a fix?

Kind regards,
Jeroen

@darkpainy Yes, I’ve been using the Mini Media Player card with great success!

To quote from an earlier update in this thread:

1 Like