0

OK, LONG QUESTION IN SHORT: I decided to use audio.js in moodle. I have uploaded file to public_html. And when I add this code to "HEAD":

<script src="https://WWW.MYWEBSITE.COM/audiojs/audio.min.js"></script>
<script>
  audiojs.events.ready(function() {
    var as = audiojs.createAll();
  });
</script>

And then use default "import media - > audio" on question in moodle quiz (sample code bellow):

<audio controls="true"><source src="https://WWW.MYWEBSITE.COM/learning-base/draftfile.php/5/user/draft/119880121/test.mp3">https://WWW.MYWEBSITE.COM/learning-base/draftfile.php/5/user/draft/119880121/test.mp3</audio>

I can say that simply nothing changes, when preview the results... The player seems not changed at all. Well it had to, right? I want to change the html5 audio player design, this is why I use Audio.js. What am I doing wrong? P.S., I should mention I use the latest moodle 3 (updated to latest few days ago).


A complete solution can be found here

luk2302
  • 55,258
  • 23
  • 97
  • 137
Linas
  • 17
  • 5
  • "..All I want is that download button would not be seen by the default without extra coding in each question on quiz." not clear what you want, please explain more and add some of your html code here – S.Serpooshan Jan 26 '17 at 08:22
  • Do you have a screenshot that shows your problem? What have you tried so far, and where did you get stuck? What does your code *(html, css, javascript)* look like? – Anders Marzi Tornblad Jan 26 '17 at 08:24
  • I have clearly updated question. As now the question is "on hold", if You know answer to my question or any info that could help, please email me to linas.peckys@gmail.com – Linas Jan 26 '17 at 13:45

2 Answers2

1

There is no way to control the way an audio tag is displayed, each browser does this differently. The download button is only available in chrome for example.

I would recommand using a library that handles the display of audio tags, like audio.js.

  • Ok, let's do it with audio.js. Can You help me with this mate? Please check updated question. Thank You – Linas Jan 26 '17 at 11:01
0

As said in the solution to this question, there isn't really a way to disable it. As shown in the answer, what you can do to hide it is increase the width and set the overflow on hidden on the media controls panel.

PS: This would be the case when using Google Chrome.

Community
  • 1
  • 1
J. Swaelen
  • 778
  • 1
  • 8
  • 9
  • Dont you think this kind of approach is bound to break in the following months? For example, if chrome removes the download button, you will be hiding part of the timeline – François-Xavier Aeberhard Jan 26 '17 at 08:33
  • That's true, it's unfortunately not a permanent fix for the problem. As you said, using a library that handles the audio tags, would be the better option here. – J. Swaelen Jan 26 '17 at 08:36