from sys import argv
from os.path import dirname, join
from kivy.app import App
from kivy.uix.videoplayer import VideoPlayer

class Video(App):

    def build(self):
        if len(argv) > 1:
            filename = argv[1]
        else:
            curdir = dirname(__file__)
            filename = join(curdir, 'kivy.mp4')
        return VideoPlayer(source=filename, state='play')


if __name__ == '__main__':
    Video().run()
