Skip to content

Issue with movie_event example: Py5Image objects have no fields or methods named "read"  #576

@epsln

Description

@epsln

Using py5 0.10.3a1

When trying to load a video and playing it using the code given in the tutorial

from processing.video import Movie


def setup():
    py5.size(500, 500)
    global movie_player
    movie_player = Movie(py5.get_current_sketch(), "movie.mov")
    movie_player.loop()


def movie_event(m):
    m.read()


def draw():
    if movie_player.isPlaying():
        py5.image(movie_player, 0, 0)


def exiting():
    movie_player.stop()


py5.run_sketch()

The movie_event function raises the following error:

    12   def movie_event(m): 
       m.read()                                
    ..................................................
     m.read = # AttributeError   
          m = Py5Image(width=0, height=0)  
    .................................................. 
AttributeError: Py5Image objects have no fields or methods named "read"  

It seems that the callback is called with an empty Py5Image (with 0 height and 0 width).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions