getMediaSource
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 | string
The source URL of the first given variation found. If the provided variations weren’t found, or if no variation parameter was provided, returns the optimized variation source URL (if it exists) or the original source URL. Returns undefined if no media object is provided.
Returns the source URL of the optimized file (if it exists) or the original file of the given MediaObject. If the variation parameter is provided, returns the source URL of that variation instead, if it exists, but falls back to the optimized or original files if it doesn’t.
Getting the optimized or original source URL of the given MediaObject.
Getting the source URL of a specific variation of the given MediaObject.