diff -r c9c502117eb6 -r ff4b567d51f2 web/res/js/LdtPlayer.min.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/res/js/LdtPlayer.min.js Sun Feb 15 00:43:16 2015 +0100 @@ -0,0 +1,127 @@ + +/* + * + __ __ _ _ _ _ + | \/ | ___| |_ __ _ __| | __ _| |_ __ _ _ __ | | __ _ _ _ ___ _ __ + | |\/| |/ _ \ __/ _` |/ _` |/ _` | __/ _` | '_ \| |/ _` | | | |/ _ \ '__| + | | | | __/ || (_| | (_| | (_| | || (_| | |_) | | (_| | |_| | __/ | + |_| |_|\___|\__\__,_|\__,_|\__,_|\__\__,_| .__/|_|\__,_|\__, |\___|_| + |_| |___/ + + * Copyright 2010-2012 Institut de recherche et d'innovation + * contributor(s) : Karim Hamidou, Samuel Huron, Raphael Velt, Thibaut Cavalie + * + * contact@iri.centrepompidou.fr + * http://www.iri.centrepompidou.fr + * + * This software is a computer program whose purpose is to show and add annotations on a video . + * This software is governed by the CeCILL-C license under French law and + * abiding by the rules of distribution of free software. You can use, + * modify and/ or redistribute the software under the terms of the CeCILL-C + * license as circulated by CEA, CNRS and INRIA at the following URL + * "http://www.cecill.info". + * + * The fact that you are presently reading this means that you have had + * knowledge of the CeCILL-C license and that you accept its terms. +*/ +(function(a){function e(n,p){var y=/^\w+\:\/\//;if(/^\/\/\/?/.test(n))n=location.protocol+n;else if(!y.test(n)&&n.charAt(0)!="/")n=(p||"")+n;return y.test(n)?n:(n.charAt(0)=="/"?L:O)+n}function g(n,p){for(var y in n)if(n.hasOwnProperty(y))p[y]=n[y];return p}function k(n,p,y,b){n.onload=n.onreadystatechange=function(){if(!(n.readyState&&n.readyState!="complete"&&n.readyState!="loaded"||p[y])){n.onload=n.onreadystatechange=null;b()}}}function l(n){n.ready=n.finished=true;for(var p=0;p0){for(var D=0;D=0;){A=d.shift();w=w[A.type].apply(null,A.args)}return w},noConflict:function(){a.$LAB=i;return m},sandbox:function(){return j()}}}var i=a.$LAB,o="UseLocalXHR",E="AlwaysPreserveOrder",I="AllowDuplicates",v="CacheBust",G="BasePath",O=/^[^?#]*\//.exec(location.href)[0], +L=/^\w+\:\/\/\/?[^\/]+/.exec(O)[0],B=document.head||document.getElementsByTagName("head"),r=a.opera&&Object.prototype.toString.call(a.opera)=="[object Opera]"||"MozAppearance"in document.documentElement.style,x=document.createElement("script"),P=typeof x.preload=="boolean",z=P||x.readyState&&x.readyState=="uninitialized",C=!z&&x.async===true,q=!z&&!C&&!r;a.$LAB=j();(function(n,p,y){if(document.readyState==null&&document[n]){document.readyState="loading";document[n](p,y=function(){document.removeEventListener(p, +y,false);document.readyState="complete"},false)}})("addEventListener","DOMContentLoaded")})(this);if(typeof window.IriSP==="undefined")window.IriSP={VERSION:"0.3.2"};if(typeof IriSP.jQuery==="undefined"&&typeof window.jQuery!=="undefined"){var jvp=window.jQuery().jquery.split("."),jv=100*parseInt(jvp[0])+parseInt(jvp[1]);if(jv>170)IriSP.jQuery=window.jQuery}if(typeof IriSP._==="undefined"&&typeof window._!=="undefined"&&parseFloat(window._.VERSION)>=1.4)IriSP._=window._; +IriSP.jqEscape=function(a){return a.replace(/(:|\.)/g,"\\$1")};IriSP.getLib=function(a){if(IriSP.libFiles.useCdn&&typeof IriSP.libFiles.cdn[a]=="string")return IriSP.libFiles.cdn[a];if(typeof IriSP.libFiles.locations[a]=="string")return IriSP.libFiles.locations[a];if(typeof IriSP.libFiles.inDefaultDir[a]=="string")return IriSP.libFiles.defaultDir+"/"+IriSP.libFiles.inDefaultDir[a]};IriSP._cssCache=[]; +IriSP.loadCss=function(a){if(IriSP._(IriSP._cssCache).indexOf(a)===-1){IriSP.jQuery("",{rel:"stylesheet",type:"text/css",href:a}).appendTo("head");IriSP._cssCache.push(a)}}; +IriSP.textFieldHtml=function(a,e,g){function k(G,O,L){for(;;){var B=G.exec(j);if(!B)break;var r=G.lastIndex,x=B.index;l.push({start:x,end:r,startHtml:typeof O==="function"?O(B):O,endHtml:typeof L==="function"?L(B):L});f.push(x);f.push(r)}}var l=[],f=[],j=a.replace(/(^\s+|\s+$)/g,"");e&&k(e,'',"");k(/(https?:\/\/)?[\w\d\-]+\.[\w\d\-]+\S+/gm,function(G){return''},"");k(/@([\d\w]{1,15})/gm,function(G){return''},"");k(/\*[^*]+\*/gm,"","");k(/[\n\r]+/gm,"","
");IriSP._(g).each(function(G){k.apply(null,G)});f=IriSP._(f).chain().uniq().sortBy(function(G){return parseInt(G)}).value();for(var i="",o=0,E=0;E=0;o--){var v=l[o];if(v.start=I)i+=v.endHtml}for(o=0;oI)i+=v.startHtml}o=I}i+=j.substring(o);return i}; +IriSP.log=function(){typeof console!=="undefined"&&typeof IriSP.logging!=="undefined"&&IriSP.logging&&console.log.apply(console,arguments)};IriSP.attachDndData=function(a,e){a.attr("draggable","true").on("dragstart",function(g){var k=typeof e==="function"?e.call(this):e;try{IriSP._(k).each(function(f,j){f&&g.originalEvent.dataTransfer.setData("text/x-iri-"+j,f)})}catch(l){g.originalEvent.dataTransfer.setData("Text",JSON.stringify(k))}})}; +IriSP.FakeClass=function(a){var e=this,g=function(){};IriSP._(a).each(function(k){e[k]=g})}; +IriSP.Model=function(a){function e(b,c,d){d=d||10;for(c=c.toString(d);c.lengthh)&&m.playing}).forEach(function(m){m.playing=false;m.trigger("leave");d.trigger("leave-annotation",m)});d.getAnnotations().filter(function(m){return m.begin<=h&&m.end>h&&!m.playing}).forEach(function(m){m.playing=true;m.trigger("enter");d.trigger("enter-annotation",m)})});this.on("loadedmetadata", +function(){d.loadedMetadata=true})}};v(C,z);C.prototype.getCurrentTime=function(){return this.currentTime};C.prototype.getVolume=function(){return this.volume};C.prototype.getPaused=function(){return this.paused};C.prototype.getMuted=function(){return this.muted};C.prototype.setCurrentTime=function(b){this.trigger("setcurrenttime",b)};C.prototype.setVolume=function(b){this.trigger("setvolume",b)};C.prototype.setMuted=function(b){this.trigger("setmuted",b)};C.prototype.play=function(){this.trigger("setplay")}; +C.prototype.pause=function(){this.trigger("setpause")};C.prototype.show=function(){};C.prototype.hide=function(){};var q=i.Media=function(b,c){C.call(this,b,c);this.elementType="media";this.duration=new x;this.video=""};v(q,C);q.prototype.setDuration=function(b){this.duration.setMilliseconds(b)};q.prototype.getAnnotations=function(){return this.getRelated("annotation")};q.prototype.getAnnotationsByTypeTitle=function(b){var c=this.source.getAnnotationTypes().searchByTitle(b).pluck("id");return c.length? +this.getAnnotations().filter(function(d){return a._(c).indexOf(d.getAnnotationType().id)!==-1}):new r(this.source.directory)};q=i.Tag=function(b,c){z.call(this,b,c);this.elementType="tag"};v(q,z);q.prototype.getAnnotations=function(){return this.getRelated("annotation")};q=i.AnnotationType=function(b,c){z.call(this,b,c);this.elementType="annotationType"};v(q,z);q.prototype.getAnnotations=function(){return this.getRelated("annotation")};q=i.Annotation=function(b,c){z.call(this,b,c);this.elementType= +"annotation";this.begin=new x;this.end=new x;this.tag=new P(c,[]);this.playing=false;var d=this;this.on("click",function(){d.getMedia().setCurrentTime(d.begin)})};v(q,z);q.prototype.setBegin=function(b){this.begin.setMilliseconds(Math.max(0,b));this.trigger("change-begin");this.endb});if(c.length)return c[0]};q.prototype.getMediaAtTime=function(b){var c=this.getAnnotationAtTime(b);if(typeof c!=="undefined")return c.getMedia()};var p=i.Source=function(b){z.call(this,false,this);this.status=o;this.elementType="source";if(typeof b!=="undefined"){var c=this;a._(b).forEach(function(d,h){c[h]=d});this.callbackQueue=[];this.contents={};this.get()}}; +v(p,z);p.prototype.addList=function(b,c){if(typeof this.contents[b]==="undefined")this.contents[b]=new r(this.directory);this.contents[b].addElements(c)};p.prototype.getList=function(b,c){if(c=typeof c!=="undefined"&&c)return this.directory.getGlobalList().filter(function(d){return d.elementType===b});else{if(typeof this.contents[b]==="undefined")this.contents[b]=new r(this.directory);return this.contents[b]}};p.prototype.forEach=function(b){var c=this;a._(this.contents).forEach(function(d,h){b.call(c, +d,h)})};p.prototype.getElement=function(b){return this.directory.getElement(b)};p.prototype.get=function(){this.status=E;this.handleCallbacks()};p.prototype.deferCallback=function(b){var c=this;a._.defer(function(){b.call(c)})};p.prototype.handleCallbacks=function(){for(this.status=I;this.callbackQueue.length;)this.deferCallback(this.callbackQueue.splice(0,1)[0])};p.prototype.onLoad=function(b){this.status===I?this.deferCallback(b):this.callbackQueue.push(b)};p.prototype.serialize=function(){return this.serializer.serialize(this)}; +p.prototype.deSerialize=function(b){this.serializer.deSerialize(b,this)};p.prototype.getAnnotations=function(b){b=typeof b!=="undefined"&&b;return this.getList("annotation",b)};p.prototype.getMedias=function(b){b=typeof b!=="undefined"&&b;return this.getList("media",b)};p.prototype.getTags=function(b){b=typeof b!=="undefined"&&b;return this.getList("tag",b)};p.prototype.getMashups=function(b){b=typeof b!=="undefined"&&b;return this.getList("mashup",b)};p.prototype.getAnnotationTypes=function(b){b= +typeof b!=="undefined"&&b;return this.getList("annotationType",b)};p.prototype.getAnnotationsByTypeTitle=function(b,c){c=typeof c!=="undefined"&&c;var d=new r(this.directory),h=this.getAnnotationTypes(c).searchByTitle(b);h.forEach(function(m){d.addElements(m.getAnnotations(c))});return d};p.prototype.getDuration=function(){var b=this.currentMedia;if(typeof b!=="undefined")return this.currentMedia.duration};p.prototype.getCurrentMedia=function(b){if(typeof this.currentMedia==="undefined")if(b.is_mashup){var c= +this.getMashups();if(c.length)this.currentMedia=c[0]}else{var d=this.getMedias();if(d.length)this.currentMedia=d[0]}return this.currentMedia};p.prototype.merge=function(b){var c=this;b.forEach(function(d,h){c.getList(h).addElements(d)})};var y=i.RemoteSource=function(b){p.call(this,b)};v(y,p);y.prototype.get=function(){this.status=E;var b=this,c=this.url_params||{},d=O(this.url)?"json":"jsonp";c.format=d;a.jQuery.ajax({url:this.url,dataType:d,data:c,traditional:true,success:function(h){b.deSerialize(h); +b.handleCallbacks()}})};v=i.Directory=function(){this.remoteSources={};this.elements={}};v.prototype.remoteSource=function(b){if(typeof b!=="object"||typeof b.url==="undefined")throw"Error : Directory.remoteSource(configuration): configuration.url is undefined";var c=a._({directory:this}).extend(b);c.url_params=c.url_params||{};var d=c.url+"?"+a.jQuery.param(c.url_params);if(typeof this.remoteSources[d]==="undefined")this.remoteSources[d]=new y(c);return this.remoteSources[d]};v.prototype.newLocalSource= +function(b){var c=a._({directory:this}).extend(b),d=new p(c);return d};v.prototype.getElement=function(b){return this.elements[b]};v.prototype.addElement=function(b){this.elements[b.id]=b};v.prototype.getGlobalList=function(){var b=new r(this);b.addIds(a._(this.elements).keys());return b};return i}(IriSP); +IriSP.htmlPlayer=function(a,e,g){var k=g||{};g=k.video||a.video;if(typeof k.url_transform==="function")g=k.url_transform(g);var l=IriSP.jQuery("