2011-03-29 16:23:12 +00:00
|
|
|
import kivy
|
2012-04-02 09:03:08 +00:00
|
|
|
kivy.require('1.2.0')
|
2011-03-29 16:23:12 +00:00
|
|
|
|
2011-03-29 17:41:25 +00:00
|
|
|
from sys import argv
|
2011-03-29 16:23:12 +00:00
|
|
|
from os.path import dirname, join
|
|
|
|
from kivy.app import App
|
2012-02-21 16:14:50 +00:00
|
|
|
from kivy.uix.videoplayer import VideoPlayer
|
2011-03-29 16:23:12 +00:00
|
|
|
|
|
|
|
|
2012-02-21 16:14:50 +00:00
|
|
|
class VideoPlayerApp(App):
|
2011-03-29 16:23:12 +00:00
|
|
|
|
|
|
|
def build(self):
|
2011-03-29 17:41:25 +00:00
|
|
|
if len(argv) > 1:
|
|
|
|
filename = argv[1]
|
|
|
|
else:
|
|
|
|
curdir = dirname(__file__)
|
2011-03-29 20:39:52 +00:00
|
|
|
filename = join(curdir, 'softboy.avi')
|
2012-02-21 16:14:50 +00:00
|
|
|
return VideoPlayer(source=filename, play=True)
|
2011-03-29 16:23:12 +00:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ in ('__main__', '__android__'):
|
2012-02-21 16:14:50 +00:00
|
|
|
VideoPlayerApp().run()
|