You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all thank you for writing this plugin. I have gotten it to work and it is very useful. But I encountered an issue with it and being relatively new, I'm not sure if there's something simple involving the way Gatsby handles its file system...
I have my locally stored .mp4 video in the same folder as my markdown file. I reference it in the markdown file as instructed: ! [ ] (filename.mp4).
When I compile the project, Gatsby finds the file and saves it to public/static as "filename-long-hash.mp4".
gatsby-remark-videos goes to look for a file in public/static called "filename.mp4", but can't find it because it's been changed to "filename-long-hash.mp4", and so the files aren't transcoded.
My work around to this was to look for the name of the file in videoPath, i.e. I replaced:
But I'm guessing this is not really needed. Where should I be putting my .mp4s so that they don't get renamed like this?
Also I don't know if this is a big deal but the plugin will not work when installed into node-modules, because I believe Gatsby plugins require an index.js file in the plugin root. But if you have the plugin in the optional "plugins" directory in the project root, it seems to work fine. This was a problem for me because "npm install " installs into node_modules by default. I guess you could make a no-op index.js file to get around this. I've noticed many other plugins do this.
Sorry if this is a silly issue. Thanks for all your hard work!
The text was updated successfully, but these errors were encountered:
First of all thank you for writing this plugin. I have gotten it to work and it is very useful. But I encountered an issue with it and being relatively new, I'm not sure if there's something simple involving the way Gatsby handles its file system...
My work around to this was to look for the name of the file in videoPath, i.e. I replaced:
return file.absolutePath === videoPath;
with
return videoPath.includes(file.absolutePath.slice(0,-4));
on line 72 of index.js.
But I'm guessing this is not really needed. Where should I be putting my .mp4s so that they don't get renamed like this?
Also I don't know if this is a big deal but the plugin will not work when installed into node-modules, because I believe Gatsby plugins require an index.js file in the plugin root. But if you have the plugin in the optional "plugins" directory in the project root, it seems to work fine. This was a problem for me because "npm install " installs into node_modules by default. I guess you could make a no-op index.js file to get around this. I've noticed many other plugins do this.
Sorry if this is a silly issue. Thanks for all your hard work!
The text was updated successfully, but these errors were encountered: