|
@@ -6,11 +6,13 @@
|
6
|
6
|
|
7
|
7
|
PreziPlayer.API_VERSION = 1;
|
8
|
8
|
PreziPlayer.CURRENT_STEP = 'currentStep';
|
|
9
|
+ PreziPlayer.CURRENT_ANIMATION_STEP = 'currentAnimationStep';
|
9
|
10
|
PreziPlayer.CURRENT_OBJECT = 'currentObject';
|
10
|
11
|
PreziPlayer.STATUS_LOADING = 'loading';
|
11
|
12
|
PreziPlayer.STATUS_READY = 'ready';
|
12
|
13
|
PreziPlayer.STATUS_CONTENT_READY = 'contentready';
|
13
|
14
|
PreziPlayer.EVENT_CURRENT_STEP = "currentStepChange";
|
|
15
|
+ PreziPlayer.EVENT_CURRENT_ANIMATION_STEP = "currentAnimationStepChange";
|
14
|
16
|
PreziPlayer.EVENT_CURRENT_OBJECT = "currentObjectChange";
|
15
|
17
|
PreziPlayer.EVENT_STATUS = "statusChange";
|
16
|
18
|
PreziPlayer.EVENT_PLAYING = "isAutoPlayingChange";
|
|
@@ -61,6 +63,7 @@
|
61
|
63
|
this.options = options;
|
62
|
64
|
this.values = {'status': PreziPlayer.STATUS_LOADING};
|
63
|
65
|
this.values[PreziPlayer.CURRENT_STEP] = 0;
|
|
66
|
+ this.values[PreziPlayer.CURRENT_ANIMATION_STEP] = 0;
|
64
|
67
|
this.values[PreziPlayer.CURRENT_OBJECT] = null;
|
65
|
68
|
this.callbacks = [];
|
66
|
69
|
this.id = id;
|
|
@@ -84,14 +87,16 @@
|
84
|
87
|
this.iframe.width = options.width || 640;
|
85
|
88
|
this.iframe.height = options.height || 480;
|
86
|
89
|
this.embedTo.innerHTML = '';
|
|
90
|
+ // JITSI: IN CASE SOMETHING GOES WRONG.
|
87
|
91
|
try {
|
88
|
92
|
this.embedTo.appendChild(this.iframe);
|
89
|
93
|
}
|
90
|
94
|
catch (err) {
|
91
|
95
|
console.log("CATCH ERROR");
|
92
|
96
|
}
|
93
|
|
-
|
94
|
97
|
|
|
98
|
+ // JITSI: Increase interval from 200 to 500, which fixes prezi
|
|
99
|
+ // crashes for us.
|
95
|
100
|
this.initPollInterval = setInterval(function(){
|
96
|
101
|
_this.sendMessage({'action': 'init'});
|
97
|
102
|
}, 500);
|
|
@@ -152,7 +157,26 @@
|
152
|
157
|
};
|
153
|
158
|
|
154
|
159
|
PreziPlayer.prototype.toStep = /* toStep is DEPRECATED */
|
155
|
|
- PreziPlayer.prototype.flyToStep = function(step) {
|
|
160
|
+ PreziPlayer.prototype.flyToStep = function(step, animation_step) {
|
|
161
|
+ var obj = this;
|
|
162
|
+ // check animation_step
|
|
163
|
+ if (animation_step > 0 &&
|
|
164
|
+ obj.values.animationCountOnSteps &&
|
|
165
|
+ obj.values.animationCountOnSteps[step] <= animation_step) {
|
|
166
|
+ animation_step = obj.values.animationCountOnSteps[step];
|
|
167
|
+ }
|
|
168
|
+ // jump to animation steps by calling flyToNextStep()
|
|
169
|
+ function doAnimationSteps() {
|
|
170
|
+ if (obj.values.isMoving == true) {
|
|
171
|
+ setTimeout(doAnimationSteps, 100); // wait until the flight ends
|
|
172
|
+ return;
|
|
173
|
+ }
|
|
174
|
+ while (animation_step-- > 0) {
|
|
175
|
+ obj.flyToNextStep(); // do the animation steps
|
|
176
|
+ }
|
|
177
|
+ }
|
|
178
|
+ setTimeout(doAnimationSteps, 200); // 200ms is the internal "reporting" time
|
|
179
|
+ // jump to the step
|
156
|
180
|
return this.sendMessage({
|
157
|
181
|
'action': 'present',
|
158
|
182
|
'data': ['moveToStep', step]
|
|
@@ -192,6 +216,10 @@
|
192
|
216
|
return this.values.currentStep;
|
193
|
217
|
};
|
194
|
218
|
|
|
219
|
+ PreziPlayer.prototype.getCurrentAnimationStep = function() {
|
|
220
|
+ return this.values.currentAnimationStep;
|
|
221
|
+ };
|
|
222
|
+
|
195
|
223
|
PreziPlayer.prototype.getCurrentObject = function() {
|
196
|
224
|
return this.values.currentObject;
|
197
|
225
|
};
|
|
@@ -208,6 +236,10 @@
|
208
|
236
|
return this.values.stepCount;
|
209
|
237
|
};
|
210
|
238
|
|
|
239
|
+ PreziPlayer.prototype.getAnimationCountOnSteps = function() {
|
|
240
|
+ return this.values.animationCountOnSteps;
|
|
241
|
+ };
|
|
242
|
+
|
211
|
243
|
PreziPlayer.prototype.getTitle = function() {
|
212
|
244
|
return this.values.title;
|
213
|
245
|
};
|