"Circle Audio Player"
Bootstrap 3.1.0 Snippet by mouse0270

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<div class="container">
<div class="row text-center">
<h2 >Audio may take some time to buffer please wait!</h2>
<p>Audio provided by <a href="http://robbbenson.com/Robb_Benson/Songwriter.html">Robb Benson</a> click on his name to check out his website.</p>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-offset-4 col-sm-4">
<div class="progress-radial progress">
<div class="overlay">
<img class="img-responsive img-circle" src="http://robbbenson.com/robbcover.jpg" alt="">
<div class="controls">
<span class="glyphicon glyphicon-volume-up" id="mute" data-toggle="audioplayer" data-icon="muted" data-active="false"></span>
<span class="glyphicon glyphicon-volume-off hide" id="muted" data-toggle="audioplayer" data-icon="mute" data-active="false"></span>
<span class="glyphicon glyphicon-stop active" id="stop" data-toggle="audioplayer" data-icon="play"></span>
<span class="glyphicon glyphicon-play hide" id="play" data-toggle="audioplayer" data-icon="stop"></span>
<span class="glyphicon glyphicon-pause" id="pause" data-toggle="audioplayer" data-icon="pause"></span>
</div>
<div class="clearfix"></div>
</div>
</div>
</div>
</div>
</div>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
.progress-radial {
float: left;
margin-right: 30px;
position: relative;
width: 100%;
height: 100%;
border-radius: 50%;
border: 2px solid #2f3439; // remove gradient color
background-color: #5bc0de; // default 100%
}
.progress-radial .overlay {
width: 100%;
height: 100%;
padding: 15px;
border-radius: 50%;
text-align: center;
line-height: 60px;
font-size: 16px;
}
.controls {
position: absolute;
bottom: 25%;
left: 0px;
width: 100%;
text-align: center;
}
.controls .glyphicon {
font-size: 2em;
color: rgba(255, 255, 255, 0.7);
padding: 5px;
margin: 0px 10px;
cursor: pointer;
}
.controls .glyphicon.active {
font-size: 3em;
margin: 5px 10px;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// ONLY WORKS ON BROWSERS THAT SUPPORT MP3 //
$(function () {
var play = $('#play'),
pause = $('#pause'),
stop = $('#stop'),
mute = $('#mute'),
muted = $('#muted'),
song = new Audio('http://robbbenson.com/01%20Eve.mp3'),
duration = song.duration;
song.type= 'audio/mpeg';
song.src= 'http://robbbenson.com/01%20Eve.mp3';
stop.on('click', function(e) {
e.preventDefault();
$(this).addClass('hide');
$('#play').removeClass('hide').trigger('click');
})
play.on('click', function(e) {
e.preventDefault();
if (!$(this).hasClass('active')){
song.play();
$('.active').removeClass('active');
$(this).addClass('active');
}else{
song.pause();
$('.active').removeClass('active');
var curtime = song.currentTime / song.duration * 100;
$('.progress-radial').removeClass('progress-'+parseInt(curtime));
song.currentTime = 0;
$(this).addClass('hide');
stop.removeClass('hide').addClass('active');
}
});
pause.on('click', function(e) {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments:

not working :(

the code doesn't work anymore? or the author deleted?

MariaAntonia84 () - 6 years ago - Reply 0