Description of the problem:
Hi! This experiment runs fine on google Chrome incognito mode, on firefox, and loads well in Safari but cannot play videos. I upgraded to the latest psychojs version as I read up on on the trigger type of fixes made last year, yet this still didn’t help the videos play. I also get an error FILE_LOAD_ERROR when loading the task on google chrome. The resource stops loading when it reaches the first video. Deleting my cache and compressing the file do not help. It’s strange as it loads well in Firefox, Incognito mode, and Safari. What’s going on?
Hi Thomas! Thank you SO much for your willingness to help I am at such a loss. Here are the study links. For what it is worth I am using a Macbook Pro late 2017 running Big Sur. I am using version 2021.1.3 of Psychopy.
The FILE_LOAD_ERROR happens in regular Google Chrome and Microsoft Edge. In Safari, the resources all download but when they get to the part of my task that plays the videos, the videos stop playing. I know there was a bug fix for this late 2020 by @sotiri which is why I updated my version but it doesn’t seem to help.
Here are the tasks I have problems with. They are essentially the same one is a stress induction the other is a neutral emotion induction (the one with c).
and
Let me know if there are other details I can help give you!
Thanks so much for getting back to me so quickly! I
I’ve finally been able to sort out a minimal failing example and generate a new code from the builder from the version 2021.1.4. My videos are created in an .mp4 container using AAC H.264 codecs.
For clarity, I am currently using sounddevice and pygame as backend preferences; this is because moviepy created a constant buzzing sound making it impossible to understand the sound. When running the task in psychopy locally the audio video is asynchronous, by this I mean that while the audio and the video each play fully, the audio is sped up a bit and finishes a few seconds prior to the video ending. I haven’t figured out a way around this and from looking it seems a similar issue has been raised before and solved on an individual basis, though I may be conflating. Audiovisual Asynchrony on Pavlovia
Thanks again SO much for your help.
I have added you as a maintainer on the project, please do let me know if I should have given you different user permission.
As a reminder here are the problems:
-on firefox: works perfectly
-on google chrome incognito: works perfectly
-on safari: loads without issue but freezes on video ie videos do not play, instead a blank screen is shown. this does not vary with changes in cache.
-on chrome: FILE_LOAD_ERROR at loading, looking at the console suggests the video is located from gitlab but fails to be downloaded.
Note: you will see I have 2 sets of 5 videos, Emovid1.mp4 (until Emovid5.mp4) and Neuvid1.mp4 (until Neuvid5.mp4). The videos vary in size with the Neuvid set being larger. This was my way of “testing” whether compressing the video had any impact. To change this just change the variable being iterated through in the video loop. Let me know if this is unclear or problematic!
Yes! Great to hear you haven’t had the issue. It seems like some people don’t so it may be specific to my Chrome settings. My concern though that has been consistent across machines is the videos not playing on safari. Essentially the video doesn’t draw to the screen at all and the experiment is left frozen. I get that this is related to a lack of user based triggers within psychoJS but I don’t get how to adapt it within the psychoJS framework or design. Does this make sense?
Hi Leah, thanks for flagging. Those look like two different issues. The Chrome one is likely to do with caching, which would explain why it works incognito and why I have been unable to reproduce. You can tell Chrome to avoid caching while DevTools is open in the Network tab:
On Safari, video playback is subject to certain rules when it comes to Auto-Play. It should be okay if the videos were silent, like in the project you link to above. I am hoping to have this addressed on the library level, but for now one would need to go into preferences and explicitly allow Auto-Play.
Thank you! The Safari fix works great but the Chrome fix doesn’t help. Not sure if I noted this before but even deleting all my cache doesn’t prevent the FILE_LOAD_ERROR on chrome. Additionally, using an older other Macbook without having the disable cache checked loads and plays the videos just fine on Chrome.