(function() { "use strict"; var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; window.PreziPlayer = (function() { PreziPlayer.API_VERSION = 1; PreziPlayer.CURRENT_STEP = 'currentStep'; PreziPlayer.CURRENT_ANIMATION_STEP = 'currentAnimationStep'; PreziPlayer.CURRENT_OBJECT = 'currentObject'; PreziPlayer.STATUS_LOADING = 'loading'; PreziPlayer.STATUS_READY = 'ready'; PreziPlayer.STATUS_CONTENT_READY = 'contentready'; PreziPlayer.EVENT_CURRENT_STEP = "currentStepChange"; PreziPlayer.EVENT_CURRENT_ANIMATION_STEP = "currentAnimationStepChange"; PreziPlayer.EVENT_CURRENT_OBJECT = "currentObjectChange"; PreziPlayer.EVENT_STATUS = "statusChange"; PreziPlayer.EVENT_PLAYING = "isAutoPlayingChange"; PreziPlayer.EVENT_IS_MOVING = "isMovingChange"; PreziPlayer.domain = "https://prezi.com"; PreziPlayer.path = "/player/"; PreziPlayer.players = {}; PreziPlayer.binded_methods = ['changesHandler']; PreziPlayer.createMultiplePlayers = function(optionArray){ for(var i=0; i 0 && obj.values.animationCountOnSteps && obj.values.animationCountOnSteps[step] <= animation_step) { animation_step = obj.values.animationCountOnSteps[step]; } // jump to animation steps by calling flyToNextStep() function doAnimationSteps() { if (obj.values.isMoving == true) { setTimeout(doAnimationSteps, 100); // wait until the flight ends return; } while (animation_step-- > 0) { obj.flyToNextStep(); // do the animation steps } } setTimeout(doAnimationSteps, 200); // 200ms is the internal "reporting" time // jump to the step return this.sendMessage({ 'action': 'present', 'data': ['moveToStep', step] }); }; PreziPlayer.prototype.toObject = /* toObject is DEPRECATED */ PreziPlayer.prototype.flyToObject = function(objectId) { return this.sendMessage({ 'action': 'present', 'data': ['moveToObject', objectId] }); }; PreziPlayer.prototype.play = function(defaultDelay) { return this.sendMessage({ 'action': 'present', 'data': ['startAutoPlay', defaultDelay] }); }; PreziPlayer.prototype.stop = function() { return this.sendMessage({ 'action': 'present', 'data': ['stopAutoPlay'] }); }; PreziPlayer.prototype.pause = function(defaultDelay) { return this.sendMessage({ 'action': 'present', 'data': ['pauseAutoPlay', defaultDelay] }); }; PreziPlayer.prototype.getCurrentStep = function() { return this.values.currentStep; }; PreziPlayer.prototype.getCurrentAnimationStep = function() { return this.values.currentAnimationStep; }; PreziPlayer.prototype.getCurrentObject = function() { return this.values.currentObject; }; PreziPlayer.prototype.getStatus = function() { return this.values.status; }; PreziPlayer.prototype.isPlaying = function() { return this.values.isAutoPlaying; }; PreziPlayer.prototype.getStepCount = function() { return this.values.stepCount; }; PreziPlayer.prototype.getAnimationCountOnSteps = function() { return this.values.animationCountOnSteps; }; PreziPlayer.prototype.getTitle = function() { return this.values.title; }; PreziPlayer.prototype.setDimensions = function(dims) { for (var parameter in dims) { this.iframe[parameter] = dims[parameter]; } } PreziPlayer.prototype.getDimensions = function() { return { width: parseInt(this.iframe.width, 10), height: parseInt(this.iframe.height, 10) } } PreziPlayer.prototype.on = function(event, callback) { this.callbacks.push({ event: event, callback: callback }); }; PreziPlayer.prototype.off = function(event, callback) { var j, item; if (event === undefined) { this.callbacks = []; } j = this.callbacks.length; while (j--) { item = this.callbacks[j]; if (item && item.event === event && (callback === undefined || item.callback === callback)){ this.callbacks.splice(j, 1); } } }; if (window.addEventListener) { window.addEventListener('message', PreziPlayer.messageReceived, false); } else { window.attachEvent('onmessage', PreziPlayer.messageReceived); } return PreziPlayer; })(); })(); module.exports = PreziPlayer;