1.0.0 • Published 2 years ago

sine-audio-player v1.0.0

Weekly downloads
-
License
GPL-3.0
Repository
github
Last release
2 years ago

��# Sine Audio Player

GitHub GitHub file size in bytes GitHub last commit

Online demo

Sine Audio Player

Installation

Github

Download repository ZIP.

CDN

Alternatively, you can load it from CDN:

<script src="https://cdn.jsdelivr.net/gh/tharunbirla/sine-audio-player/dist/sine-audio-player.min.js"></script>

Usage

Include the sine-audio-player.min.js file:

<script src="{path}/dist/sine-audio-player.min.js"></script>

Add <sine-player> tag between your HTML <body></body> tag. You add the attributes mentioned bellow in the table.

<sine-player src="your-audio.mp3"></sine-player>

You can add multiple players on a single page.

Options

OptionDescriptionValuesDefault
srcSpecifies the URL of the audio file.URL-
mutedSpecifies that the audio output should be muted.true, falsefalse
preloadSpecifies if and how the author thinks the audio should be loaded when the page loads.none,auto,metadatafalse
autoplaySpecifies that the audio will start playing as soon as it is ready.autoplayfalse
buffer-percentageSpecifies how much audio data must be rendered as soon as the user load the pagenumber50

Other default options: | Options | Default | |---------|---------| | Volume | 100% | | Preview Volume | 50% |

You can focus on player elements with Tab key and use the following keys to use the player controls.

KeyAction
TabFocus on the next element
Shift + TabFocus on the previous element
Enter or SpacebarPause/Play
Right ArrowFast-forward
Left ArrowRewind
Enter or SpacebarShow/hide volume slider
Up Arrow, Left ArrowIncrease volume
Down Arrow, Right ArrowDecrease volume

Video