Fork me on GitHub

Audio

Creates an interactive audio player in HTML5 with fallback for old browsers.


Getting Started

First load the seed file, if you haven't yet.

<script src="https://cdn.alloyui.com/1.5.1/aui/aui-min.js"></script>

Then initialize AlloyUI and load the Audio module.

AUI().use(
  'aui-audio',
  function(A) {
    // code goes here
  }
);

Using Audio

Create an HTML element.

<div id="myAudio"></div>

Set boundingBox to the newly created element, set url to your chosen audio file, and render it!

AUI().use(
  'aui-audio',
  function(A) {
    new A.Audio(
      {
        boundingBox: '#myAudio',
        url: 'https://alloyui.com/audio/zelda.mp3'
      }
    ).render();
  }
);
For more information about configuration, check out our API Docs.