Distinguish between video and audio play in Kodi

Target: I would like to dim the lights when Kodi plays video content, but not if Kodi plays audio content.

Question: Is it possible to distinguish for a trigger event “playing” what kind of content Kodi mediaplayer is playing? How?

As it took some time to figure it out on my own, for your benefit here is a value template that evaluates to true if kodi plays a movie, a tvshow, or a video.

{{ state_attr('media_player.kodi', 'media_content_type') in ['movie', 'tvshow', 'video'] }}

The other value for the media_content_typestate attribute that you can test for is 'music'.