To set up an autoplaying headless media center
- Raspberry Pi
- monitor/keyboard for setup
- Download OSMC (https://osmc.tv/download/)
- Flash it to SD card
- Mount the boot parition
- Append
hdmi_force_hotplug=1toconfig.txt(allows boot without monitor connected) - Boot up and walk through the setup (Need a monitor)
- Create a file
/home/osmc/.kodi/userdata/autoexec.py - Enter the following contents
import xbmc
xbmc.executebuiltin( "PlayMedia(/home/osmc/playlist.m3u)" )
xbmc.executebuiltin( "PlayerControl(repeat)" )
- Create
/home/osmc/playlist.m3uIts contents is a line delimited list of media (local or remote)
For the complete list of actions you can take you can go to http://kodi.wiki/view/List_of_built-in_functions and you can use xbmc-send to test out your functions before adding to your script
xbmc-send --host=192.168.0.1 --port=9777 --action="XBMC.Quit"