Random order playback on Kodi?

Hi, I’m using a script to play a cartoons playlist for my kid like this:

sequence:
  - service: media_player.play_media
    target:
      entity_id: media_player.libreelec
    data:
      media_content_type: DIRECTORY
      media_content_id: special://profile/playlists/video/krtek.m3u
mode: single

How do I make this so it plays a random episode?

The content is on my Syno NAS, so not local. The path is

smb://SYNO.local/Public/Video/Pohadky/Krtek (1957)

The files are all in one folder, so maybe I could play that instead of the M3U playlist. AFAIK I had this working before but I can’t find out how, even with searching this forum. I’m seeing local-only solutions. Another issue is for specific reason, these files are NOT in the Kodi library (I access them via Kodi’s File browser, not the Movies/TV SHows views), so they cannot be added in Smart playlists.

Documentation for Kodi integration in HA focuses solely on music for some reason.

Tips? Thanks!

Nobody? I still haven’t figured this out

Was looking for the same thing.
looks like you can set shuffle mode on.

Service media_player.shuffle_set
Currently only supported on Sonos, Spotify, MPD, Kodi, Roon, OwnTone, Squeezebox and Universal.

Service data attribute	Optional	Description
entity_id	yes	Target a specific media player. For example media_player.spotify
shuffle	no	true/false for enabling/disabling shuffle