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
|
|
|
|
2014-11-26 21:21:21 +00:00
|
|
|
#check what formats are supported for your targetted devices
|
|
|
|
#for example try h264 video and acc audo for android using an mp4
|
|
|
|
#container
|
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__)
|
2014-11-26 21:21:21 +00:00
|
|
|
filename = join(curdir, 'softboy.mpg')
|
2012-07-28 18:22:22 +00:00
|
|
|
return VideoPlayer(source=filename, state='play')
|
2011-03-29 16:23:12 +00:00
|
|
|
|
|
|
|
|
2012-07-29 19:43:01 +00:00
|
|
|
if __name__ == '__main__':
|
2012-02-21 16:14:50 +00:00
|
|
|
VideoPlayerApp().run()
|