got reload working

This commit is contained in:
langolierz
2017-12-26 05:34:02 +00:00
parent 1511134a80
commit d5f7745bd4
3 changed files with 10 additions and 4 deletions

View File

@@ -238,9 +238,10 @@ def key(event):
## 'num' sets current selection to bank number num
elif event.char in ['0', '1', '2', '3', '4', '5', '6', '7','8','9']:
data_centre.update_next_bank_number(int(event.char))
# video_driver.next_player.reload_content()
video_driver.next_player.reload()
## 'enter' sets manual next flag
elif event.char in ['\r']:
print('manual skip')
video_driver.manual_next = True
## '*' switches display mode
elif(event.char in ['*']):

View File

@@ -1 +1 @@
7
4

View File

@@ -33,11 +33,11 @@ class video_player:
def pause_at_start(self):
position = self.get_position()
print('{}: the pause_at_start position is {}'.format(self.name, position))
if(position > -0.05):
if(position > -0.055):
self.status = 'LOADED'
self.player.pause()
print('{}: its paused'.format(self.name))
else:
elif(self.omx_running):
self.root.after(5,self.pause_at_start)
def play(self):
@@ -56,6 +56,11 @@ class video_player:
elif(self.omx_running):
self.root.after(5,self.pause_at_end)
def reload(self):
self.exit()
self.omx_running = False
self.load()
def is_loaded(self):
return self.status is 'LOADED'