";
- //alert(this.color+" : "+DEC_HEXA_COLOR(this.color));
+}
+__IriSP.Ligne.prototype.numAnnotation = function (annotationCible){
+ for (var i=0; i < this.annotations.length; ++i){
+ if(annotationCible == this.annotations[i]){
+ return i;
+ }
+ }
+}
+__IriSP.Ligne.prototype.checkTime = function(time){
+ var annotationTempo = -1;
+ //__IriSP.trace("__IriSP.Ligne.prototype.checkTimeLigne",time);
+
+ for (var i=0; i < this.annotations.length; ++i){
+ var annotationTempo = this.annotations[i];
+ if (time>annotationTempo.begin/1000 && time 1.4
+ //__IriSP.jQuery("#Ldt-SaTitle").delay(100).text(annotationTempo.title);
+ //__IriSP.jQuery("#Ldt-SaDescription").delay(100).text(annotationTempo.description);
+ //__IriSP.jQuery('#Ldt-ShowAnnotation').delay(100).slideDown();
+ //__IriSP.trace("__IriSP.Ligne.prototype.checkTimeLigne",annotationTempo.title+" "+annotationTempo.description );
+ __IriSP.jQuery("#Ldt-SaTitle").text(annotationTempo.title);
+ __IriSP.jQuery("#Ldt-SaDescription").text(annotationTempo.description);
+
+ __IriSP.jQuery("#Ldt-SaDescription").text(annotationTempo.description);
+ __IriSP.jQuery("#Ldt-SaKeywordText").html("Mots clefs : "+annotationTempo.htmlTags);
+
+ //__IriSP.jQuery('#Ldt-ShowAnnotation').slideDown();
+ var startPourcent = annotationTempo.timeToPourcent((annotationTempo.begin*1+(annotationTempo.end*1-annotationTempo.begin*1)/2),annotationTempo.duration*1);
+ __IriSP.jQuery("#Ldt-Show-Arrow").animate({left:startPourcent+'%'},1000);
+ //alert(startPourcent);
+ var tempolinkurl = __IriSP.ignoreTimeFragment(window.location.href)+"#t="+(this.annotations[i].begin/1000);
+ }
+ break;
+ }
- $toolTipTemplate = "
"
- +"
"+stripHtml(this.title)+"
"
- +"
"+this.begin+" : "+this.end+"
"
- +"
"+stripHtml(this.description)+"
"
- +"
";
-
-
- $jIRI("
"+$AnnotationTemplate+"
").appendTo("#Ldt-Annotations");
- $jIRI("#"+this.id).tooltip({ effect: 'slide'});
-
-
- $jIRI("#"+this.id).fadeTo(0,0.3);
- $jIRI("#"+this.id).mouseover(function() {
- $jIRI("#"+this.id).animate({opacity: 0.6}, 5)
- }).mouseout(function(){
- $jIRI("#"+this.id).animate({opacity: 0.3}, 5)
- });
- //trace(" ### ","ADD ANOTATION : "+this.begin+" "+this.end+" "+stripHtml(this.title)+" | "+startPourcent+" | "+endPourcent+" | duration = "+this.duration);
-
- }
-
- function drawTagsAnnotation(){
- KeywordPattern = ' '+' ';
-
- //trace(" !? Tags : ",this.tags);
-
- if (this.tags!=undefined){
- for (var i = 0; i < this.tags.length; ++i){
-
- //this.htmlTags += ' '+MyTags.getTitle(this.tags[i]['id-ref'])+' '+" , ";
- this.htmlTags += ' '+MyTags.getTitle(this.tags[i]['id-ref'])+' '+" , ";
-
- }
+ }
+ // si il y en a pas : retractation du volet
+ if( annotationTempo == -1){
+ if(annotationTempo!=this.annotationOldRead){
+ __IriSP.trace("Check : ","pas d'annotation ici ");
+ __IriSP.jQuery('#Ldt-ShowAnnotation').slideUp();
+ this.annotationOldRead = annotationTempo;
}
}
- function tootTipAnnotation() {
- // 1 chercher le div correspondant
- // 2 y mettre les information
- return this.color + ' ' + this.type + ' apple';
- }
- function onRollOverAnnotation(){
- this.tootTip();
- }
- function timeToPourcent(time,timetotal){
- return (parseInt(Math.round(time/timetotal*100)));
- }
+}
-
+/* CLASS Annotation */
-/* ----------------------------------------------------------------
- ----------------------------------------------------------------
- CLASSE Tags */
-function Tags (object){
+__IriSP.Annotation = function (){
+ var id = null;
+ var begin = null;
+ var end = null;
+ var media = null;
+ var description = null;
+ var title = null;
+ var color = null;
+ var tags = null;
+ __IriSP.trace("annotation ","réussi")
+}
+__IriSP.Annotation = function(id,begin,end,media,title,description,color,tags,duration){
+ this.id = id;
+ this.begin = begin;
+ this.end = end;
+ this.media = media;
+ this.description = description;
+ this.title = title;
+ this.color = color;
+ this.tags = tags;
+ this.htmlTags = "";
+ this.duration = duration;
+ // draw it
+ this.draw();
+ this.drawTags();
+ //
+ __IriSP.trace("Annotation created : ",id);
+}
+__IriSP.Annotation.prototype.draw = function(){
+ //alert (this.duration);
+ var startPourcent = this.timeToPourcent(this.begin,this.duration); // temps du media
+ var endPourcent = this.timeToPourcent(this.end,this.duration)-startPourcent;
+ var titleForDiv = this.title.substr(0,55);
+
+ __IriSP.jQueryAnnotationTemplate = " ";
+ //alert(this.color+" : "+DEC_HEXA_COLOR(this.color));
+
+ __IriSP.jQuerytoolTipTemplate = "
"
+ +"
"+__IriSP.stripHtml(this.title)+"
"
+ +"
"+this.begin+" : "+this.end+"
"
+ +"
"+__IriSP.stripHtml(this.description)+"
"
+ +"
";
+
+
+ __IriSP.jQuery("
"+__IriSP.jQueryAnnotationTemplate+"
").appendTo("#Ldt-Annotations");
+ // TOOLTIP BUG !
+
+ __IriSP.jQuery("#"+this.id).tooltip({ effect: 'slide'});
+
+
+ __IriSP.jQuery("#"+this.id).fadeTo(0,0.3);
+ __IriSP.jQuery("#"+this.id).mouseover(function() {
+ __IriSP.jQuery("#"+this.id).animate({opacity: 0.6}, 5)
+ }).mouseout(function(){
+ __IriSP.jQuery("#"+this.id).animate({opacity: 0.3}, 5)
+ });
+ __IriSP.trace("__IriSP.Annotation.prototype.draw","ADD ANOTATION : "+this.begin+" "+this.end+" "+__IriSP.stripHtml(this.title)+" | "+startPourcent+" | "+endPourcent+" | duration = "+this.duration);
+
+}
+__IriSP.Annotation.prototype.drawTags = function(){
+ var KeywordPattern = ' '+' ';
+
+ //__IriSP.trace(" !? Tags : ",this.tags);
+
+ if (this.tags!=undefined){
+ for (var i = 0; i < this.tags.length; ++i){
+
+ //this.htmlTags += ' '+MyTags.getTitle(this.tags[i]['id-ref'])+' '+" , ";
+ this.htmlTags += ' '+__IriSP.MyTags.getTitle(this.tags[i]['id-ref'])+' '+" , ";
+
+ }
+ }
+}
+__IriSP.Annotation.prototype.tootTipAnnotation = function() {
+ // 1 chercher le div correspondant
+ // 2 y mettre les information
+ return this.color + ' ' + this.type + ' apple';
+}
+__IriSP.Annotation.prototype.onRollOverAnnotation = function (){
+ this.tootTip();
+}
+__IriSP.Annotation.prototype.timeToPourcent = function(time,timetotal){
+ return (parseInt(Math.round(time/timetotal*100)));
+}
+
+
+/* CLASS Tags */
+
+__IriSP.Tags = function(object){
this.myTags = object;
this.htmlTags = null;
this.weigthMax = 0;
//this.mySegments = new array();
}
-Tags.prototype.addAnnotation = function (annotation){
+__IriSP.Tags.prototype.addAnnotation = function (annotation){
for (var i = 0; i < this.myTags.length; ++i){
this.myTags[i].mySegments = new Array();
if (annotation.tags!=null){
@@ -857,7 +921,7 @@
this.myTags[i].mySegments.push([annotation.begin,annotation.end,annotation.id]);
var weigthTempo = this.myTags[i].mySegments.length
var tempo = this.myTags[i].mySegments[weigthTempo-1];
- trace (" ADD Tags : "," "+this.myTags[i]['meta']['dc:title']+" "+this.myTags[i]['id']+" : "+tempo[0]+" - "+tempo[1]);
+ //__IriSP.trace ("__IriSP.Tags.prototype.addAnnotation "," "+this.myTags[i]['meta']['dc:title']+" "+this.myTags[i]['id']+" : "+tempo[0]+" - "+tempo[1]);
if (this.weigthMax < weigthTempo ){
this.weigthMax = weigthTempo;
@@ -867,7 +931,7 @@
}
}
}
-Tags.prototype.getTitle = function (id){
+__IriSP.Tags.prototype.getTitle = function (id){
for (var i = 0; i < this.myTags.length; ++i){
if(this.myTags[i]['id']==id){
return(this.myTags[i]['meta']['dc:title']);
@@ -875,11 +939,11 @@
}
}
-Tags.prototype.draw = function (){
+__IriSP.Tags.prototype.draw = function (){
- trace("########### TAG DRAW "," WELL START " );
+ __IriSP.trace("__IriSP.Tags.prototype.draw"," !!! WELL START " );
for (var i = 0; i < this.myTags.length; ++i){
- //trace(" ADD Tags : ",this.myTags[i]['id']);
+ __IriSP.trace("__IriSP.Tags.prototype.draw"," ADD Tags : "+this.myTags[i]['id']);
if(this.myTags[i]['id']!=null){
this.htmlTags += ' this.myTags[i].mySegments[j][0]){
@@ -929,28 +996,32 @@
//
// -------------------------------------------------
- leftPourCent = timeToPourcent((timeStartOffsetA*1+(timeStartOffsetB-timeStartOffsetA)/2),MyLdt.duration);
- WidthPourCent = timeToPourcent((timeEndOffsetA*1+(timeEndOffsetB-timeEndOffsetA)/2),MyLdt.duration)-startPourcent;
- $jIRI("#Ldt-Show-Tags").css('left',leftPourCent+'%');
- $jIRI("#Ldt-Show-Tags").css('width',WidthPourCent+'%');
+ leftPourCent = __IriSP.timeToPourcent((timeStartOffsetA*1+(timeStartOffsetB-timeStartOffsetA)/2),__IriSP.MyLdt.duration);
+ WidthPourCent = __IriSP.timeToPourcent((timeEndOffsetA*1+(timeEndOffsetB-timeEndOffsetA)/2),__IriSP.MyLdt.duration)-leftPourCent;
+ //WidthPourCent = timeToPourcent((timeEndOffsetA*1+(timeEndOffsetB-timeEndOffsetA)/2),MyLdt.duration)-startPourcent;
+ __IriSP.jQuery("#Ldt-Show-Tags").css('left',leftPourCent+'%');
+ __IriSP.jQuery("#Ldt-Show-Tags").css('width',WidthPourCent+'%');
// like arrow script
}
+
+/* CLASS TRACE */
-
-/* ----------------------------------------------------------------
- ----------------------------------------------------------------
- Class tracess */
+__IriSP.traceNum=0;
+__IriSP.trace = function(msg,value){
+
+ if(__IriSP.config.gui.debug===true){
+ __IriSP.traceNum += 1;
+ __IriSP.jQuery("
"+__IriSP.traceNum+" - "+msg+" : "+value+"
").appendTo("#Ldt-output");
+ }
+
+}
- function Tracer (){
-
- }
- function addTrace(){
-
- }
+
+
\ No newline at end of file
diff -r a6c4ea119b80 -r 28d21b2123ba client/player/src/js/LdtPlayer.min.js
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/client/player/src/js/LdtPlayer.min.js Tue Sep 14 13:15:28 2010 +0200
@@ -0,0 +1,65 @@
+/*
+ *
+ * Copyright 2010 Institut de recherche et d’innovation
+ * contributor(s) : Samuel Huron
+ *
+ * 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.
+*/
+
+if(window.__IriSP===undefined)var __IriSP={};__IriSP.config={metadata:{format:"cinelab",src:"http://exp.iri.centrepompidou.fr/franceculture/franceculture/ldt/cljson/id/ef4dcc2e-8d3b-11df-8a24-00145ea4a2be",load:"jsonp"},gui:{width:650,height:0,mode:"radio",container:"LdtPlayer",debug:false,css:"../src/css/LdtPlayer.css"},player:{type:"jwplayer",src:"../res/swf/player.swf"},module:null};
+__IriSP.lib={jQuery:"http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js",jQueryUI:"http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/jquery-ui.min.js",jQueryToolTip:"http://cdn.jquerytools.org/1.2.4/all/jquery.tools.min.js",swfObject:"http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"};__IriSP.LdtShareTool="\n\n\n\n\n";
+__IriSP.MyLdt=null;__IriSP.MyTags=null;__IriSP.MyApiPlayer=null;__IriSP.player=null;__IriSP.Durration=null;__IriSP.playerLdtWidth=null;__IriSP.playerLdtHeight=null;
+__IriSP.init=function(a){function b(){var f=document.createElement("script");f.setAttribute("type","text/javascript");f.setAttribute("src",__IriSP.lib.jQueryToolTip);f.onload=c;f.onreadystatechange=function(){if(this.readyState=="complete"||this.readyState=="loaded")c("jquery.tools.min.js loded")};var i=document.createElement("script");i.setAttribute("type","text/javascript");i.setAttribute("src",__IriSP.lib.swfObject);i.onload=c;i.onreadystatechange=function(){if(this.readyState=="complete"||this.readyState==
+"loaded")c("swfobject.js loded")};var j=document.createElement("script");j.setAttribute("type","text/javascript");j.setAttribute("src","http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/jquery-ui.min.js");j.onload=c;j.onreadystatechange=function(){if(this.readyState=="complete"||this.readyState=="loaded")c("jquery-ui.min.js loded")};(document.getElementsByTagName("head")[0]||document.documentElement).appendChild(f);(document.getElementsByTagName("head")[0]||document.documentElement).appendChild(j);
+(document.getElementsByTagName("head")[0]||document.documentElement).appendChild(i)}function c(){g+=1;g===3&&d()}function d(){__IriSP.jQuery=window.jQuery.noConflict(true);__IriSP.jQuery(document).ready(function(f){var i=__IriSP.jQuery("",{rel:"stylesheet",type:"text/css",href:"../res/css/jq-css/themes/base/jquery.ui.all.css","class":"dynamic_css"}),j=__IriSP.jQuery("",{rel:"stylesheet",type:"text/css",href:__IriSP.config.gui.css,"class":"dynamic_css"});i.appendTo("head");j.appendTo("head");
+f.browser.msie&&f(".dynamic_css").clone().appendTo("head");__IriSP.createMyHtml();__IriSP.jQuery.ajax({dataType:"jsonp",url:h,success:function(e){__IriSP.trace("ajax","success");if(e==="")alert("ERREUR DE CHARGEMENT JSON");else{new __IriSP.Media(e.medias[0].id,e.medias[0].href,e.medias[0].meta["dc:duration"],e.medias[0]["dc:title"],e.medias[0]["dc:description"]);__IriSP.trace("__IriSP.MyApiPlayer",__IriSP.config.gui.width+" "+__IriSP.config.gui.height+" "+e.medias[0].href+" "+e.medias[0].meta["dc:duration"]+
+" "+e.medias[0].meta.item.value);__IriSP.MyApiPlayer=new __IriSP.APIplayer(__IriSP.config.gui.width,__IriSP.config.gui.height,e.medias[0].href,e.medias[0].meta["dc:duration"],e.medias[0].meta.item.value);__IriSP.trace("__IriSP.init.main","__IriSP.Ligne");__IriSP.MyLdt=new __IriSP.Ligne(e["annotation-types"][0].id,e["annotation-types"][0]["dc:title"],e["annotation-types"][0]["dc:description"],e.medias[0].meta["dc:duration"]);__IriSP.trace("__IriSP.init.main","__IriSP.Tags");__IriSP.MyTags=new __IriSP.Tags(e.tags);
+__IriSP.jQuery.each(e.annotations,function(l,k){k.meta["id-ref"]==__IriSP.MyLdt.id&&__IriSP.MyLdt.addAnnotation(k.id,k.begin,k.end,k.media,k.content.title,k.content.description,k.content.color,k.tags)});__IriSP.jQuery.each(e.lists,function(){__IriSP.trace("lists","")});__IriSP.jQuery.each(e.views,function(){__IriSP.trace("views","")})}},error:function(e){alert("ERROR : "+e)}})})}__IriSP.config=a;var h=__IriSP.config.metadata.src;__IriSP.jQuery=null;if(window.jQuery===undefined||window.jQuery.fn.jquery!==
+"1.4.2"){a=document.createElement("script");a.setAttribute("type","text/javascript");a.setAttribute("src",__IriSP.lib.jQuery);a.onload=b;a.onreadystatechange=function(){if(this.readyState=="complete"||this.readyState=="loaded")b()};(document.getElementsByTagName("head")[0]||document.documentElement).appendChild(a)}else{__IriSP.jQuery=window.jQuery;b()}var g=0};
+__IriSP.createMyHtml=function(){var a=__IriSP.config.gui.width;__IriSP.jQuery("
0 commentaire
-Votre commentaire
- -