tiny-player HTML audio player

A tiny and clean audio player for the web.


Multiple players

The plugin parses your HTML looking for audio tags and replaces them with tiny audio players. Although there are multiple audio-players, they are managed by a global object so that only one will be playing at a time, and the volume sliders are linked.

Specifying titles

The plugin has two ways of specifying song titles:

HTML attribute

Giving the <audio> a data-title="" has the highest precedence title for your track:

<audio controls class="iru-tiny-player" data-title="Stephan Siebert - Ms. mood">
  <source src="audio/80s_vibe.mp3" type="audio/mpeg">
</audio>
Results in:

Closets header

If no data-title is specified, the plugin will search for the nearest header in the same block before the previous <audio> tag:

<h2>Stephan Siebert - first bird</h2>
<p>This song is dedicated to my very special friend...</p>
<audio controls class="iru-tiny-player">
  <source src="audio/first_bird.mp3" type="audio/mpeg">
</audio>
Results in:

Stephan Siebert - first bird

This song is dedicated to my very special friend...

Dependencies

Credits

Sample music tracks by Stephan Siebert, licensed under Creative Commons.

License

  MIT License
  Copyright (c) 2018-2021 Jonas Rylund Glesaaen

  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files (the "Software"), to deal
  in the Software without restriction, including without limitation the rights
  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  copies of the Software, and to permit persons to whom the Software is
  furnished to do so, subject to the following conditions:

  The above copyright notice and this permission notice shall be included in all
  copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  SOFTWARE.