There is a way to play loop a video file with Pyglet?

111 views
Skip to first unread message

Hernando De Avila Pereira

unread,
Aug 9, 2020, 1:29:30 PM8/9/20
to pyglet-users
Hi I'm trying to play 1 video continuously using pyglet, I got success with the audio format, but when trying with  video flies I got this error message  

NotImplementedError: Static sources not supported for video.

this is my code, I would like to know what is missing to do that, thank a lot


import pyglet

vidPath ='video1.mp4'

window= pyglet.window.Window(width=640, height=480)
player = pyglet.media.Player()

MediaLoad=pyglet.media.StaticSource(pyglet.media.load('video1.mp4'))

player.queue(MediaLoad)

print(player.loop)
player.loop=True
print(player.loop)
player.play()

@window.event
def on_draw():
    #pyglet.media.loop='True'
    if player.source and player.source.video_format:
        player.get_texture().blit(0,0,width=640, height=480)
        

pyglet.app.run()
Reply all
Reply to author
Forward
0 new messages