Releases: EvandroLG/ts-audio
ts-audio v0.7.4
ts-audio
is an agnostic library that makes it easy to work with AudioContext
and create audio playlists in the browser.
What's new?
- Reduced package size from 2.2kB to 1.6kB (Gzipped)
- Added support to CommonJS and UMD bundles
Full Changelog: v0.7.2...v0.7.4
ts-audio v0.7.2
ts-audio
is an agnostic library that makes it easy to work with AudioContext
and create audio playlists in the browser.
What's new?
- Refactored out both
Audio
andAudioPlaylist
modules - Updated the
AudioPlaylist
module adding logic to support weighted files.- Note: If you pass files with a weighted structure, the playlist will be played in a loop and shuffled.
import { AudioPlaylist } from 'ts-audio';
import songOne from './1.mp3';
import songTwo from './2.mp3';
import songThree from './3.mp3';
const playlist = AudioPlaylist({
files: { [songOne]: 1, [songTwo]: 5, [songThree]: 1 },
});
playlist.play(); // `songTwo` will play five times more often than `songOne` and `songTree`
ts-audio v0.7.1
ts-audio
is an agnostic library that makes it easy to work with AudioContext
and create audio playlists in the browser.
What's new?
-
audio.
audioCtx: AudioContext
Returns AudioContext object as read-only property -
playlist.
audioCtx: AudioContext
Returns AudioContext object as read-only property from the currently playing audio
ts-audio v0.7.0
ts-audio
is an agnostic library that makes it easy to work with AudioContext
and create audio playlists in the browser.
What's new?
-
Updated the
AudioPlaylist
component adding a new method:- playlist.
toggle(): void
Plays or pause the current audio
- playlist.
-
Updated the
Audio
component adding a new method:- audio.
toggle(): void
Plays or pause the current audio
- audio.
-
Improved the preload solution performance
-
Improved unit tests
ts-audio v0.6.1
ts-audio
is an agnostic library that makes it easy to work with AudioContext
and create audio playlists in the browser.
What's new?
-
Updated the
AudioPlaylist
component adding two new parameters:-
preload?:
boolean
(false
by default)
Load the files before theplay
method is called -
preloadLimit?:
number
(3
by default)
Defines the maximum number of files that will be requested concurrently
-
-
Updated the
Audio
component adding a new parameter:- preload?:
boolean
(false
by default)
Load the files before theplay
method is called
- preload?:
-
Improved types
-
Improved unit tests
ts-audio v0.6.0
ts-audio
is an agnostic library that makes it easy to work with AudioContext
and create audio playlists in the browser.
What's new?
- Fixed bug on
AudioPlaylist
looping logic - Improved types
ts-audio v0.5.0
ts-audio
is an agnostic library that makes it easy to work with AudioContext
and create audio playlists in the browser.
What's new?
-
Updated AudioPlaylist component adding a new optional parameter:
- shuffle?:
boolean
(false
by default)
Shuffles the order of all files passed by parameter before playing them.
- shuffle?:
ts-audio v0.4.7
ts-audio
is an agnostic library that makes it easy to work with AudioContext
and create audio playlists in the browser.
What's new?
-
Updated AudioPlaylist component adding two new methods:
-
playlist.
next(): void
Stops the current audio and starts playing the next one based in the list provided in the AudioPlaylist instance. In case the current audio
is the last in the list, it starts playing the first one. -
playlist.
prev(): void
Stops the current audio and starts playing the previous one based in the list provided in the AudioPlaylist instance. In case the current
audio is the first in the list, it starts playing the last one.
-
ts-audio v0.4.5
ts-audio
is an agnostic and easy-to-use library to work with the AudioContext
API.
What's new?
- Added logic to play the audio multiple times using the same object
- Fixed bug that played the playlist always in loop
- Refactored code
ts-audio v0.4.2
ts-audio
is an agnostic and easy-to-use library to work with the AudioContext
API.
What's new?
- Extended API from
AudioPlaylist
, adding:loop
parametervolume
andloop
properties
import { AudioPlaylist } from 'ts-audio';
const playlist = AudioPlaylist({
files: ['./songOne.mp3', './songTwo.mp3', './songThree.mp3'],
volume: 0.7,
loop: true
});
playlist.play();
playlist.volume; // 0.7
playlist.volume = 05