The problem is that ${resourcesFolderName}
is a simple text replacement and isn’t really smart enough to see that the reset of the code is referencing a video and to adjust like that.
In this case you will want to use add the media/
manually and then use the preview using export script option.
(side note: I’m surprised it works in the editor environment since it is being dynamically added anyways?)