Trovata documentazione, documentato il tutto.
This commit is contained in:
parent
b53fd9119c
commit
670a70535a
4 changed files with 43 additions and 5 deletions
16
service.autoexec/addon.xml
Normal file
16
service.autoexec/addon.xml
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<addon id="service.autoexec" name="Autoexec Service" version="1.0.0" provider-name="syntaxerrormmm">
|
||||
<requires>
|
||||
<import addon="xbmc.python" version="3.0.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>
|
||||
<summary lang="it_IT">Esegui automaticamente del codice python quando Kodi si avvia.</summary>
|
||||
<description lang="en_GB">The Autoexec Service will automatically be run on Kodi startup.</description>
|
||||
<description lang="it_IT">Autoexec Service verrà eseguito automaticamente all'avvio del sistema Kodi.</description>
|
||||
<platform>all</platform>
|
||||
<license>MIT LICENSE</license>
|
||||
</extension>
|
||||
</addon>
|
29
service.autoexec/movies.py
Normal file
29
service.autoexec/movies.py
Normal file
|
@ -0,0 +1,29 @@
|
|||
import sys
|
||||
import xbmc
|
||||
|
||||
def RepeatVideo(file):
|
||||
playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
|
||||
playlist.clear()
|
||||
playlist.add(file)
|
||||
xbmc.Player().play(playlist)
|
||||
xbmc.executebuiltin("PlayerControl(RepeatOne)")
|
||||
|
||||
def RepeatListVideos(a_tuple):
|
||||
playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
|
||||
playlist.clear()
|
||||
for video in a_tuple:
|
||||
playlist.add(video)
|
||||
xbmc.Player().play(playlist)
|
||||
xbmc.executebuiltin("PlayerControl(RepeatAll)")
|
||||
|
||||
# Eseguo un solo file in loop
|
||||
#RepeatVideo("/home/osmc/Movies/presentazione_NS.avi")
|
||||
|
||||
# Definisco una playlist come una tupla
|
||||
playlist = (
|
||||
"/home/osmc/Movies/presentazione_NS.avi",
|
||||
"/home/osmc/Movies/#diciotto-1080.mp4"
|
||||
)
|
||||
|
||||
# Ripeto una lista di video
|
||||
RepeatListVideos(playlist)
|
4
service.autoexec/slideshow.py
Normal file
4
service.autoexec/slideshow.py
Normal file
|
@ -0,0 +1,4 @@
|
|||
import xbmc
|
||||
|
||||
path = "PathToYourMedia"
|
||||
xbmc.executebuiltin(f'RecursiveSlideShow({path})')
|
Loading…
Add table
Add a link
Reference in a new issue