I'm new to pyglet and i have a problem with video..
I'm trying to play a video using pyglet .. but instead of playing the video in the window it just exits immediately and terminates ..
do you guys have any solution for this problem how can i hold the window to play vedio??
i use windows vista 64x with python 2.5
please help
and here is the code :
vidPath="vid.avi"
widnow = pyglet.window.Window()
source = pyglet.media.StreamingSource()
MediaLoad = pyglet.media.load(vidPath)
player = pyglet.media.Player()
player.queue(MediaLoad)
player.play()
@window.event
...def on_draw():
... player.get_texture.blit(0,0)
thank u very much for your time
Best Answer
I think calling "pyglet.app.run()" is missing.