WP-Filebase Download Manager
[resolved] Including a mp3 player in Ajax view ? (8 posts)

  1. kahuitel
    Posted 4 years ago #

    Hi !

    I'm trying to include an mp3 player by changing templates for the Ajax Filemanager, but as recommended by plugin's doc neither tag or specific class in links would work.

    Example :
    <a href="%file_url%" title="Download %file_display_name%">%file_display_name%</a> Hits : %file_hits% - %file_date% - (%file_category% - %file_size%)<br>[audio:%file_url%]

    is not working.

    Is there any other solution to integrate an audio player for mp3 listings ?

    Thanks, this can be checked at : http://www.leclectic.org/mp3-downloads/


  2. Fabian
    Plugin Author

    Posted 4 years ago #

    This is easily done with HTML5. See http://www.w3schools.com/html5/html5_audio.asp .
    You have to put the HTML code into your File Browser File Template.

  3. kahuitel
    Posted 4 years ago #

    Hi and thanks for your answer.

    I did try so, but the problem is this basic player is prebuffering all listed tracks. Since the apache server allow only 3 connections per client, user can't listen to some song until others have finished buffering.

    Is there a way to prebuffer only when play is clicked?

    Thanks again for your help.

  4. kahuitel
    Posted 3 years ago #

    Still no luck.

    I'm now using WPaudio, but it won't get my code within the filebrowser.

    If anybody has a solution to setup a simple player for preview purposes, let me know.

    Thanks !

  5. david-SBM
    Posted 3 years ago #

    Hey kahuitel... try to add preload="none" to your audio tag. So would look like:

    <audio src="yousourcelink.mp3" preload="none"></audio>

    That should stop the page from loading the audio automatically.

  6. kahuitel
    Posted 3 years ago #

    Hi !
    Thanks for your help ! I've sorted it out yesterday night using this template :

    <div class="wpfilebase-attachment">
     <div class="wpfilebase-fileicon"><a href="%file_url%" title="Download %file_display_name%"><img align="middle" src="%file_icon_url%" alt="%file_display_name%" height="80"/></a></div>
     <div class="wpfilebase-rightcol">
      <div class="wpfilebase-filetitle">
       <a href="%file_url%" title="Download %file_display_name%"><strong>%file_name%</a><br />
    %file_info/tags/id3v1/artist%<br />
    %file_info/tags/id3v1/title%<br />
    %file_info/tags/id3v1/album%</strong><br />
       <!-- IF %file_post_id% AND %post_id% != %file_post_id% --><a href="%file_post_url%" class="wpfilebase-postlink">%'View post'%</a><!-- ENDIF -->
     <div class="wpfilebase-fileinfo">
      %file_info/playtime_string%<br />
      %file_info/bitrate%<br />
      %file_size%<br />
      <strong>%file_hits% %'Downloads'%</strong><br />
    <audio id="audio-player" src="%file_url%" type="audio/mp3" controls="controls" preload="none" style="width: 420px;"></audio>


  7. david-SBM
    Posted 3 years ago #

    yup... got the preload none in there, nice work!

  8. kahuitel
    Posted 3 years ago #

    I hope it'll help some peepz! Thanks for your help david.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic