From 2bf1a26cadfc183901650e35c6e66cffe8f3365f Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 16 Mar 2020 10:47:27 +0800 Subject: [PATCH] bugfix --- kivyblocks/vplayer.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kivyblocks/vplayer.py b/kivyblocks/vplayer.py index 0405d51..0012e03 100644 --- a/kivyblocks/vplayer.py +++ b/kivyblocks/vplayer.py @@ -85,6 +85,8 @@ class BaseVPlayer(FloatLayout): def on_state(self,o,v): if self._video.state == 'play': Window.allow_screensaver = False + if hasattr(self._video._video, '_ffplayer'): + self.ffplayer = self._video._video._ffplayer else: Window.allow_screensaver = True print('onstate()',o,v,self._video.state) @@ -157,8 +159,8 @@ class BaseVPlayer(FloatLayout): def audioswitch(self,btn): print('*********AUDIOSwitch 1**************', self.ffplayer) if self.ffplayer is not None: - print('*********AUDIOSwitch 2**************') - self.ffplayer.request_channel('audio') + x = self.ffplayer.request_channel('audio') + print('*********AUDIOSwitch 2**************',x) def setVolume(self,obj,v): self._video.volume = v