-
Notifications
You must be signed in to change notification settings - Fork 6
/
show-time-left.audio.html
93 lines (83 loc) · 2.88 KB
/
show-time-left.audio.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>jPlayer Example: Showing the time left</title>
<link href="skin/pink.flag/jplayer.pink.flag.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="lib/jquery-1.10.2.js"></script>
<script type="text/javascript" src="lib/jquery.jplayer.js"></script>
<script type="text/javascript">
jQuery(document).ready(function($) {
var showTimeLeft = function(event) {
var timeLeft = event.jPlayer.status.duration - event.jPlayer.status.currentTime,
timeDisplay = '-' + $.jPlayer.convertTime(timeLeft),
$time = $(this).data('$time');
if($time) {
$time.text(timeDisplay);
}
};
// Audio
$('#jplayer_audio_1').jPlayer({
ready: function(event) {
var $time = $(event.jPlayer.options.cssSelectorAncestor + " .jp-current-time");
$(this).data('$time', $time).jPlayer('setMedia', {
mp3: 'http://www.jplayer.org/audio/mp3/Miaow-07-Bubble.mp3',
oga: 'http://www.jplayer.org/audio/ogg/Miaow-07-Bubble.ogg'
});
},
timeupdate: showTimeLeft,
durationchange: showTimeLeft,
cssSelectorAncestor: '#jp_gui_audio_1',
cssSelector: {
currentTime: ''
},
swfPath: 'lib',
supplied: 'oga, mp3',
smoothPlayBar: true,
keyEnabled: true,
wmode: 'window'
});
});
</script>
</head>
<body>
<div id="jplayer_audio_1" class="jp-jplayer"></div>
<div id="jp_gui_audio_1" class="jp-audio">
<div class="jp-type-single">
<div class="jp-gui jp-interface">
<ul class="jp-controls">
<li><a href="javascript:;" class="jp-play" tabindex="1">play</a></li>
<li><a href="javascript:;" class="jp-pause" tabindex="1">pause</a></li>
<li><a href="javascript:;" class="jp-stop" tabindex="1">stop</a></li>
<li><a href="javascript:;" class="jp-mute" tabindex="1" title="mute">mute</a></li>
<li><a href="javascript:;" class="jp-unmute" tabindex="1" title="unmute">unmute</a></li>
<li><a href="javascript:;" class="jp-volume-max" tabindex="1" title="max volume">max volume</a></li>
</ul>
<div class="jp-progress">
<div class="jp-seek-bar">
<div class="jp-play-bar"></div>
</div>
</div>
<div class="jp-volume-bar">
<div class="jp-volume-bar-value"></div>
</div>
<div class="jp-current-time"></div>
<div class="jp-duration"></div>
<ul class="jp-toggles">
<li><a href="javascript:;" class="jp-repeat" tabindex="1" title="repeat">repeat</a></li>
<li><a href="javascript:;" class="jp-repeat-off" tabindex="1" title="repeat off">repeat off</a></li>
</ul>
</div>
<div class="jp-title">
<ul>
<li>Bubble</li>
</ul>
</div>
<div class="jp-no-solution">
<span>Update Required</span>
To play the media you will need to either update your browser to a recent version or update your <a href="http://get.adobe.com/flashplayer/" target="_blank">Flash plugin</a>.
</div>
</div>
</div>
</body>
</html>