|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
When I check the feature "display filename" in my audioplayer custom field setting to "yes" - the mp3 file name appears under player which is fine, but when I clicked this link a new window with quicktime opens and starts playing audio file.
1) Is it possible to make the download link to download as mp3 file instead of playing in new window/browser? 2) Instead of being the mp3 file name for the download link, is it possible to change it to something more generic e.g Click here to download mp3? Your Help Is Appreciated , many thanks. |
#2
|
|||
|
|||
![]()
I guess it is something to do with the ft_class. However I managed to add title tag to make the audio link more accessible:
class mFieldType_audioplayer extends mFieldType_file { function getJSValidation() { $js = ''; $js .= '} else if (!hasExt(form.' . $this->getName() . '.value,\'mp3\')) {'; $js .= 'alert("' . addslashes($this->getCaption()) . ': Please select a mp3 file.");'; return $js; } function getOutput() { $id = $this->getId(); $params['text'] = $this->getParam('textColour'); $params['displayfilename'] = $this->getParam('displayfilename',1); $params['slider'] = $this->getParam('sliderColour'); $params['loader'] = $this->getParam('loaderColour'); $params['track'] = $this->getParam('trackColour'); $params['border'] = $this->getParam('borderColour'); $params['bg'] = $this->getParam('backgroundColour'); $params['leftbg'] = $this->getParam('leftBackgrounColour'); $params['rightbg'] = $this->getParam('rightBackgrounColour'); $params['rightbghover'] = $this->getParam('rightBackgroundHoverColour'); $params['lefticon'] = $this->getParam('leftIconColour'); $params['righticon'] = $this->getParam('rightIconColour'); $params['righticonhover'] = $this->getParam('rightIconHoverColour'); $html = ''; $html .= '<script language="JavaScript" src="' . $this->getFieldTypeAttachmentURL('audio-player.js'). '"></script>'; $html .= "\n" . '<object type="application/x-shockwave-flash" data="' . $this->getFieldTypeAttachmentURL('player.swf'). '" id="audioplayer' . $id . '" height="24" width="290">'; $html .= "\n" . '<param name="movie" value="' . $this->getFieldTypeAttachmentURL('player.swf') . '">'; $html .= "\n" . '<param name="FlashVars" value="'; $html .= 'playerID=' . $id; $html .= '&soundFile=' . urlencode($this->getDataAttachmentURL()); foreach( $params AS $key => $value ) { if(!empty($value)) { $html .= '&' . $key . '=0x' . $value; } } $html .= '">'; $html .= "\n" . '<param name="quality" value="high">'; $html .= "\n" . '<param name="menu" value="false">'; $html .= "\n" . '<param name="wmode" value="transparent">'; $html .= "\n" . '</object>'; if($params['displayfilename']) { $html .= "\n<br />"; $html .= "\n" . '<a title="Click here to download listing page as mp3 audio" href="' . $this->getDataAttachmentURL() . '" target="_blank">'; $html .= $this->getValue(); $html .= '</a>'; } return $html; } Now other stuff I want to do, not sure what to do? Guys please help or Lee? |
#3
|
|||
|
|||
![]()
Hi,
The code you should be editing is here: /components/com_mtree/mtree.php LINE 4785 CODE: PHP Code:
PHP Code:
|
#4
|
|||
|
|||
![]() Quote:
First of all, thanks for the reply. Congratulation on this solid component! I did what you suggested and I replaced your codes with that line, yes it works well but I don't mean to remove the flash player from the page, the issue is the mp3 audio link which when clicked it opens a new browser and play the audio in quicktime. I don't need the audio link to open a new browser and play in quicktime when there is a flash player in the listing page already. See below screenshot for more explanation: ![]() By the way, the audio link appears below the flash player because I have set the Audio Player "Display Filename" parameter as "YES". I really need this badly as I want to make it accessible for blind people - the assistive technology (e.g screen reader) that they are using can NOT see the flash player BUT can use the alternative audio link to download audio mp3 and play on their machine, this is the point, thanks. Last edited by stevenkong; 02-05-2012 at 09:35 AM. |
#5
|
|||
|
|||
![]()
Lee, so no solution here, I really need the solution, please anyone?
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Hide the Download File Link | jodybterblanche | Discussions, Troubleshooting & Problems | 0 | 09-14-2011 04:26 PM |