12 lines
333 B
JavaScript
12 lines
333 B
JavaScript
$(function(){
|
|
$('.play').click(function(){
|
|
$.get('/listen/'+ $(this).parent().attr('id') +'/', function(res){
|
|
if (res.status == 'ok') {
|
|
$('#player audio').attr('src', res.data.url);
|
|
$('#player #artist').html(res.data.artist);
|
|
$('#player #title').html(res.data.track);
|
|
$('#player audio').play();
|
|
}
|
|
})
|
|
})
|
|
}) |