Here’s a quick tip for today.
If you’ve got a few spares Raspberry Pis lying around (like I do) then sometimes they can come in handy as a portable media player. However, given that I don’t know the capabilities of the television with which the Pi will be used (at the bare minimum it has HDMI) then I am left guessing whether or not things like using the remote control will work.
To save messing around, I decided to configure OSMC on the Pi to autoplay a single video located on a USB stick. This is how you do it:
- Locate or create /home/osmc/.kodi/userdata/autoexec.py
- Add the following lines to the file:
xbmc.executebuiltin( “PlayMedia(/media/[labelofusbstick]/[path]/[videofilename])” )
You’ll need to replace [labelofusbstick] with the volume label of the USB stick, [path] with the folder structure where the video is located, and [videofilename] with the filename of the video.
After you save the file, reboot your Raspberry Pi and when it boots up again it should launch straight into the video!