HowlerJs Audio Player


Description

howler.js is an audio library for the modern web. It defaults to Web Audio API and falls back to HTML5 Audio. This makes working with audio in JavaScript easy and reliable across all platforms.
Additional information, live demos and a user showcase are available at howlerjs.com.

Source: https://howlerjs.com/

Sample code [howler.html]

<!DOCTYPE html>
<html>
<head>
<title>Howler MP3</title>
<script type="text/javascript" src="https://cdn.jsdelivr.net/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/howler.js/2.0.3/howler.js"></script>
<style type="text/css">
*{
font-family: arial;
font-size: 16px;
}
</style>
</head>
<body>
<center>
<input type="button" class="play" value="Play"/>
</center>

<script type="text/javascript">
$(document).ready(function(){
var sound = new Howl({
src: ['dunaliya_mein_jung.mp3']
});

$('body').on('click','.play',function(){
sound.play();
})
})
</script>
</body>
</html>
code screenshot 


Demo:



Share on Google Plus

About Pukar

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment

0 comments:

Post a Comment