This works a treat for me. I have used this to autostart a video on XBMC.
In my case it autoplays on boot from the raspberry pi, using OpenELEC.
For me the video file to autoplay was on an attached usb dongle. I checked the address using the built in file manager, which was
/var/media/KINGSTON/Horizon.m4v
This then translated to an autoexec.py containing the following text
Code:
import xbmc
xbmc.executebuiltin("PlayMedia(\\var\\media\\KINGSTON\\Horizon.m4v)")
This was saved into the OPENELEC > Userdata folder using Finder from my mac over the network.
It can also be transferred to the device using the same usb dongle, then using the built in file manager to copy the file to the Profile Directory.
I also needed one further tweak. By defauly XBMC would ask whether to start from beginning or resume the video file at previous point. I therefore made an advancedsettings.xml file which told it to ignore resume within a number of settings (i chose 36000 seconds, or 10 hours). This file sits in the same directory as the autoexec.py above. OPENELEC > Userdata.
Here is the advancedsettings.xml file:
Code:
<advancedsettings>
<video>
<ignoresecondsatstart>36000</ignoresecondsatstart>
</video>
</advancedsettings>
Finally, I had to remove the bookmark for the file, which is one of the options during playback. With the bookmark removed the file autoplays on booting the device.
I think this could be a great Kiosk style application...