Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class VideoScreen(Screen):
- current_video_state = StringProperty()
- def __init__(self, **kwargs):
- super(VideoScreen, self).__init__(**kwargs)
- self.bind(on_touch_down = self._on_stop,
- on_eos = self._on_eos) # This binding doesn't works
- self.current_video_state = 'play'
- # self.dispatch('on_eos')
- def get_set_current_video_state(self, *args):
- while(args):
- if args[0] == 'pause':
- return 'pause'
- return 'play'
- def _on_stop(self, *args):
- self.current_video_state = 'pause'
- self.parent.get_screen('Home').language = tr.lang #Set the default language as soon as user taps on video
- self.parent.current = 'Login'
- self.play_audio()
- def _on_eos(self, *args):
- print("End of video stream detected")
- self.current_video_state = 'play'
- <VideoScreen>:
- name: 'Video'
- BoxLayout:
- Video:
- id: 'video1'
- source: './media/Sequence_#1.mp4'
- state: root.current_video_state
- volume: 1
- allow_stretch: True
Add Comment
Please, Sign In to add comment