Fork me on GitHub

Play Sound in Module  Bottom

  • Hi...

    Can someone give me an overview how to play a 3 second mp3 clip in a module I'm creating using an input button...

    I'm not clear on what to put in the pnuser.php file and the template file...

    I tried using the following javascript in the template only, which seems to want to work (no errors on page), but the clip doesn't play.

    Code

    <EMBED SRC="<!--[$path]-->/modules/pntarot/sounds/shuffle.mp3" NAME="shuffle" AUTOSTART=false MASTERSOUND HIDDEN=true>
    <SSS*>function beep(){document.shuffle.play();} </SSS*>

    <form>
    <INPUT TYPE="button" VALUE="Shuffle" onClick="javascript:beep();">
    </form>


    *Note that the SSS above stands for script but this editor won't allow me to put "script" in between the braces .

    Any ideas?



    edited by: EMZ, Jan 05, 2009 - 11:26 AM

    --
    EMZ
  • Check your browser settings, nice browsers don't annoy their users with sounds much :D

    --
    Home Page | Find on Facebook | Follow on Twitter
  • Hi Mike,

    Definitely NOT the browser... I think there is some security in place that prevents me from calling the mp3 file from within the template within the module in Zikula...

    Tried the above code outside zikula in a HTML file and it worked.

    --
    EMZ
  • Not sure if the sanitizer does anything to code in the templates, may try setting embed & script to "Allow with parameters' in the HTML settings under Admin.

    --
    Home Page | Find on Facebook | Follow on Twitter
  • That is most certainly the issue. Michael is wise.
  • I placed the mp3 file in the root directory, outside of zikula modules directory, and it works there...

    Very wierd behavior.

    --
    EMZ
  • Look at
    modules/.htaccess

    and made the changes for .mp3

This list is based on users active over the last 60 minutes.