Hi guys. I'm using cocos2d's director for displaying 2D scenes. It's just a 
thin wrapper around all the pyglet library routines.

I'm trying to play a video, and it works great except for the fact that the 
audio is not synced with the video. The audio appears to start about a 
quarter second early. Any ideas on what I'm doing wrong?

My video layer basically looks something like this:

class VideoLayer(cocos.layer.Layer):
def __init__(self, video_path):
'''
<image> is a loaded pyglet compatible image
'''
super(VideoLayer, self).__init__()
self.video_path = video_path

def on_enter(self):
player = pyglet.media.Player()
player.eos_action = player.EOS_LOOP # Could also be EOS_PAUSE or EOS_NEXT
self.video = pyglet.media.load(self.video_path)
player.queue(self.video)
player.play()
self.player = player

def draw(self):
 if self.player.playing:
 self.player.get_texture().blit(0,0)

draw() is called just like the on_draw() event, on_enter() is only called 
when the layer is viewed. 

I like I said, it looks great and the audio isn't choppy, it's just not in 
sync w/ the video.
Blaine

-- 
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/pyglet-users/-/R97M___849UJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en.

Reply via email to