|
@@ -889,6 +889,8 @@
|
|
this.$container.appendTo(this.$container_parent);
|
|
this.$container.appendTo(this.$container_parent);
|
|
// record timeline width
|
|
// record timeline width
|
|
this.timeline_w = parseInt(this.$timeline.width());
|
|
this.timeline_w = parseInt(this.$timeline.width());
|
|
|
|
+ // init seeking
|
|
|
|
+ this.$loader.on('click', this.seek.bind(this));
|
|
// init audio events
|
|
// init audio events
|
|
var fn = '';
|
|
var fn = '';
|
|
for (var i = 0; i < this.audio_events.length; i++) {
|
|
for (var i = 0; i < this.audio_events.length; i++) {
|
|
@@ -1016,6 +1018,7 @@
|
|
// need to trigger play right now to prevent safari blocking auto-play
|
|
// need to trigger play right now to prevent safari blocking auto-play
|
|
this.play();
|
|
this.play();
|
|
},
|
|
},
|
|
|
|
+ // audio is ready to play
|
|
onLoadedmetadata(){
|
|
onLoadedmetadata(){
|
|
var rem = parseInt(this.audio.duration, 10),
|
|
var rem = parseInt(this.audio.duration, 10),
|
|
mins = Math.floor(rem/60,10),
|
|
mins = Math.floor(rem/60,10),
|
|
@@ -1103,6 +1106,11 @@
|
|
this.timeOutToHide();
|
|
this.timeOutToHide();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ seek(e){
|
|
|
|
+ var seek = e.originalEvent.layerX / this.timeline_w * this.audio.duration
|
|
|
|
+ console.log("Audio seeking : seek", seek);
|
|
|
|
+ this.audio.currentTime = seek;
|
|
|
|
+ },
|
|
// audio events
|
|
// audio events
|
|
onPlaying(){
|
|
onPlaying(){
|
|
this.$btns.addClass('is-playing');
|
|
this.$btns.addClass('is-playing');
|