1.0.4 • Published 5 months ago
chaimu v1.0.4
Chaimu is an audio player that synchronizes audio with video.
Usage example
A simple usage example:
import Chaimu from "chaimu";
const videoEl = document.querySelector("video");
const chaimu = new Chaimu({
url: "https://s3.toil.cc/vot/translated.mp3",
video: videoEl,
});
await chaimu.init();
Using this code, you will link the video to the audio.
If AudioContext is reached, you will be able to use advanced audio volume control.
If you want to use a classic player (via audio element), specify preferAudio
param:
...
const chaimu = new Chaimu({
...
preferAudio: true
});
Demo
Install
Installation via Bun:
bun add chaimu
Installation via NPM:
npm install chaimu
Build
To build, you must have:
Don't forget to install the dependencies:
bun install
Run build:
bun build:bun