diff -r 5dd4f79c752e -r 0238d2e3a15e sbin/build/LdtPlayer-release.js
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sbin/build/LdtPlayer-release.js Thu Sep 08 13:54:17 2011 +0200
@@ -0,0 +1,1444 @@
+/*
+ *
+ * Copyright 2010 Institut de recherche et d'innovation
+ * contributor(s) : Samuel Huron
+ * Use Silvia Pfeiffer 's javascript mediafragment implementation
+ *
+ * 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 && window.__IriSP === undefined ) {
+ var IriSP ={};
+ var __IriSP = IriSP; /* for backward compatibility */
+}
+
+
+/* CLASS TRACE */
+
+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");
+ }
+
+}
+
+// Player Configuration
+IriSP.config = undefined;
+IriSP.configDefault = {
+ metadata:{
+ format:'cinelab',
+ src:'',
+ 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',
+ params:{
+ allowfullscreen:"true",
+ allowscriptaccess:"always",
+ wmode:"transparent"
+ },
+ flashvars:{
+ streamer:"streamer",
+ file:"file",
+ live:"true",
+ autostart:"false",
+ controlbar:"none",
+ playerready:"__IriSP.playerReady"
+ },
+ attributes:{
+ id:"Ldtplayer1",
+ name:"Ldtplayer1"
+ }
+ },
+ 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",
+ cssjQueryUI:"http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/themes/base/jquery-ui.css"
+ };
+
+// Player Variable
+IriSP.LdtShareTool = ""+
+"\n"+
+"\n"+
+"\n"+
+"\n";
+
+// Official instance - to refactor ?
+IriSP.MyLdt = null;
+IriSP.MyTags = null;
+IriSP.MyApiPlayer = null;
+IriSP.player = null;
+
+// genral var (old code) - to refactor
+IriSP.Durration = null;
+IriSP.playerLdtWidth = null;
+IriSP.playerLdtHeight = null;
+
+
+
+
+
+IriSP.init = function (config){
+
+
+ if(config === null){
+
+ IriSP.config = IriSP.configDefault;
+
+ } else {
+
+ IriSP.config = config;
+
+
+
+ if (IriSP.config.player.params == null){
+ IriSP.config.player.params = IriSP.configDefault.player.params;}
+
+ if (IriSP.config.player.flashvars == null){
+ IriSP.config.player.flashvars = IriSP.configDefault.player.flashvars;}
+ if (IriSP.config.player.attributes == null){
+ IriSP.config.player.attributes = IriSP.configDefault.player.attributes;}
+ }
+
+ var metadataSrc = IriSP.config.metadata.src;
+ var guiContainer = IriSP.config.gui.container;
+ var guiMode = IriSP.config.gui.mode;
+ var guiLdtShareTool = IriSP.LdtShareTool;
+ // Localize jQuery variable
+ IriSP.jQuery = null;
+
+ /******** Load jQuery if not present *********/
+ if (window.jQuery === undefined || window.jQuery.fn.jquery !== '1.4.2') {
+ var script_tag = document.createElement('script');
+ script_tag.setAttribute("type","text/javascript");
+ script_tag.setAttribute("src",IriSP.lib.jQuery);
+ //"http://cdn.jquerytools.org/1.2.4/full/jquery.tools.min.js");
+ script_tag.onload = scriptLibHandler;
+ script_tag.onreadystatechange = function () { // Same thing but for IE
+ if (this.readyState == 'complete' || this.readyState == 'loaded') {
+ scriptLibHandler();
+
+ }
+ };
+ // Try to find the head, otherwise default to the documentElement
+ (document.getElementsByTagName("head")[0] || document.documentElement).appendChild(script_tag);
+ } else {
+ // The jQuery version on the window is the one we want to use
+ IriSP.jQuery = window.jQuery;
+ scriptLibHandler();
+ }
+
+ /******** Called once jQuery has loaded ******/
+ function scriptLibHandler() {
+
+ var script_jqUi_tooltip = document.createElement('script');
+ script_jqUi_tooltip.setAttribute("type","text/javascript");
+ script_jqUi_tooltip.setAttribute("src",IriSP.lib.jQueryToolTip);
+ script_jqUi_tooltip.onload = scriptLoadHandler;
+ script_jqUi_tooltip.onreadystatechange = function () { // Same thing but for IE
+ if (this.readyState == 'complete' || this.readyState == 'loaded') {
+ scriptLoadHandler("jquery.tools.min.js loded");
+ }
+ };
+
+ var script_swfObj = document.createElement('script');
+ script_swfObj.setAttribute("type","text/javascript");
+ script_swfObj.setAttribute("src",IriSP.lib.swfObject);
+ script_swfObj.onload = scriptLoadHandler;
+ script_swfObj.onreadystatechange = function () { // Same thing but for IE
+ if (this.readyState == 'complete' || this.readyState == 'loaded') {
+ scriptLoadHandler("swfobject.js loded");
+ }
+ };
+
+ var script_jqUi = document.createElement('script');
+ script_jqUi.setAttribute("type","text/javascript");
+ script_jqUi.setAttribute("src",IriSP.lib.jQueryUI);
+ script_jqUi.onload = scriptLoadHandler;
+ script_jqUi.onreadystatechange = function () { // Same thing but for IE
+ if (this.readyState == 'complete' || this.readyState == 'loaded') {
+ scriptLoadHandler("jquery-ui.min.js loded");
+ }
+ };
+
+
+
+
+ (document.getElementsByTagName("head")[0] || document.documentElement).appendChild(script_jqUi_tooltip);
+ (document.getElementsByTagName("head")[0] || document.documentElement).appendChild(script_jqUi);
+ (document.getElementsByTagName("head")[0] || document.documentElement).appendChild(script_swfObj);
+
+
+ };
+
+ /******** Called once all lib are loaded ******/
+ var loadLib = 0;
+ function scriptLoadHandler(Mylib) {
+ //alert(Mylib);
+ loadLib +=1;
+ if(loadLib===3){
+ main();
+ }else {
+ // __IriSP.jQuery('#'+__IriSP.config.gui.container).html("Loading library ...");
+ }
+ };
+
+ /******** Our main function ********/
+ function main() {
+
+
+ // Make __IriSP.jQuery and restore window.jQuery
+ IriSP.jQuery = window.jQuery.noConflict(true);
+ // Call MY Jquery
+ IriSP.jQuery(document).ready(function($) {
+
+ /******* Load CSS *******/
+ var css_link_jquery = IriSP.jQuery("", {
+ rel: "stylesheet",
+ type: "text/css",
+ href: IriSP.lib.cssjQueryUI,
+ 'class': "dynamic_css"
+ });
+ var css_link_custom = IriSP.jQuery("", {
+ rel: "stylesheet",
+ type: "text/css",
+ href: IriSP.config.gui.css,
+ 'class': "dynamic_css"
+ });
+
+ css_link_jquery.appendTo('head');
+ css_link_custom.appendTo('head');
+
+ // to see dynamicly loaded css on IE
+ if ($.browser.msie) {
+ $('.dynamic_css').clone().appendTo('head');
+ }
+
+ //__IriSP.trace("main","ready createMyHtml");
+
+ IriSP.createMyHtml();
+ //__IriSP.trace("main","end createMyHtml");
+
+ /******* Load Metadata *******/
+
+ IriSP.jQuery.ajax({
+ dataType: IriSP.config.metadata.load,
+ url:metadataSrc,
+ success : function(json){
+
+ IriSP.trace("ajax","success");
+
+ // START PARSING -----------------------
+ if(json === ""){
+ alert("ERREUR DE CHARGEMENT JSON");
+ } else {
+
+
+ // # CREATE MEDIA //
+ // # JUSTE ONE PLAYER FOR THE MOMENT //
+ //__IriSP.jQuery("").appendTo("#output");
+ var MyMedia = new __IriSP.Media(
+ json.medias[0].id,
+ json.medias[0].href,
+ json.medias[0]['meta']['dc:duration'],
+ json.medias[0]['dc:title'],
+ json.medias[0]['dc:description']);
+
+ IriSP.trace("__IriSP.MyApiPlayer",
+ IriSP.config.gui.width+" "
+ + IriSP.config.gui.height + " "
+ + json.medias[0].href + " "
+ + json.medias[0]['meta']['dc:duration'] + " "
+ + json.medias[0]['meta']['item']['value']);
+
+ // Create APIplayer
+ IriSP.MyApiPlayer = new __IriSP.APIplayer(
+ IriSP.config.gui.width,
+ IriSP.config.gui.height,
+ json.medias[0].href,
+ json.medias[0]['meta']['dc:duration'],
+ json.medias[0]['meta']['item']['value']);
+
+ // # CREATE THE FIRST LINE //
+ IriSP.trace("__IriSP.init.main","__IriSP.Ligne");
+ IriSP.MyLdt = new __IriSP.Ligne (
+ json['annotation-types'][0].id,
+ json['annotation-types'][0]['dc:title'],
+ json['annotation-types'][0]['dc:description'],
+ json.medias[0]['meta']['dc:duration']);
+
+ // CREATE THE TAG CLOUD //
+ IriSP.trace("__IriSP.init.main","__IriSP.Tags");
+ IriSP.MyTags = new __IriSP.Tags (json.tags);
+
+ // CREATE THE ANNOTATIONS //
+ // JUSTE FOR THE FIRST TYPE //
+ IriSP.jQuery.each(json.annotations, function(i,item) {
+ if (item.meta['id-ref'] == IriSP.MyLdt.id) {
+ //__IriSP.trace("__IriSP.init.main","__IriSP.MyLdt.addAnnotation");
+ IriSP.MyLdt.addAnnotation(
+ item.id,
+ item.begin,
+ item.end,
+ item.media,
+ item.content.title,
+ item.content.description,
+ item.content.color,
+ item.tags);
+ }
+ //MyTags.addAnnotation(item);
+ });
+ IriSP.jQuery.each(json.lists, function(i,item) {
+ IriSP.trace("lists","");
+ });
+ IriSP.jQuery.each(json.views, function(i,item) {
+ IriSP.trace("views","");
+ });
+ }
+ // END PARSING ----------------------- //
+
+
+ },error : function(data){
+ alert("ERROR : "+data);
+ }
+ });
+
+
+ });
+ }
+
+};
+
+
+IriSP.createMyHtml = function(){
+ var width = IriSP.config.gui.width;
+ var height = IriSP.config.gui.height;
+ var heightS = IriSP.config.gui.height-20;
+
+ // AUDIO */
+ // PB dans le html : ;
+ IriSP.trace("__IriSP.createMyHtml",IriSP.config.gui.container);
+
+
+
+ if(IriSP.config.gui.mode=="radio"){
+
+ IriSP.jQuery("#"+IriSP.config.gui.container).before(
+ "