From f6eb04bf8644f8d1cd8d6b1b9b0367f6aad30b91 Mon Sep 17 00:00:00 2001 From: IrosTheBeggar Date: Wed, 8 Feb 2017 17:23:57 -0500 Subject: [PATCH] Fixed seek bug --- public/js/mstream.vue-player-controls.js | 18 +++++++++--------- public/mstream.html | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/public/js/mstream.vue-player-controls.js b/public/js/mstream.vue-player-controls.js index 4e009aa..866614c 100644 --- a/public/js/mstream.vue-player-controls.js +++ b/public/js/mstream.vue-player-controls.js @@ -98,15 +98,6 @@ var VUEPLAYER = function() { } }, methods: { - goToPosition: function(event){ - console.log(event.target); - console.log(this.$el); - var relativeClickPosition = event.clientX - this.$el.getBoundingClientRect().left; - var totalWidth = this.$el.getBoundingClientRect().width; - var percentage = (relativeClickPosition / totalWidth) * 100; - // Set Player time - MSTREAM.seekByPercentage(percentage); - }, toggleRepeat: function(){ MSTREAM.toggleRepeat(); }, @@ -117,6 +108,15 @@ var VUEPLAYER = function() { }); + // Button Events + document.getElementById( "progress-bar" ).addEventListener("click",function(event) { + var relativeClickPosition = event.clientX - this.getBoundingClientRect().left; + var totalWidth = this.getBoundingClientRect().width; + var percentage = (relativeClickPosition / totalWidth) * 100; + // Set Player time + MSTREAM.seekByPercentage(percentage); + }); + // Button Events document.getElementById( "next-button" ).addEventListener("click",function() { MSTREAM.nextSong(); diff --git a/public/mstream.html b/public/mstream.html index 65c3c60..1776273 100755 --- a/public/mstream.html +++ b/public/mstream.html @@ -273,7 +273,7 @@ -
+
{{currentSongText}}
@@ -284,11 +284,11 @@
{{showTime}}
+ + - -