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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
| <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' lang='en' xml:lang='en'>
<head>
<!-- Website Design By: www.happyworm.com -->
<title>Demo (jPlayer 1.1.1) : Text Based player with progress bar</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.jplayer.min.js"></script>
<script type="text/javascript">
<!--
$(document).ready(function(){
// Stores the value of percentage of track loaded
var global_lp = 0;
$("#jquery_jplayer").jPlayer({
ready: function () {
var target = $("#player_play").attr("class");
this.element.jPlayer("setFile", target+".mp3").jPlayer("play");
// Draw the control bar
var ctrlBar = "";
for (i=0; i < 100; i++){
ctrlBar = ctrlBar + "<a href='#' id='lb-"+i+"'>|</a>";
}
$('#player_progress_ctrl_bar').html(ctrlBar);
},
customCssIds: true
})
.jPlayer("onProgressChange", function(lp,ppr,ppa,pt,tt) {
var lpInt = parseInt(lp);
var ppaInt = parseInt(ppa);
global_lp = lpInt;
var loadBar = "";
for (l=0; l < lpInt; l++){
loadBar = loadBar + "|";
}
var playBar = "";
for (i=0; i < ppaInt; i++){
playBar = playBar + "|";
}
$('#player_progress_play_bar').text(playBar);
$('#player_progress_load_bar').text(loadBar);
})
.jPlayer("onSoundComplete", function() {
this.element.jPlayer("play");
});
$("#player_play").click( function() {
$('#jquery_jplayer').jPlayer("play");
$(this).blur();
return false;
});
$("#player_pause").click( function() {
$('#jquery_jplayer').jPlayer("pause");
$(this).blur();
return false;
});
$("#player_stop").click( function() {
$('#jquery_jplayer').jPlayer("stop");
$(this).blur();
return false;
});
$("#player_volume_min").click( function() {
$('#jquery_jplayer').jPlayer("volume", 0);
$(this).blur();
return false;
});
$("#player_volume_max").click( function() {
$('#jquery_jplayer').jPlayer("volume", 100);
$(this).blur();
return false;
});
$("#player_progress_ctrl_bar a").live( "click", function() {
$("#jquery_jplayer").jPlayer("playHead", this.id.substring(3)*(100.0/global_lp));
$(this).blur();
return false;
});
});
-->
</script>
<style>
<!--
#player_container {
border: 1px solid #009BE3;
padding:0 20px;
}
#player_container p {
font-family: "Myriad Pro Regular","Trebuchet MS";
font-weight: normal;
line-height: 36px;
}
#player_container .blue {
color: #009BE3;
}
#player_container .magenta {
color: #CC0090;
}
#player_container .green {
color: #A0A600;
}
#player_container .darkblue {
color: #002869;
}
#player_progress_ctrl_bar,
#player_progress_play_bar,
#player_progress_load_bar {
font-size:0.8em;
height:1.2em;
}
-->
</style>
</head>
<body>
<div id="jquery_jplayer"></div>
<div id="player_container">
<p><a href="#" id="player_play" class="12" title="play">play</a> | <a href="#" id="player_pause" title="pause">pause</a> | <a href="#" id="player_stop" title="stop">stop</a></p>
</div>
<div id="player_container">
<p><a href="#" id="player_play" class="13" title="play">play</a> | <a href="#" id="player_pause" title="pause">pause</a> | <a href="#" id="player_stop" title="stop">stop</a></p>
</div>
</body>
</html> |
Partager