fixes #1965 initialSegment property added
diff --git a/player/index.html b/player/index.html
index 97ce6bf..fe0b176 100644
--- a/player/index.html
+++ b/player/index.html
@@ -173,7 +173,8 @@
container: elem,
renderer: 'svg',
loop: false,
- autoplay: true,
+ autoplay: false,
+ initialSegment: [10, 11],
rendererSettings: {
progressiveLoad:true,
preserveAspectRatio: 'xMidYMid meet',
diff --git a/player/js/animation/AnimationItem.js b/player/js/animation/AnimationItem.js
index 80fd8aa..772f86d 100644
--- a/player/js/animation/AnimationItem.js
+++ b/player/js/animation/AnimationItem.js
@@ -5,6 +5,7 @@
this.isLoaded = false;
this.currentFrame = 0;
this.currentRawFrame = 0;
+ this.firstFrame = 0;
this.totalFrames = 0;
this.frameRate = 0;
this.frameMult = 0;
@@ -81,6 +82,8 @@
this.trigger('data_failed');
}.bind(this));
}
+
+ this.initialSegment = params.initialSegment;
};
AnimationItem.prototype.setData = function (wrapper, animationData) {
@@ -193,7 +196,14 @@
}
try {
this.animationData = animData;
- this.totalFrames = Math.floor(this.animationData.op - this.animationData.ip);
+
+ if (this.initialSegment) {
+ this.totalFrames = Math.floor(this.initialSegment[1] - this.initialSegment[0]);
+ this.firstFrame = Math.round(this.initialSegment[0]);
+ } else {
+ this.totalFrames = Math.floor(this.animationData.op - this.animationData.ip);
+ this.firstFrame = Math.round(this.animationData.ip);
+ }
this.renderer.configAnimation(animData);
if(!animData.assets){
animData.assets = [];
@@ -201,7 +211,6 @@
this.assets = this.animationData.assets;
this.frameRate = this.animationData.fr;
- this.firstFrame = Math.round(this.animationData.ip);
this.frameMult = this.animationData.fr / 1000;
this.renderer.searchExtraCompositions(animData.assets);
this.trigger('config_ready');