From 53e3a9ce6f191ad6c80c8336e6b80f6bf64fe044 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 24 Dec 2019 10:07:58 +0800 Subject: [PATCH] bugfix --- kivyblocks/pagescontainer.py | 2 ++ kivyblocks/vplayer.py | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/kivyblocks/pagescontainer.py b/kivyblocks/pagescontainer.py index 5c759f0..ab0e6f9 100644 --- a/kivyblocks/pagescontainer.py +++ b/kivyblocks/pagescontainer.py @@ -51,6 +51,8 @@ class PageContainer(FloatLayout): def previous(self,v=None): if len(self.pageWidgets) <= 1: return + w = self.pageWidgets[-1] + w.beforeDestroy() self.pageWidgets = self.pageWidgets[:-1] self.showLastPage() diff --git a/kivyblocks/vplayer.py b/kivyblocks/vplayer.py index 3a00565..35750f7 100644 --- a/kivyblocks/vplayer.py +++ b/kivyblocks/vplayer.py @@ -194,7 +194,7 @@ class VPlayer(FloatLayout): def beforeDestroy(self): try: - self.pause() + self.stop() except Exception as e: print_exc() return True @@ -358,8 +358,10 @@ class VPlayer(FloatLayout): btn.source = blockImage('mute.jpg') def stop(self): - print(self) - self._video.state = 'stop' + try: + self._video.state = 'stop' + except: + print_exc() def on_disabled(self,o,v): if self.disabled: