bugfix
This commit is contained in:
parent
33c728a550
commit
ce2d56016f
@ -262,6 +262,10 @@ class Modal(VBox):
|
||||
|
||||
def __init__(self, **kw):
|
||||
SUPER(Modal, self, kw)
|
||||
self.register_event_type('on_open')
|
||||
self.register_event_type('on_pre_open')
|
||||
self.register_event_type('on_pre_dismiss')
|
||||
self.register_event_type('on_dismiss')
|
||||
if self.content:
|
||||
blocks = Factory.Blocks()
|
||||
self.content_w = blocks.widgetBuild(self.content)
|
||||
@ -269,10 +273,6 @@ class Modal(VBox):
|
||||
self.add_widget(self.content_w)
|
||||
else:
|
||||
print(content,':cannot build widget')
|
||||
self.register_event_type('on_open')
|
||||
self.register_event_type('on_pre_open')
|
||||
self.register_event_type('on_pre_dismiss')
|
||||
self.register_event_type('on_dismiss')
|
||||
|
||||
def on_touch_down(self, touch):
|
||||
if not self.collide_point(touch.x, touch.y):
|
||||
@ -333,7 +333,6 @@ class Modal(VBox):
|
||||
|
||||
def add_widget(self, w, *args, **kw):
|
||||
super().add_widget(w, *args, **kw)
|
||||
# super().add_widget(Label(text='1111'))
|
||||
if self.auto_open:
|
||||
self.open()
|
||||
|
||||
|
@ -415,7 +415,7 @@ class Blocks(EventDispatcher):
|
||||
p.update(d)
|
||||
opts['options'] = p
|
||||
def doit(target:Widget, add_mode:str, o, w:Widget):
|
||||
if isinstance(w, ModalView):
|
||||
if isinstance(w, Modal):
|
||||
return
|
||||
|
||||
if target and not w.parent:
|
||||
|
@ -32,6 +32,8 @@ class FFVideo(WidgetReady, Image):
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
self._player = None
|
||||
self._volume = 0
|
||||
self._position = 0
|
||||
self._update_task = None
|
||||
self._texture = None
|
||||
self.is_black = False
|
||||
@ -98,6 +100,7 @@ class FFVideo(WidgetReady, Image):
|
||||
return
|
||||
|
||||
self._player.set_volume(self.volume)
|
||||
self._volume = self.volume
|
||||
|
||||
def on_status(self, *args):
|
||||
print('on_status called, ', self.status)
|
||||
@ -113,11 +116,17 @@ class FFVideo(WidgetReady, Image):
|
||||
else:
|
||||
pass
|
||||
|
||||
def on_parent(self, *args):
|
||||
if self.parent:
|
||||
return
|
||||
self._play_stop()
|
||||
del self
|
||||
|
||||
def on_frame(self, *args):
|
||||
if self._player is None:
|
||||
return
|
||||
# self._player.request_channel(self, 'audio', 'open', self.audio_id)
|
||||
p = self._player.get_pts() / self.duration * self.width
|
||||
p = self._position / self.duration * self.width
|
||||
with self.canvas.after:
|
||||
Color(1,1,1,1)
|
||||
Line()
|
||||
@ -154,7 +163,7 @@ class FFVideo(WidgetReady, Image):
|
||||
if self.status != 'play':
|
||||
return
|
||||
self._player.seek(pts)
|
||||
self.position = self._player.get_pts()
|
||||
self._position = self._player.get_pts()
|
||||
|
||||
def mute(self, flag):
|
||||
if self.play_mode == 'preview':
|
||||
@ -330,7 +339,8 @@ class FFVideo(WidgetReady, Image):
|
||||
self._get_video_info()
|
||||
|
||||
self.timepass += self.timeperiod
|
||||
self.position = self._player.get_pts()
|
||||
self._position = self._player.get_pts()
|
||||
self._volume = self._player.get_volume()
|
||||
if self.timepass < self.video_ts:
|
||||
return
|
||||
|
||||
|
@ -1 +1 @@
|
||||
__version__ = '0.3.1'
|
||||
__version__ = '0.3.2'
|
||||
|
Loading…
Reference in New Issue
Block a user