init
This commit is contained in:
commit
d0eb203443
3 changed files with 41 additions and 0 deletions
4
README.md
Normal file
4
README.md
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
## an autoplay script for LibreELEC @ RPI
|
||||||
|
|
||||||
|
- put this at /STORAGE/.kodi/addons/service.autoexec/
|
||||||
|
|
||||||
14
service.autoexec/addon.xml
Normal file
14
service.autoexec/addon.xml
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
|
<addon id="service.autoexec" name="Autoexec Service" version="1.0.0" provider-name="your username">
|
||||||
|
<requires>
|
||||||
|
<import addon="xbmc.python" version="2.1.0"/>
|
||||||
|
</requires>
|
||||||
|
<extension point="xbmc.service" library="autoexec.py">
|
||||||
|
</extension>
|
||||||
|
<extension point="xbmc.addon.metadata">
|
||||||
|
<summary lang="en_GB">Automatically run python code when Kodi starts.</summary>
|
||||||
|
<description lang="en_GB">The Autoexec Service will automatically be run on Kodi startup.</description>
|
||||||
|
<platform>all</platform>
|
||||||
|
<license>GNU GENERAL PUBLIC LICENSE Version 2</license>
|
||||||
|
</extension>
|
||||||
|
</addon>
|
||||||
23
service.autoexec/autoexec.py
Normal file
23
service.autoexec/autoexec.py
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
# Autoplay videodirectory
|
||||||
|
import os, xbmc
|
||||||
|
|
||||||
|
# set path to dir you want to play
|
||||||
|
path = "/var/media/USB"
|
||||||
|
|
||||||
|
dirList = os.listdir(path)
|
||||||
|
dirList[:] = [d for d in dirList if not os.path.isdir(path + d)]
|
||||||
|
|
||||||
|
videoList = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
|
||||||
|
videoList.clear()
|
||||||
|
|
||||||
|
for fname in dirList:
|
||||||
|
videoList.add(path + "/" + fname)
|
||||||
|
|
||||||
|
# shuffle playlist
|
||||||
|
#videoList.shuffle()
|
||||||
|
|
||||||
|
# put playlist on repeat
|
||||||
|
xbmc.executebuiltin("xbmc.playercontrol(RepeatAll)")
|
||||||
|
|
||||||
|
# play playlist
|
||||||
|
xbmc.Player().play(videoList)
|
||||||
Loading…
Reference in a new issue