From 16da3c9d85ef714b6b92a629607f9b7a2c2fb538 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sat, 21 Nov 2020 17:37:01 +0800 Subject: [PATCH] bugif --- kivyblocks/newvideo.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/kivyblocks/newvideo.py b/kivyblocks/newvideo.py index 533ac13..0597d82 100644 --- a/kivyblocks/newvideo.py +++ b/kivyblocks/newvideo.py @@ -31,3 +31,22 @@ class NewVideo(BGColorBehavior, Video): else: print('NewVideo _video has not _ffplayer, do nothong') + def on_state(self,*args): + super().on_state(*args) + if self.state == 'play': + Window.allow_screensaver = False + else: + Window.allow_screensaver = True + + # fix bug + def _on_video_frame(self, *largs): + video = self._video + if not video: + return + if not video.duration: + return + if not video.position: + return + if not video.texture: + return + super()._on_video_frame(*largs)