Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • kief Developer
    #1092766

    Hi, In my content I’ve added a custom filed plugin to show an html5 audio player. This plugin needs only the url of the mp3 files to render the player. Now I’d like to show the player on the filter page, but the only thing I can see is the url. Is there a way to show it correctly? thanks


    1. filter
    Saguaros Moderator
    #1093122

    Hi kief,

    Kindly share the credentials of your site and if possible, send me the plugin also I will try to check.

    Regards

    kief Developer
    #1093307
    This reply has been marked as private.
    Saguaros Moderator
    #1093969

    Hi,

    Let me check with the team if JA Megafilter can support this plugin or not. I will get back to you.

    Regards

    Mo0nlight Moderator
    #1094596

    Hi.

    JA Megafilter do not support any plugin that change the display of field like the one you mention.

    but in your case you could custom your code to make the field work with basic html5 audio file.

    Edit the file:
    components/com_jamegafilter/assets/js/main.js
    Line: 127-129

                            } else {
                                _value = value.frontend_value
                            }

    Change to.

                            } else {
                                if (value.frontend_value.search(/\.mp3$/) !== -1) {
                                    _value = '<audio controls>'+
                                      '<source src="'+value.frontend_value+'" type="audio/mpeg">'+
                                    'Your browser does not support the audio element.'+
                                    '</audio>';
                                }
                                else
                                    _value = value.frontend_value
                            }
    Mo0nlight Moderator
    #1112271

    Hi,

    I edited the file. add the code.

                            } else if (value.type == 'single') {
                                if (value.frontend_value[0].search(/\.mp3$/) !== -1) {
                                    _value = '<audio controls>'+
                                      '<source src="'+JABaseUrl+'/images/'+value.frontend_value[0]+'" type="audio/mpeg">'+
                                    'Your browser does not support the audio element.'+
                                    '</audio>';
                                }
                            }

    at line 108-115

    You have to change the folder name if you change it in the administrator : "/images/" And unfortunately it only works with 1 field. Please check

Viewing 6 posts - 1 through 6 (of 6 total)

This topic contains 5 replies, has 3 voices, and was last updated by  Mo0nlight 6 months, 2 weeks ago.

We moved to new unified forum. Please post all new support queries in our New Forum