From 1c94c1208c4b412f17feab892c9204ee3484e881 Mon Sep 17 00:00:00 2001 From: edsilv Date: Thu, 17 May 2018 17:01:45 +0100 Subject: [PATCH] bumped version --- dist/iiif-av-component.d.ts | 2 +- dist/iiif-av-component.js | 4 +--- dist/iiif-av-component.min.js | 2 +- examples/js/iiif-av-component.js | 4 +--- package.json | 2 +- 5 files changed, 5 insertions(+), 9 deletions(-) diff --git a/dist/iiif-av-component.d.ts b/dist/iiif-av-component.d.ts index 9e0af78..c2bb78a 100644 --- a/dist/iiif-av-component.d.ts +++ b/dist/iiif-av-component.d.ts @@ -1,4 +1,4 @@ -// iiif-av-component v0.0.40 https://github.com/iiif-commons/iiif-av-component#readme +// iiif-av-component v0.0.41 https://github.com/iiif-commons/iiif-av-component#readme interface Array { /** * Determines whether an array includes a certain element, returning true or false as appropriate. diff --git a/dist/iiif-av-component.js b/dist/iiif-av-component.js index 40bae57..b4b3196 100644 --- a/dist/iiif-av-component.js +++ b/dist/iiif-av-component.js @@ -1,4 +1,4 @@ -// iiif-av-component v0.0.40 https://github.com/iiif-commons/iiif-av-component#readme +// iiif-av-component v0.0.41 https://github.com/iiif-commons/iiif-av-component#readme (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.iiifAvComponent = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i0&&(this._data.canvasId=this.canvasInstances[0].getCanvasId())}},AVComponent.prototype._getCanvases=function(){return this._data.helper?this._data.helper.getCanvases():[]},AVComponent.prototype._initCanvas=function(canvas){var _this=this,canvasInstance=new IIIFComponents.CanvasInstance({target:document.createElement("div"),data:Object.assign({},{canvas:canvas},this._data)});canvasInstance.logMessage=this._logMessage.bind(this),this._$element.append(canvasInstance.$playerElement),canvasInstance.init(),this.canvasInstances.push(canvasInstance),canvasInstance.on(AVComponent.Events.CANVASREADY,function(){_this.fire(AVComponent.Events.CANVASREADY)},!1),canvasInstance.on(IIIFComponents.AVComponentCanvasInstance.Events.PREVIOUS_RANGE,function(){_this._prevRange()},!1),canvasInstance.on(IIIFComponents.AVComponentCanvasInstance.Events.NEXT_RANGE,function(){_this._nextRange()},!1),canvasInstance.on(AVComponent.Events.RANGE_CHANGED,function(rangeId){_this.fire(AVComponent.Events.RANGE_CHANGED,rangeId)},!1),canvasInstance.on(IIIFComponents.AVVolumeControl.Events.VOLUME_CHANGED,function(volume){_this._setCanvasInstanceVolumes(volume),_this.fire(IIIFComponents.AVVolumeControl.Events.VOLUME_CHANGED,volume)},!1)},AVComponent.prototype._prevRange=function(){if(this._data&&this._data.helper){var prevRange=this._data.helper.getPreviousRange();prevRange?this.playRange(prevRange.id):this._rewind()}},AVComponent.prototype._nextRange=function(){if(this._data&&this._data.helper){var nextRange=this._data.helper.getNextRange();nextRange&&this.playRange(nextRange.id)}},AVComponent.prototype._setCanvasInstanceVolumes=function(volume){this.canvasInstances.forEach(function(canvasInstance){canvasInstance.set({volume:volume})})},AVComponent.prototype._getCanvasInstanceById=function(canvasId){canvasId=Manifesto.Utils.normaliseUrl(canvasId);for(var i=0;i\n '+this.options.data.content.mute+"\n "),this._$volumeSlider=$('
'),this._$element.append(this._$volumeMute,this._$volumeSlider);var that=this;return this._$volumeMute.on("click",function(){0!==_this._data.volume?(_this._lastVolume=_this._data.volume,_this._data.volume=0):_this._data.volume=_this._lastVolume,_this.fire(AVVolumeControl.Events.VOLUME_CHANGED,_this._data.volume)}),this._$volumeSlider.slider({value:that._data.volume,step:.1,orientation:"horizontal",min:0,max:1,animate:!1,create:function(evt,ui){},slide:function(evt,ui){that._data.volume=ui.value,0===that._data.volume&&(that._lastVolume=0),that.fire(AVVolumeControl.Events.VOLUME_CHANGED,that._data.volume)},stop:function(evt,ui){}}),success},AVVolumeControl.prototype.set=function(data){this._data=Object.assign(this._data,data),this._render()},AVVolumeControl.prototype._render=function(){void 0!==this._data.volume&&(this._$volumeSlider.slider({value:this._data.volume}),0===this._data.volume?this._$volumeMute.find("i").switchClass("on","off"):this._$volumeMute.find("i").switchClass("off","on"))},AVVolumeControl.prototype._resize=function(){},AVVolumeControl}(_Components.BaseComponent);IIIFComponents.AVVolumeControl=AVVolumeControl}(IIIFComponents||(IIIFComponents={})),function(IIIFComponents){var AVVolumeControl;!function(AVVolumeControl){var Events=function(){function Events(){}return Events.VOLUME_CHANGED="volumechanged",Events}();AVVolumeControl.Events=Events}(AVVolumeControl=IIIFComponents.AVVolumeControl||(IIIFComponents.AVVolumeControl={}))}(IIIFComponents||(IIIFComponents={}));var IIIFComponents,__extends=this&&this.__extends||function(){var extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p])};return function(d,b){function __(){this.constructor=d}extendStatics(d,b),d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)}}();!function(IIIFComponents){var CanvasInstance=function(_super){function CanvasInstance(options){var _this=_super.call(this,options)||this;return _this._canvasClockDuration=0,_this._canvasClockFrequency=25,_this._canvasClockStartDate=0,_this._canvasClockTime=0,_this._canvasHeight=0,_this._canvasWidth=0,_this._data=_this.data(),_this._highPriorityFrequency=25,_this._isPlaying=!1,_this._isStalled=!1,_this._lowPriorityFrequency=250,_this._mediaSyncMarginSecs=1,_this._ranges=[],_this._readyCanvasesCount=0,_this._stallRequestedBy=[],_this._wasPlaying=!1,_this._data=_this.options.data,_this.$playerElement=$('
'),_this}return __extends(CanvasInstance,_super),CanvasInstance.prototype.init=function(){var _this=this;if(!this._data||!this._data.content||!this._data.canvas)return void console.warn("unable to initialise, missing canvas or content");this._$hoverPreviewTemplate=$('
'),this._$canvasContainer=$('
'),this._$optionsContainer=$('
'),this._$rangeTimelineContainer=$('
'),this._$canvasTimelineContainer=$('
'),this._$canvasHoverPreview=this._$hoverPreviewTemplate.clone(),this._$canvasHoverHighlight=$('
'),this._$rangeHoverPreview=this._$hoverPreviewTemplate.clone(),this._$rangeHoverHighlight=$('
'),this._$durationHighlight=$('
'),this._$timelineItemContainer=$('
'),this._$controlsContainer=$('
'),this._$prevButton=$('\n "),this._$playButton=$('\n "),this._$nextButton=$('\n "),this._$timeDisplay=$('
/
'),this._$canvasTime=this._$timeDisplay.find(".canvas-time"),this._$canvasDuration=this._$timeDisplay.find(".canvas-duration");var $volume=$('
');if(this._volume=new IIIFComponents.AVVolumeControl({target:$volume[0],data:Object.assign({},this._data)}),this._volume.on(IIIFComponents.AVVolumeControl.Events.VOLUME_CHANGED,function(value){_this.fire(IIIFComponents.AVVolumeControl.Events.VOLUME_CHANGED,value)},!1),this._$controlsContainer.append(this._$prevButton,this._$playButton,this._$nextButton,this._$timeDisplay,$volume),this._$canvasTimelineContainer.append(this._$canvasHoverPreview,this._$canvasHoverHighlight,this._$durationHighlight),this._$rangeTimelineContainer.append(this._$rangeHoverPreview,this._$rangeHoverHighlight),this._$optionsContainer.append(this._$canvasTimelineContainer,this._$rangeTimelineContainer,this._$timelineItemContainer,this._$controlsContainer),this.$playerElement.append(this._$canvasContainer,this._$optionsContainer),this._$canvasHoverPreview.hide(),this._$rangeHoverPreview.hide(),this._data&&this._data.helper&&this._data.canvas){var ranges_1=[];this.isVirtual()?this._data.canvas.canvases.forEach(function(canvas){if(_this._data&&_this._data.helper){var r=_this._data.helper.getCanvasRanges(canvas);r.forEach(function(range){if(range.canvases&&range.canvases.length)for(var i=0;ifullWidth&&(left=fullWidth-hoverPreviewWidth,arrowLeft=hoverPreviewWidth-(fullWidth-x)-6),$hoverPreview.css({left:left,top:hoverPreviewHeight*-1+"px"}).show(),$hoverArrow.css({left:arrowLeft})},CanvasInstance.prototype._previous=function(isDouble){this._data.limitToRange?isDouble?this._isNavigationConstrainedToRange()?this._rewind():this.fire(IIIFComponents.AVComponentCanvasInstance.Events.PREVIOUS_RANGE):this._rewind():this._data.range?isDouble?(this.set({range:void 0}),this._rewind()):this.fire(IIIFComponents.AVComponentCanvasInstance.Events.PREVIOUS_RANGE):this._rewind()},CanvasInstance.prototype._next=function(){this._data.limitToRange&&this._isNavigationConstrainedToRange()?this._fastforward():this.fire(IIIFComponents.AVComponentCanvasInstance.Events.NEXT_RANGE)},CanvasInstance.prototype.destroy=function(){window.clearInterval(this._highPriorityInterval),window.clearInterval(this._lowPriorityInterval),window.clearInterval(this._canvasClockInterval)},CanvasInstance.prototype._convertToPercentage=function(pixelValue,maxValue){var percentage=pixelValue/maxValue*100;return percentage},CanvasInstance.prototype._renderMediaElement=function(data){var $mediaElement,_this=this,type=data.type.toString().toLowerCase();switch(type){case"image":$mediaElement=$('');break;case"video":$mediaElement=$('