From c572956e271872b511c8d9419ec3d698a19c8095 Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Wed, 26 Oct 2022 12:44:58 +0700 Subject: [PATCH] Implement video playing functions --- kuukar_lcd.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/kuukar_lcd.py b/kuukar_lcd.py index 0891383..c5c3250 100644 --- a/kuukar_lcd.py +++ b/kuukar_lcd.py @@ -2,6 +2,7 @@ import kuukar_nextion class lcd: def __init__(self) -> None: self.nextion = kuukar_nextion.nextion() + self.nextion.send_command("page home") def keke_uwu(self): pass @@ -10,7 +11,7 @@ class lcd: pass def keke_hurt(self): - pass + self.play_video("keke_hurt") def keke_died(self): pass @@ -19,14 +20,17 @@ class lcd: pass def play_video(self,filename: str) -> None: - pass - + self.nextion.send_command("page video_player") + self.nextion.send_command("video.path=\"sd0/"+filename+".video\"") + self.nextion.send_command("video.en=1") + def pause_video(self) -> None: - pass + self.nextion.send_command("video.en=2") def resume_video(self) -> None: - pass + self.nextion.send_command("video.en=1") def stop_video(self) -> None: - pass + self.nextion.send_command("video.en=0") + self.nextion.send_command("page home") \ No newline at end of file