Manual:Hooks/LinkerMakeMediaLinkFile

Details

 * $title: The Title object associated with the file.
 * $file: The File object or false if it doesn't exist yet.
 * &$html: Pre-sanitized HTML that goes inside the anchor tag.
 * &$attribs: Link attributes.
 * &$ret: The link HTML if you choose to override the default. Default is an empty string.

You need to return   if you want to modify the HTML of media links, returning  will produce the normal media link HTML, regardless of if   is set to something. Please note that you will need to include all parts of the HTML in, including the   tag, if you choose to return.