Skip to content

Commit

Permalink
quickFix: autoplay on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
Amr Wagdy committed Feb 23, 2022
1 parent 08b8a4a commit d67c528
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
1 change: 0 additions & 1 deletion examples/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ <h2>Engage your customers with a stunning <strong>360 view of your products</str
data-ratio="1.7"
data-responsive="scaleflex"
data-spin-reverse
data-info
></div>
<p class="view-360-capture">36 images, autoplay (desktop only), bottom 360 view circle, arrow keys support (desktop
only), magnifier (desktop only), inner box shadow</p>
Expand Down
2 changes: 1 addition & 1 deletion examples/src/mobile.init.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ if (isMobile) {
'data-folder',
'https://scaleflex.cloudimg.io/v7/https://cdn.scaleflex.it/demo/360-car/'
);
mercedes360View.setAttribute('data-ratio', '0.666');
mercedes360View.setAttribute('data-ratio', '1.7');
mercedes360View.setAttribute('data-bottom-circle-offset', '22');
}
3 changes: 2 additions & 1 deletion src/ci360.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,6 @@ import {
const responsive = this.ciParams.ciToken;
const firstImage = this.imagesX[0];

this.updateContainerAndCanvasSize(firstImage);
this.update();

this.speedFactor = getSpeedFactor(this.dragSpeed, this.amountX, this.container.offsetWidth);
Expand Down Expand Up @@ -766,6 +765,7 @@ import {

const ctx = this.canvas.getContext("2d");
ctx.scale(this.devicePixelRatio, this.devicePixelRatio);
this.updateContainerAndCanvasSize(image);

if (this.fullscreenView) {
const { width, height, offsetX, offsetY } =
Expand All @@ -785,6 +785,7 @@ import {
this.movingDirection
);
}

ctx.drawImage(image, 0, 0, this.canvas.width, this.canvas.height);
}
}
Expand Down

0 comments on commit d67c528

Please sign in to comment.