Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[solved] Problems Using Multiple Videos

edited June 2013 in OpenSesame

Hi there,

I am having trouble running an experiment with a loop of 16 videos:


I'm using the video player set up like so:


However, when I run the experiment all I get is a blank screen, yet after making 16 allowed responses the experiment ends as it should. I have no trouble playing videos in OS, the experiment works fine with one video (using the name of the file instead of [Actor]). Also if I put anything before the video player (e.g. a fixation dot) it just stays on the screen and does not disappear as it should.

Is there something I'm doing wrong?


  • edited 12:43AM


    The video_player hasn't been updated for a long time (it's deprecated in favor of these options, although these may not work for Mac OS). What you are running into is that the video_player doesn't support the [variable] notation. Only direct names work.

    Fortunately, you can work around this through a hack, by placing the following code in the Prepare phase of an inline_script item that you place before the video_player:

    exp.items['video_player'].video_src = self.get('Actor') + '.avi'

    This script sets the video_src variable for the video_player item, and allows you to refer to another variable, in your case Actor. Does that make sense?

    Hope this helps!


  • edited June 2013

    Hi Sebastiaan,

    I'm not very good with code but tried what you said:


    However now I'm getting an error:


    Have I missed something?


  • edited June 2013

    Hi Chris,

    Let's walk through the command. exp is the experiment object:


    The experiment has a property items, which is a dictionary of all the items:


    In this dictionary, the item names are the keys, so you can get the Emotion item like this:


    You can change attributes (i.e. variables) of the item like this:

    exp.items['Emotion'].video_src = self.get('Actor') + '.avi'

    Does this make sense? So the problem was that you didn't specify the name of the item, which is Emotion, but just copied the code that assumed the item was named video_player.


  • edited 12:43AM

    Ah excellent! Haha I told you I was new to this.
    So the videos are displaying now (and in a random order which is great) but they still don't play? I just get a still image of the first frame......
    Sorry to be such a bother!


  • edited 12:43AM

    I just get a still image of the first frame......

    Have you set the duration to a very low value? You can set the duration to 'keypress', to play the video until you press a key, or to a value in milliseconds.


  • edited 12:43AM

    That was it. I'd been following the catface tutorial and so I'd set the duration to 0. Excellent, it's working well now, thanks for all your help!


Sign In or Register to comment.