diff --git a/README b/README index 6c7ca86..04d2227 100644 --- a/README +++ b/README @@ -2,5 +2,9 @@ An HTML 5 audio player supporitng live streams and archived playback. Supports variable DOM elements and has features like playlist support and scrubbable progress bar. -Requirements +2.x Requirements - jQuery + +3.x Requirements none +In version 3.0 we removed jquery ias a dependency to allow passing in an alternate library like zepto. +This means you have to pass jQuery or Zepto into the constructor. diff --git a/package.json b/package.json index 621d06c..8269c1f 100644 --- a/package.json +++ b/package.json @@ -15,5 +15,5 @@ "url": "git@gitlab.mpr.org:js-libraries/apm-html5-player.git" }, "title": "APM HTML5 Player", - "version": "0.3.0" + "version": "0.3.1" } diff --git a/script/Player.js b/script/Player.js index cfa3356..f587414 100644 --- a/script/Player.js +++ b/script/Player.js @@ -325,7 +325,7 @@ Player.prototype.getSecondsByClickPosition = function($element, clickXPosition) { var timelineOffset = $element.offset().left; - var timelineWidth = $element.outerWidth(); + var timelineWidth = $element.width(); var positionInElement = clickXPosition - timelineOffset; var percent = positionInElement / timelineWidth; var time = this.audio.duration * percent; @@ -348,7 +348,7 @@ Player.prototype.getVolumeByHorizClickPosition = function($element, clickXPosition) { var volumeBarOffset = $element.offset().left; - var volumeBarWidth = $element.outerWidth(); + var volumeBarWidth = $element.width(); var positionInElement = clickXPosition - volumeBarOffset; var percent = positionInElement / volumeBarWidth; var volume = Number(percent.toFixed(2));