nystudio107 / craft-transcoder

Transcode video & audio files to various formats, and provide video thumbnails
https://nystudio107.com/plugins/transcoder
Other
43 stars 12 forks source link

Transcoder produces an error when using environment variables for the asset volume file system path #27

Closed bendesilva closed 4 years ago

bendesilva commented 4 years ago

If your asset volume "file system path" is set to an environment variable, transcoder's getAssetPath function will return an error with the message "the input value is not a valid URL". If the "file system path" is changed to use the @webroot alias or an absolute path, all functions work as expected and thumbnails will be produced and videos transcoded.

I prefer to use environment variables where possible, however I've had to change a website I'm working on to use @webroot for the time being to enable Transcoder to work.

khalwat commented 4 years ago

So typically you actually want to use aliases for anything that is a path or a URL:

https://nystudio107.com/blog/multi-environment-configuration-for-craft-cms-3#aliases-in-craft-cms

...but I can make this work for you.

bendesilva commented 4 years ago

@khalwat Funnily enough I read your article on this earlier today and spotted the section on aliases. I wasn't aware that the aliases could be overwritten or custom aliases could be defined, so I'll be using this approach going forward. It still may be useful to support environment variables in case someone were to trip up on this in future.

khalwat commented 4 years ago

Implemented in https://github.com/nystudio107/craft-transcoder/commit/50e969c1894060e6a854033740edffe228e44c26