adding pause toggle

This commit is contained in:
Tim Caldwell
2017-11-02 22:17:40 +13:00
parent b2a4b212d0
commit 38d403fd3b
2 changed files with 23 additions and 6 deletions

View File

@@ -174,8 +174,19 @@ class video_player(object):
self.omx.stop()
self.omx = OMXDriver(self.widget, '')
def pause_content(self):
self.status = 'PAUSED'
def toggle_pause(self):
is_paused = self.omx.omxplayer_is_paused()
print is_paused
if is_paused == 'RUNNING':
if self.omx.send_pause():
self.status = 'PAUSED'
return
elif is_paused == 'PAUSED':
if self.omx.send_unpause():
self.status = 'PLAYING'
return
print 'failed to toggle pause (this needs to be in message)'
# tk = Tk()