getMediaFile
Callable
Parameters
optionalmedia: MediaObject
The MediaObject to analyze. If undefined, the function will also return undefined.
optionalvariation: string | string[]
A string or array of strings with the variation name that should be returned. If an array is given, the first variation found will be returned.
Returns undefined | MediaFile
The MediaFile of the first given variation found. If the provided variations weren’t found, or if no variation parameter was provided, returns the optimized variation file (if it exists) or the original file. Returns undefined if no media object is provided.
Returns the given variation of the provided MediaObject.
Getting the optimized or original file of the given MediaObject.