Simple and fast music player, based on playlists
YAP is a simple fast and small native Yurba JavaScript open-source component for playing music.
Easy to use API, easily build your music playlist using YAP.
<link rel="stylesheet" href="https://cdn.yurba.one/static/yurba-ap/1.2/css/yap.min.css">
<script type="text/javascript" src="https://cdn.yurba.one/static/yurba-ap/1.2/js/yap.min.js"></script>
HTML Initialize YAP html component
<yurba-ap></yurba-ap>
JavaScript Set your playlist, or push object to an already specified one
let player = document.querySelector('yurba-ap')
let playlist = [
{
'Id': 1,
'Url': 'https://cdn.yurba.one/musebase/5127.mp3'
}, ...
]
player.setPlaylist(playlist)
player.playFirst()
let playlist2 = [
{
'Id': 10,
'Url': 'https://cdn.yurba.one/musebase/1.mp3'
}, ...
]
player.pushPlaylist(playlist2)
JSFiddle Example