Array of arrays containing stimulus paths 'unknown resource'

Description of the problem:

I can run my paradigm locally on PsychoPy using an array of arrays containing a path for each stimulus in a given sequence. I don’t use an Excel file.

However, I get the following error when trying to run online:

The paths point to the relevant folders from the location of the main experiment script.

Here is what my array of arrays call looks like in PsychoPy:

$StimArray[condrow][stepcount]

And an example of it in JS:

animation1 = new visual.MovieStim({
  win: psychoJS.window,
  name: 'animation1',
  units: undefined,
  movie: StimArray[condrow][stepcount],
  pos: [0, 0],
  size: undefined,
  ori: 0.0,
  opacity: undefined,
  loop: false,
  noAudio: false,
  });

When ‘hardcoded’ the file path works fine online and this is what it looks like in JS:

animation1 = new visual.MovieStim({
  win: psychoJS.window,
  name: 'animation1',
  units: undefined,
  movie: 'Stimuli/Video/movie1_Amin.mp4',
  pos: [0, 0],
  size: undefined,
  ori: 0.0,
  opacity: undefined,
  loop: false,
  noAudio: false,
  });

This is an example of an array of arrays being appended in my code:

  StimDF = [];
  StimDF.push(["Cond1 P+A+Self SELFCONGRUENT", "Stimuli\\Video\\movie1_Aplus.mp4", "Stimuli\\Image\\Frame1.bmp", "Stimuli\\Video\\walkingout.mp4", "Stimuli\\Video\\movie2_ICI.mp4", "Stimuli\\Image\\Frame2.bmp", "Stimuli\\Video\\movie3.mp4", "Stimuli\\Image\\Frame3.bmp"]);

I later create a new array to contain repeated conditions per block:


  StimArray = [];
  for (var numCondRepeats, _pj_c = 0, _pj_a = util.range(0, perBlock), _pj_b = _pj_a.length; (_pj_c < _pj_b); _pj_c += 1) {
    numCondRepeats = _pj_a[_pj_c];
    for (var condnum, _pj_f = 0, _pj_d = util.range(0, StimDF.length), _pj_e = _pj_d.length; (_pj_f < _pj_e); _pj_f += 1) {
      condnum = _pj_d[_pj_f];
      StimArray.push(StimDF[condnum]);
    }
  }

I’ve tried changing the backslashes in the array paths from \\ to / and it makes no difference as far as I can tell.

Any thoughts on why my paths in the array is an ‘unknown resource’ would be appreciated.

Cheers.

This answer seems to have solved the initial issue of not finding the stimulus files: