How to embed audio in Drupal page

This is a very simple way how to embed an audio file in your drupal page. There is no need to embed javascript or a css class. However, you should be able to edit HTML or have the "embed media" option enabled in your CKeditor (to paste the code below).  

  1. Convert your file to ogg format (e.g. use Audacity), avoid mp3, as they do not work on all browsers.
  2. Upload file by sftp or IMCE to your drupal web site.
  3. Insert code
<audio id="player" src="/sites/default/files/media/FredaMeissnerBlau2013.ogg"></audio>
<div>
<button onclick="document.getElementById('player').play()">Play</button>
<button onclick="document.getElementById('player').pause()">Pause</button>
</div>

See a demo here.

If you use TinyMCE editor, you may consider its media plugin.

Aktivitaet: 

Umfeld: 

Neuen Kommentar schreiben

Plain text

  • Keine HTML-Tags erlaubt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • HTML - Zeilenumbrüche und Absätze werden automatisch erzeugt.
Dieses Feld bitte leer lassen.