Generico button no longer works

Generico button no longer works

by Thies Osterwold -
Number of replies: 4

Dear Forum,


on our plattform (Moodle 3.5) we use Generico filters. On one site we defined a play button

that for playing mp3 files.


Filter Code

<audio class="my-m3-play" preload="none">

  <source src="@@url@@" type="audio/mpeg">

</audio>



That worked before at least under Moodle 3.1 / Jquery 1.10.1  (or similar version).

but now the play button no longer works.


on the JS console I can see the following:


generico_jquery



Is this error maybe due to jquery version ?

maybe deprecated functions in jQuery such as load, unload, error etc.


If so  ... how can I trace that ? Where gets the jquery called ? 

Is it possible to install an older jquery version alongside ?



Or is this problem due to poodle that no longer works for free ?


Any hint, info would be super ...


Best,

Thies

Average of ratings: -
In reply to Thies Osterwold

Re: Generico button no longer works

by Justin Hunt -
Picture of Particularly helpful Moodlers Picture of Plugin developers
The error might the issue but it is a javascript error, and the template you posted does not have any javascript. So there is more to the problem that we can see here.
I do not think it has anything to do with Poodll or non free. Thats not related to Generico and you would see a different message.
In reply to Justin Hunt

Re: Generico button no longer works

by Thies Osterwold -
Hi Justin,

late I come back to this ... would be grateful, if you can take a look. Btw the poodle plugins work very well.

The point is, I can also include a javascript in a textfield activity in Moodle like so:
code


as a result I want the mp3 to be played when  I click on the "Home" - link. If I click on that link I see the following in the console:

jquerylib


sorry ... can you help me in order to get that working ?

Thanks a lot

Best,

Thies


In reply to Thies Osterwold

Re: Generico button no longer works

by Justin Hunt -
Picture of Particularly helpful Moodlers Picture of Plugin developers
If you want me (or someone ) to check your code its a good idea to allow us to copy and paste it. What you posted was a screenshot of the source and I won't have time to type it out and debug it. You can use the pre-formatted text formatting option when copying-and-pasting code  into the html area. (Then it looks a bit like code and doesn't go all massive)


I am not sure what that error is but generally speaking, you should put the javascript into the custom js area of the template. Then it will load it in an AMD module and it works a lot nicer like that. The attached template bundle will do something like what you are doing.  I hope it gives you some ideas.

(You can just drag the template bundle over the green bundle box on a template settings page and it will autofill the template fields.)
In reply to Justin Hunt

Re: Generico button no longer works

by Thies Osterwold -
sorry so here comes the code:
<ul id="nav-one" class="nav">
<li>
<a href="#">Home</a>
<audio id="beep-one" controls="controls" preload="auto">
<source src="https://ourserver.com/draftfile.php/5/user/draft/159357818/file_example_MP3_700KB.mp3"> </audio>
</li>
</ul> <script type="text/javascript"> var beepOne = $("#beep-one")[0]; $("#nav-one a").click(function() {
beepOne.play();
}); </script>