Skip to content

Commit

Permalink
fixed bug: circleRadius config value is not used to determine radius …
Browse files Browse the repository at this point in the history
…of "ring."
  • Loading branch information
kenial committed Mar 7, 2014
1 parent 7de2079 commit 36d9446
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions demo/360-player/script/360player.js
Expand Up @@ -331,7 +331,7 @@ function ThreeSixtyPlayer() {
resume: function() { resume: function() {
pl.removeClass(this._360data.oUIBox,this._360data.className); pl.removeClass(this._360data.oUIBox,this._360data.className);
this._360data.className = pl.css.sPlaying; this._360data.className = pl.css.sPlaying;
pl.addClass(this._360data.oUIBox,this._360data.className); pl.addClass(this._360data.oUIBox,this._360data.className);
}, },


finish: function() { finish: function() {
Expand Down Expand Up @@ -772,7 +772,7 @@ function ThreeSixtyPlayer() {
this.getArcEndpointCoords = function(radius, radians) { this.getArcEndpointCoords = function(radius, radians) {


return { return {
x: radius * Math.cos(radians), x: radius * Math.cos(radians),
y: radius * Math.sin(radians) y: radius * Math.sin(radians)
}; };


Expand Down Expand Up @@ -835,14 +835,14 @@ function ThreeSixtyPlayer() {
} }


// background ring // background ring
self.drawSolidArc(this._360data.oCanvas,self.config.backgroundRingColor,this._360data.width,this._360data.radius * ringScaleFactor,self.deg2rad(fullCircle),false); self.drawSolidArc(this._360data.oCanvas, self.config.backgroundRingColor, this._360data.circleRadius, this._360data.circleRadius * ringScaleFactor, self.deg2rad(fullCircle), false);


// loaded ring // loaded ring
self.drawSolidArc(this._360data.oCanvas,(this._360data.metadata?self.config.loadRingColorMetadata:self.config.loadRingColor),this._360data.width,this._360data.radius * ringScaleFactor,self.deg2rad(fullCircle*(this._360data.lastValues.bytesLoaded/this._360data.lastValues.bytesTotal)),0,true); self.drawSolidArc(this._360data.oCanvas, (this._360data.metadata ? self.config.loadRingColorMetadata : self.config.loadRingColor), this._360data.circleRadius, this._360data.circleRadius * ringScaleFactor, this._360data.radius * ringScaleFactor, self.deg2rad(fullCircle * (this._360data.lastValues.bytesLoaded / this._360data.lastValues.bytesTotal)), 0, true);


// don't draw if 0 (full black circle in Opera) // don't draw if 0 (full black circle in Opera)
if (this._360data.lastValues.position !== 0) { if (this._360data.lastValues.position !== 0) {
self.drawSolidArc(this._360data.oCanvas,(this._360data.metadata?self.config.playRingColorMetadata:self.config.playRingColor),this._360data.width,this._360data.radius * ringScaleFactor,self.deg2rad((this._360data.didFinish===1?fullCircle:fullCircle*(this._360data.lastValues.position/this._360data.lastValues.durationEstimate))),0,true); self.drawSolidArc(this._360data.oCanvas, (this._360data.metadata ? self.config.playRingColorMetadata : self.config.playRingColor), this._360data.circleRadius, this._360data.circleRadius * ringScaleFactor, self.deg2rad((this._360data.didFinish === 1 ? fullCircle : fullCircle * (this._360data.lastValues.position / this._360data.lastValues.durationEstimate))), 0, true);
} }


// metadata goes here // metadata goes here
Expand Down Expand Up @@ -1089,7 +1089,7 @@ function ThreeSixtyPlayer() {
if (canvasElements.length > 1) { if (canvasElements.length > 1) {
oCanvas = canvasElements[canvasElements.length-1]; oCanvas = canvasElements[canvasElements.length-1];
} }
} else { } else {
// add a handler for the button // add a handler for the button
oCanvas = oLinks[i].parentNode.getElementsByTagName('canvas')[0]; oCanvas = oLinks[i].parentNode.getElementsByTagName('canvas')[0];
} }
Expand Down Expand Up @@ -1220,7 +1220,7 @@ ThreeSixtyPlayer.prototype.VUMeter = function(oParent) {
// for debugging VU images // for debugging VU images
/* /*
var o = document.createElement('img'); var o = document.createElement('img');
o.style.marginRight = '5px'; o.style.marginRight = '5px';
o.src = vuMeterData[i][j]; o.src = vuMeterData[i][j];
document.documentElement.appendChild(o); document.documentElement.appendChild(o);
*/ */
Expand Down

0 comments on commit 36d9446

Please sign in to comment.