Skip to content

Instantly share code, notes, and snippets.

@schlomo
Created May 15, 2014 06:23
Show Gist options
  • Save schlomo/1c9b352ba19b5e33f9c4 to your computer and use it in GitHub Desktop.
Save schlomo/1c9b352ba19b5e33f9c4 to your computer and use it in GitHub Desktop.
XBMC automatically play all videos in a permanent loop. Ideal for video presentations, digital signage or party mode.
# See also http://wiki.xbmc.org/index.php?title=Autoexec.py
# Put this into the userdata folder, see http://wiki.xbmc.org/index.php?title=Userdata for details where this is for each platform
import xbmc
xbmc.executebuiltin('xbmc.PlayMedia("/storage/videos/","isdir")')
xbmc.executebuiltin('xbmc.PlayerControl(repeatall)')
xbmc.executebuiltin("Action(Fullscreen)")
@wrybread
Copy link

wrybread commented Apr 9, 2023

Thanks, was a great starting point for me, but your script didn't work for me without a modification. This fixes it with Kodi 19.5 / Android 12 (running on a Chromecast with Google TV). Had to remove the "xmbc" from the actual commands. I'm guessing something has changed in the 9 years since you posted the above.

import xbmc
xbmc.executebuiltin('PlayMedia("smb://192.168.1.8/stuffage/DroneStuff/compressed","isdir")')
xbmc.executebuiltin('PlayerControl(RepeatAll)')

# if you want random
xbmc.executebuiltin('PlayerControl(RandomOn)')

xbmc.executebuiltin("Action(Fullscreen)")

@schlomo
Copy link
Author

schlomo commented Apr 9, 2023

Thanks, maybe over 9 years XBMC changed a bit 😄

@wrybread
Copy link

wrybread commented Apr 9, 2023

Ha yup. Thanks hugely for your script by the way, pointed me in the right direction.

Now I have an old TV happily cycling through my massive library of otherwise ignored videos I've shot on my drone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment