diff --git a/kivy/uix/video.py b/kivy/uix/video.py index bc4545a9a..64091e13e 100644 --- a/kivy/uix/video.py +++ b/kivy/uix/video.py @@ -195,3 +195,23 @@ class Video(Image): def on_volume(self, instance, value): if self._video: self._video.volume = value + +if __name__ == '__main__': + from kivy.app import App + import sys + + if len(sys.argv) != 2: + print "usage: %s file" % sys.argv[0] + sys.exit(1) + + class VideoApp(App): + def build(self): + self.v = Video(source=sys.argv[1], state='play') + self.v.bind(state=self.replay) + return self.v + + def replay(self, *args): + if self.v.state == 'stop': + self.v.state = 'play' + + VideoApp().run()