diff --git a/data_centre.py b/data_centre.py index 4698155..423f859 100644 --- a/data_centre.py +++ b/data_centre.py @@ -120,7 +120,7 @@ def add_folder_to_browser_list(current_path, current_level,open_folder_list): add_folder_to_browser_list(next_path, next_level,open_folder_list) for f in files: - if (os.path.splitext(f)[1] in ['.mp4']): + if (os.path.splitext(f)[1] in ['.mp4', '.mkv']): #print('{}{}'.format(indent, f)) results.append(dict(name='{}{}'.format(indent, f), bank='-')) diff --git a/display_centre.py b/display_centre.py index 7fcd700..00a9ab0 100644 --- a/display_centre.py +++ b/display_centre.py @@ -236,6 +236,10 @@ def key(event): ## 'l' pauses/unpauses the video elif(event.char in ['l']): video_driver.current_player.toggle_pause() + elif(event.char in ['j']): + video_driver.current_player.jump_video_back() + elif(event.char in ['k']): + video_driver.current_player.jump_video_forward() def up_key(event): diff --git a/display_data.json b/display_data.json index 612c886..83e3dbf 100644 --- a/display_data.json +++ b/display_data.json @@ -1,2 +1 @@ -[{"start": -1, "length": 4, "end": -1, "location": "/media/pi/TIM1/samplerloop3s.mp4", "name": "samplerloop3s.mp4"}, {"start": -1, "length": 5, "end": -1, "location": "/media/pi/TIM1/samplerloop3s2.mp4", "name": "samplerloop3s2.mp4"}, {"start": -1, "length": 3, "end": -1, "location": "/media/pi/TIM1/samplerloop3s3.mp4", "name": "samplerloop3s3.mp4"}, {"start": -1, "length": 3, "end": -1, "location": "/media/pi/TIM1/samplerloop3s3.mp4", "name": "samplerloop3s3.mp4"}, {"start": -1, "length": 3, "end": -1, "location": "/media/pi/TIM1/samplerloop3s3.mp4", "name": "samplerloop3s3.mp4"}, {"start": -1, "length": 26, "end": -1, "location": "/media/pi/TIM1/TRASHPALACEVIDEOS/01_trashpalaceintro.mp4", "name": "01_trashpalaceintro.mp4"}, {"start": -1, "length": 97, "end": -1, "location": "/media/pi/TIM1/TRASHPALACEVIDEOS/04_THEORY_OF_OBSCURITY.mp4", "name": "04_THEORY_OF_OBSCURITY.mp4"}, {"start": -1, "length": -1, "end": -1, "location": "", "name": ""}, {"start": -1, "length": -1, "end": -1, "location": "", "name": ""}, {"start": -1, "length": -1, "end": -1, "location": "", "name": ""}, {"start": -1, "length": -1, "end": -1, "location": "", "name": ""}, {"start": -1, "length": -1, "end": -1, "location": "", "name": ""}, {"start": -1, "length": -1, "end": -1, "location": "", "name": ""}, {"start": -1, "length": -1, "end": -1, "location": "", "name": ""}, {"start": -1, "length": -1, "end": -1, "location": "", "name": ""}] - +[{"start": -1, "length": 60, "end": -1, "location": "/media/pi/TIM1/TRASHPALACEVIDEOS/07_The_Apple.mkv", "name": "07_The_Apple.mkv"}, {"start": -1, "length": 304, "end": -1, "location": "/media/pi/TIM1/TRASHPALACEVIDEOS/06_Getting_Out_of_Bed.mp4", "name": "06_Getting_Out_of_Bed.mp4"}, {"start": -1, "length": -1, "end": -1, "location": "", "name": ""}, {"start": -1, "length": -1, "end": -1, "location": "", "name": ""}, {"start": -1, "length": -1, "end": -1, "location": "", "name": ""}, {"start": -1, "length": -1, "end": -1, "location": "", "name": ""}, {"start": -1, "length": -1, "end": -1, "location": "", "name": ""}, {"start": -1, "length": -1, "end": -1, "location": "", "name": ""}, {"start": -1, "length": -1, "end": -1, "location": "", "name": ""}, {"start": -1, "length": -1, "end": -1, "location": "", "name": ""}, {"start": -1, "length": -1, "end": -1, "location": "", "name": ""}, {"start": -1, "length": -1, "end": -1, "location": "", "name": ""}, {"start": -1, "length": -1, "end": -1, "location": "", "name": ""}, {"start": -1, "length": -1, "end": -1, "location": "", "name": ""}, {"start": -1, "length": -1, "end": -1, "location": "", "name": ""}] diff --git a/next_bank_number.json b/next_bank_number.json index 573541a..56a6051 100644 --- a/next_bank_number.json +++ b/next_bank_number.json @@ -1 +1 @@ -0 +1 \ No newline at end of file diff --git a/omxdriver.py b/omxdriver.py index e78d8e7..afe0a3f 100644 --- a/omxdriver.py +++ b/omxdriver.py @@ -409,7 +409,8 @@ class OMXDriver(object): logger.info('warn'+'Failed to toggle pause - process not running') return - + def run_action(self, num): + self.__iface_player.Action(num) def stop(self): logger.info('log'+'>stop received and quit sent to omxplayer {} '.format(self.pid)) diff --git a/video_centre.py b/video_centre.py index ade280d..d006f49 100644 --- a/video_centre.py +++ b/video_centre.py @@ -177,16 +177,22 @@ class video_player(object): def toggle_pause(self): is_paused = self.omx.omxplayer_is_paused() print is_paused - if is_paused == 'RUNNING': + if is_paused == 'Playing': if self.omx.send_pause(): self.status = 'PAUSED' return - elif is_paused == 'PAUSED': + elif is_paused == 'Paused': if self.omx.send_unpause(): self.status = 'PLAYING' return print 'failed to toggle pause (this needs to be in message)' + def jump_video_forward(self): + self.omx.run_action(20) + + def jump_video_back(self): + self.omx.run_action(19) + # tk = Tk()