{"id":6732,"date":"2015-05-03T19:40:50","date_gmt":"2015-05-03T09:40:50","guid":{"rendered":"http:\/\/mingersoft.com\/blog\/?p=6732"},"modified":"2015-05-03T20:23:47","modified_gmt":"2015-05-03T10:23:47","slug":"how-to-autoplay-videos-upon-boot-on-kodi","status":"publish","type":"post","link":"https:\/\/mingersoft.com\/blog\/2015\/05\/how-to-autoplay-videos-upon-boot-on-kodi\/","title":{"rendered":"How to Autoplay Videos Upon Boot on Kodi"},"content":{"rendered":"<p>Here&#8217;s a quick tip for today.<\/p>\n<p>If you&#8217;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&#8217;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.<\/p>\n<p>To save messing around,\u00a0I decided to configure OSMC on the\u00a0Pi to autoplay\u00a0a single video located on a USB stick. This is how you do it:<\/p>\n<ol>\n<li>Locate or create <strong>\/home\/osmc\/.kodi\/userdata\/autoexec.py<\/strong><\/li>\n<li>Add the following lines to the file:<\/li>\n<\/ol>\n<blockquote><p>import xbmc<\/p>\n<p>xbmc.executebuiltin( &#8220;PlayMedia(\/media\/[labelofusbstick]\/[path]\/[videofilename])&#8221; )<\/p><\/blockquote>\n<p>You&#8217;ll need to replace <strong>[labelofusbstick]<\/strong>\u00a0with the volume label of the USB stick, <strong>[path]<\/strong>\u00a0with the folder structure where the video is located, and [<strong>videofilename]<\/strong>\u00a0with the\u00a0filename of the video.<\/p>\n<p>After you save the file, reboot your Raspberry Pi and when it boots up again it should launch straight into the video!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s a quick tip for today. If you&#8217;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&#8217;t know the capabilities of the television with which the Pi will be used (at the bare minimum it has &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"https:\/\/mingersoft.com\/blog\/2015\/05\/how-to-autoplay-videos-upon-boot-on-kodi\/\">Continue reading<\/a><\/p>\n","protected":false},"author":1,"featured_media":3912,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[976,332,18],"tags":[2233,1864,1879],"class_list":["post-6732","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arm","category-processors","category-technology","tag-kodi","tag-raspberry-pi","tag-xbmc","item-wrap"],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/mingersoft.com\/blog\/wp-content\/uploads\/2012\/04\/XBMC-Logo.png?fit=300%2C300&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/mingersoft.com\/blog\/wp-json\/wp\/v2\/posts\/6732","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mingersoft.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mingersoft.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mingersoft.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mingersoft.com\/blog\/wp-json\/wp\/v2\/comments?post=6732"}],"version-history":[{"count":0,"href":"https:\/\/mingersoft.com\/blog\/wp-json\/wp\/v2\/posts\/6732\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mingersoft.com\/blog\/wp-json\/wp\/v2\/media\/3912"}],"wp:attachment":[{"href":"https:\/\/mingersoft.com\/blog\/wp-json\/wp\/v2\/media?parent=6732"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mingersoft.com\/blog\/wp-json\/wp\/v2\/categories?post=6732"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mingersoft.com\/blog\/wp-json\/wp\/v2\/tags?post=6732"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}