FelixHenninger / lab.js

Online research made easy
https://lab.js.org/
Other
245 stars 109 forks source link

Videos #211

Open chamarun opened 1 year ago

chamarun commented 1 year ago

Hello,

I am currently working on my bachelor thesis and want to use lab.js to build my experiment. Since this is the first time that I do this on my own I have to incorporate myself into lab.js. In my study the participants have to react with three different keys to choose from three options. There will be four blocks but before each block I want to add an explanation video (which is part of my hypothesis).

I added a new screen and wanted to add a video. But by using the plus in the corner of the screen I am only able to add images from my laptop. I am able to load the video into the files, but I cannot select it to put it on the screen. The Browser I am using is Microsoft Edge Version 115.0.1901.188 (Offizielles Build) (64-Bit).

If it is possible to add videos I also want to ask if there is an restriction of the duration of the video. The video I added to the files was about 5 seconds long, but I tried it with a longer video (about 15 seconds) and got the message that "this file is too large to be opened".

mcfarla9 commented 1 year ago

I have never used videos with lab.js, and do not know the "proper" way to do so. But as an exercise I added an html.Screen component and then added a video element there, e.g.,

<video controls><source src=${this.files["movie.mp4"]} type="video/mp4"></video>

I also uploaded the video file (a small one) to the component. This all worked. I would not, however, trust this if you need to present a video with millisecond accuracy.

I had to use a small file to avoid the "This file is too large to be opened" error in the Builder. That seems to be a limitation of what the Builder allows you to upload, not a limitation of lab.js itself. To get around the limit in the Builder I edited my video element to

<video controls><source src="movie.mp4" type="video/mp4"></video>

I then exported the study for local use, manually added my larger movie file to the same folder as the study, and this worked.

-- David McFarlane