#loop.py 6/1/2022 #This is a test program to recreate a problem #The program loads a video and then continually loops by using a seek back to 0 import xbmcaddon import xbmcgui import xbmc import time class Main: #LibreELEC file paths url='//storage//videos//haunt.mp4' #set up player title = "Loop video" try: xlistitem = xbmcgui.ListItem( title, path=url) except: xlistitem = xbmcgui.ListItem( title, ) xlistitem.setInfo( "video", { "Title": title } ) #create a playlist, clear it, add a playlist entry with my one item (plus metadata) playlist = xbmc.PlayList( xbmc.PLAYLIST_VIDEO ) playlist.clear() playlist.add( url, xlistitem ) # create a player of type xbmc.Player, and run it xbmcPlayer = xbmc.Player(listitem=None, windowed=False, sublist=None) xbmcPlayer.play(playlist) #initialize timers start_time=time.time() seek_count=0 #keep track of how many seeks have been made timer=time.time() loop_duration = 0.3 #seconds to loop video popupcounter=0 while (True): # play for the specified duration and seek back to 0 if (time.time()-start_time) > loop_duration: xbmc.Player().seekTime(0.0) #use a popup window to display the loop counter #window name, text, duration in ms if popupcounter>9: xbmc.executebuiltin('Notification(Loop Test,' + str(seek_count) + ', 2000)') popupcounter=0 popupcounter+=1 start_time=time.time() seek_count+=1 #increment the counter xbmc.sleep(100) if (__name__ == "__main__"): Main()