hidup-jokowi-soundboard
v1.0.2
Published
Soundboard package dengan popup modal berisi audio, gambar, dan video
Maintainers
Readme
hidup-jokowi-soundboard
Soundboard package dengan popup modal berisi audio, gambar, dan video.
Install
npm install hidup-jokowi-soundboardUsage
import { Soundboard } from 'hidup-jokowi-soundboard';
const sb = new Soundboard();
sb.open(); // Buka modal popupAPI
new Soundboard(options?)
Buat instance soundboard baru.
Options:
items(optional) - Array custom media items. Default: 3 bundled assets (mp3, jpeg, webm)
Item format:
{
type: 'audio' | 'image' | 'video',
src: 'path/to/file',
label: 'Label untuk item'
}sb.open()
Buka modal popup.
sb.close()
Tutup modal popup.
sb.isOpen()
Check apakah modal sedang terbuka.
Custom Items
const sb = new Soundboard({
items: [
{ type: 'audio', src: './custom.mp3', label: 'Custom Audio' },
{ type: 'image', src: './custom.jpg', label: 'Custom Image' },
]
});Demo
npm run demoLalu buka browser ke URL yang ditampilkan.
License
MIT
