web/res/metadataplayer/src/js/LdtPlayer.old.js
author Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
Wed, 27 Apr 2011 18:54:31 +0200
changeset 133 9578d3ddce17
parent 100 32898b2c8e9c
permissions -rwxr-xr-x
correct line endings + other small errors
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
     1
/* 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
     2
 * 	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
     3
 *	Copyright 2010 Institut de recherche et d'innovation 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
     4
 *	contributor(s) : Samuel Huron 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
     5
 *	 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
     6
 *	contact@iri.centrepompidou.fr
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
     7
 *	http://www.iri.centrepompidou.fr 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
     8
 *	 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
     9
 *	This software is a computer program whose purpose is to show and add annotations on a video .
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    10
 *	This software is governed by the CeCILL-C license under French law and
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    11
 *	abiding by the rules of distribution of free software. You can  use, 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    12
 *	modify and/ or redistribute the software under the terms of the CeCILL-C
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    13
 *	license as circulated by CEA, CNRS and INRIA at the following URL
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    14
 *	"http://www.cecill.info". 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    15
 *	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    16
 *	The fact that you are presently reading this means that you have had
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    17
 *	knowledge of the CeCILL-C license and that you accept its terms.
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    18
*/
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    19
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    20
if(window.__IriSP === undefined ){ var __IriSP={};}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    21
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    22
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    23
	// vimeo 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    24
	/*
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    25
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    26
		 var flashvars = {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    27
	        clip_id: video_id,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    28
	        show_portrait: 1,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    29
	        show_byline: 1,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    30
	        show_title: 1,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    31
			js_api: 1, // required in order to use the Javascript API
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    32
			js_onLoad: 'vimeo_player_loaded', // moogaloop will call this JS function when it's done loading (optional)
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    33
			js_swf_id: 'moogaloop' // this will be passed into all event methods so you can keep track of multiple moogaloops (optional)
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    34
	    };
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    35
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    36
		var flashvars = {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    37
	        clip_id: video_id,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    38
	        show_portrait: 1,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    39
	        show_byline: 1,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    40
	        show_title: 1,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    41
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    42
	    };
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    43
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    44
	*/
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    45
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    46
// Player Configuration 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    47
__IriSP.config = undefined;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    48
__IriSP.configDefault = {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    49
		metadata:{
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    50
			format:'cinelab',
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    51
			src:'http://exp.iri.centrepompidou.fr/franceculture/franceculture/ldt/cljson/id/ef4dcc2e-8d3b-11df-8a24-00145ea4a2be',
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    52
			load:'jsonp'
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    53
		},
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    54
		gui:{
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    55
			width:650,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    56
			height:0,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    57
			mode:'radio',
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    58
			container:'LdtPlayer',
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    59
			debug:false, 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    60
			css:'../src/css/LdtPlayer.css'
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    61
		},
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    62
		player:{
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    63
			type:'jwplayer',
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    64
			src:'../res/swf/player.swf',
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    65
			params:{
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    66
				allowfullscreen:"true", 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    67
				allowscriptaccess:"always",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    68
				wmode:"transparent"
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    69
			},
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    70
			flashvars:{
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    71
				streamer:"streamer",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    72
				file:"file", 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    73
				live:"true",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    74
				autostart:"true",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    75
				controlbar:"none",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    76
				playerready:"__IriSP.playerReady",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    77
				// Vimeo
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    78
				js_api: 1,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    79
				js_onLoad:"__IriSP.playerReady",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    80
				js_swf_id:"Ldtplayer1",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    81
				show_title: 0,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    82
				clip_id: "video_id",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    83
				show_portrait: 1,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    84
				show_byline: 0
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    85
				
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    86
			},
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    87
			attributes:{
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    88
				id:"Ldtplayer1",  
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    89
				name:"Ldtplayer1"
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    90
			}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    91
		},
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    92
		module:null
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    93
	};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    94
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    95
__IriSP.lib = {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    96
			jQuery:"http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    97
			jQueryUI:"http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/jquery-ui.min.js",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    98
			jQueryToolTip:"http://cdn.jquerytools.org/1.2.4/all/jquery.tools.min.js",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
    99
			swfObject:"http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   100
			cssjQueryUI:"http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/themes/base/jquery-ui.css"
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   101
		};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   102
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   103
// Player Variable
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   104
__IriSP.LdtShareTool = ""+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   105
"\n<a onclick=\"__IriSP.MyApiPlayer.share('delicious');\" title='partager avec delicious'><span class='share shareDelicious'>&nbsp;</span></a>"+		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   106
"\n<a onclick=\"__IriSP.MyApiPlayer.share('facebook');\" title='partager avec facebook'> <span class='share shareFacebook'>&nbsp;</span></a>"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   107
"\n<a onclick=\"__IriSP.MyApiPlayer.share('twitter');\" title='partager avec twitter'>  <span class='share shareTwitter'>&nbsp;</span></a>"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   108
"\n<a onclick=\"__IriSP.MyApiPlayer.share('myspace');\" title='partager avec Myspace'>  <span class='share shareMySpace'>&nbsp;</span></a>";
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   109
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   110
// Official instance - to refactor ?
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   111
__IriSP.MyLdt 		= null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   112
__IriSP.MyTags 		= null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   113
__IriSP.MyApiPlayer	= null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   114
__IriSP.player		= null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   115
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   116
// genral var (old code) - to refactor 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   117
__IriSP.Durration		= null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   118
__IriSP.playerLdtWidth	= null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   119
__IriSP.playerLdtHeight	= null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   120
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   121
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   122
 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   123
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   124
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   125
__IriSP.init = function (config){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   126
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   127
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   128
		if(config === null){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   129
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   130
			__IriSP.config 			 = __IriSP.configDefault;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   131
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   132
		} else {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   133
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   134
			__IriSP.config 			 = config;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   135
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   136
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   137
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   138
			if (__IriSP.config.player.params == null){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   139
			__IriSP.config.player.params = __IriSP.configDefault.player.params;}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   140
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   141
			if (__IriSP.config.player.flashvars == null){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   142
			__IriSP.config.player.flashvars = __IriSP.configDefault.player.flashvars;}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   143
			if (__IriSP.config.player.attributes == null){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   144
			__IriSP.config.player.attributes = __IriSP.configDefault.player.attributes;}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   145
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   146
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   147
		var metadataSrc 		 = __IriSP.config.metadata.src;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   148
		var guiContainer		 = __IriSP.config.gui.container;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   149
		var guiMode				 = __IriSP.config.gui.mode;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   150
		var guiLdtShareTool		 = __IriSP.LdtShareTool;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   151
		// Localize jQuery variable
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   152
		__IriSP.jQuery = null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   153
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   154
		/******** Load jQuery if not present *********/
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   155
		if (window.jQuery === undefined || window.jQuery.fn.jquery !== '1.4.2') {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   156
			var script_tag = document.createElement('script');
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   157
			script_tag.setAttribute("type","text/javascript");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   158
			script_tag.setAttribute("src",__IriSP.lib.jQuery);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   159
				//"http://cdn.jquerytools.org/1.2.4/full/jquery.tools.min.js");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   160
			script_tag.onload = scriptLibHandler;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   161
			script_tag.onreadystatechange = function () { // Same thing but for IE
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   162
				if (this.readyState == 'complete' || this.readyState == 'loaded') {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   163
					scriptLibHandler();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   164
					
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   165
				}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   166
			};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   167
			// Try to find the head, otherwise default to the documentElement
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   168
			(document.getElementsByTagName("head")[0] || document.documentElement).appendChild(script_tag);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   169
		} else {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   170
			// The jQuery version on the window is the one we want to use
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   171
			 __IriSP.jQuery = window.jQuery;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   172
			scriptLibHandler();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   173
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   174
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   175
		/******** Called once jQuery has loaded ******/
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   176
		function scriptLibHandler() {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   177
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   178
			var script_jqUi_tooltip = document.createElement('script');
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   179
			script_jqUi_tooltip.setAttribute("type","text/javascript");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   180
			script_jqUi_tooltip.setAttribute("src",__IriSP.lib.jQueryToolTip);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   181
			script_jqUi_tooltip.onload = scriptLoadHandler;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   182
			script_jqUi_tooltip.onreadystatechange = function () { // Same thing but for IE
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   183
				if (this.readyState == 'complete' || this.readyState == 'loaded') {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   184
					scriptLoadHandler("jquery.tools.min.js loded");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   185
				}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   186
			};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   187
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   188
			var script_swfObj = document.createElement('script');
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   189
			script_swfObj.setAttribute("type","text/javascript");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   190
			script_swfObj.setAttribute("src",__IriSP.lib.swfObject);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   191
			script_swfObj.onload = scriptLoadHandler;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   192
			script_swfObj.onreadystatechange = function () { // Same thing but for IE
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   193
				if (this.readyState == 'complete' || this.readyState == 'loaded') {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   194
					scriptLoadHandler("swfobject.js loded");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   195
				}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   196
			};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   197
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   198
			var script_jqUi = document.createElement('script');
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   199
			script_jqUi.setAttribute("type","text/javascript");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   200
			script_jqUi.setAttribute("src",__IriSP.lib.jQueryUI);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   201
			script_jqUi.onload = scriptLoadHandler;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   202
			script_jqUi.onreadystatechange = function () { // Same thing but for IE
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   203
				if (this.readyState == 'complete' || this.readyState == 'loaded') {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   204
					scriptLoadHandler("jquery-ui.min.js loded");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   205
				}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   206
			};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   207
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   208
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   209
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   210
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   211
			(document.getElementsByTagName("head")[0] || document.documentElement).appendChild(script_jqUi_tooltip);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   212
			(document.getElementsByTagName("head")[0] || document.documentElement).appendChild(script_jqUi);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   213
			(document.getElementsByTagName("head")[0] || document.documentElement).appendChild(script_swfObj);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   214
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   215
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   216
		};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   217
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   218
		/******** Called once all lib are loaded ******/
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   219
		var loadLib = 0;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   220
		function scriptLoadHandler(Mylib) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   221
			//alert(Mylib);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   222
			loadLib +=1;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   223
			if(loadLib===3){ 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   224
				main(); 			  
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   225
			}else {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   226
				// __IriSP.jQuery('#'+__IriSP.config.gui.container).html("Loading library ...");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   227
			}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   228
		};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   229
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   230
		/******** Our main function ********/
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   231
		function main() { 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   232
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   233
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   234
			//  Make __IriSP.jQuery and restore window.jQuery 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   235
			__IriSP.jQuery = window.jQuery.noConflict(true);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   236
			// Call MY Jquery
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   237
			__IriSP.jQuery(document).ready(function($) { 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   238
				
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   239
				/******* Load CSS *******/
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   240
				var css_link_jquery = __IriSP.jQuery("<link>", { 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   241
					rel: "stylesheet", 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   242
					type: "text/css", 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   243
					href: __IriSP.lib.cssjQueryUI,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   244
					'class': "dynamic_css"
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   245
				});
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   246
				var css_link_custom = __IriSP.jQuery("<link>", { 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   247
					rel: "stylesheet", 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   248
					type: "text/css", 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   249
					href: __IriSP.config.gui.css,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   250
					'class': "dynamic_css"
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   251
				});
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   252
				
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   253
				css_link_jquery.appendTo('head');
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   254
				css_link_custom.appendTo('head');   
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   255
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   256
				// to see dynamicly loaded css on IE
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   257
				if ($.browser.msie) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   258
					$('.dynamic_css').clone().appendTo('head');
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   259
				}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   260
				
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   261
				//__IriSP.trace("main","ready createMyHtml");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   262
				
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   263
				__IriSP.createMyHtml();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   264
				//__IriSP.trace("main","end createMyHtml");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   265
				
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   266
				/******* Load Metadata *******/
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   267
				
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   268
				__IriSP.jQuery.ajax({
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   269
					  dataType: __IriSP.config.metadata.load,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   270
					  url:metadataSrc,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   271
					  success : function(json){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   272
					  
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   273
							__IriSP.trace("ajax","success");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   274
							
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   275
							// START PARSING ----------------------- 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   276
							if(json === ""){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   277
								alert("ERREUR DE CHARGEMENT JSON");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   278
							} else {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   279
							  
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   280
							  
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   281
								// # CREATE MEDIA  							//
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   282
								// # JUSTE ONE PLAYER FOR THE MOMENT		//
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   283
								//__IriSP.jQuery("<div></div>").appendTo("#output");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   284
								var MyMedia = new  __IriSP.Media(
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   285
																	json.medias[0].id,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   286
																	json.medias[0].href,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   287
																	json.medias[0]['meta']['dc:duration'],
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   288
																	json.medias[0]['dc:title'],
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   289
																	json.medias[0]['dc:description']);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   290
								
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   291
								__IriSP.trace("__IriSP.MyApiPlayer",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   292
																	__IriSP.config.gui.width+"   "
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   293
																	+ __IriSP.config.gui.height + " "
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   294
																	+ json.medias[0].href + " "
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   295
																	+ json.medias[0]['meta']['dc:duration'] + " "
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   296
																	+ json.medias[0]['meta']['item']['value']);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   297
								
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   298
								// Create APIplayer
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   299
								__IriSP.MyApiPlayer = new __IriSP.APIplayer(
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   300
																	__IriSP.config.gui.width,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   301
																	__IriSP.config.gui.height,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   302
																	json.medias[0].href,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   303
																	json.medias[0]['meta']['dc:duration'],
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   304
																	json.medias[0]['meta']['item']['value']);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   305
							
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   306
								// # CREATE THE FIRST LINE  				//
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   307
								__IriSP.trace("__IriSP.init.main","__IriSP.Ligne");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   308
								__IriSP.MyLdt = new __IriSP.Ligne (
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   309
																	json['annotation-types'][0].id,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   310
																	json['annotation-types'][0]['dc:title'],
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   311
																	json['annotation-types'][0]['dc:description'],
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   312
																	json.medias[0]['meta']['dc:duration']);			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   313
								
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   314
								// CREATE THE TAG CLOUD 					//
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   315
								__IriSP.trace("__IriSP.init.main","__IriSP.Tags");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   316
								__IriSP.MyTags =  new __IriSP.Tags (json.tags);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   317
							
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   318
								// CREATE THE ANNOTATIONS  				    //
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   319
								// JUSTE FOR THE FIRST TYPE   			 	//
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   320
								__IriSP.jQuery.each(json.annotations, function(i,item) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   321
									if (item.meta['id-ref'] == __IriSP.MyLdt.id) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   322
										//__IriSP.trace("__IriSP.init.main","__IriSP.MyLdt.addAnnotation");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   323
										__IriSP.MyLdt.addAnnotation(
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   324
													item.id,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   325
													item.begin,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   326
													item.end,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   327
													item.media,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   328
													item.content.title,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   329
													item.content.description,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   330
													item.content.color,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   331
													item.tags);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   332
									}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   333
										//MyTags.addAnnotation(item);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   334
								});	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   335
								__IriSP.jQuery.each(json.lists, function(i,item) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   336
									__IriSP.trace("lists","");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   337
								});	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   338
								__IriSP.jQuery.each(json.views, function(i,item) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   339
									__IriSP.trace("views","");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   340
								});	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   341
							}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   342
							// END PARSING ----------------------- //  
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   343
						
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   344
										
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   345
					},error : function(data){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   346
						  alert("ERROR : "+data);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   347
					}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   348
				  });	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   349
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   350
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   351
			});
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   352
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   353
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   354
};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   355
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   356
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   357
__IriSP.createMyHtml = function(){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   358
		var width = __IriSP.config.gui.width;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   359
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   360
		// AUDIO  */
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   361
		// PB dans le html : ; 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   362
		if(__IriSP.config.gui.mode=="radio"){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   363
		__IriSP.jQuery(  "<div id='Ldt-Root'>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   364
			"	<div id='Ldt-PlaceHolder'>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   365
			"		<a href='http://www.adobe.com/go/getflashplayer'>Get flash</a> to see this player	\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   366
			"	</div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   367
			"	<div id='Ldt-controler' class='demo'>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   368
			"		<div class='Ldt-Control1' >\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   369
			"			<button id='ldt-CtrlPlay' onclick='__IriSP.MyApiPlayer.play()'>Lecture / Pause </button>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   370
			"			<button id='ldt-CtrlNext' onclick='__IriSP.MyLdt.nextAnnotation()'>Suivant</button>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   371
			"		</div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   372
			"		<div id='Ldt-Annotations' class='ui-slider'>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   373
			"			<div id='slider-range-min'></div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   374
			"	</div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   375
			"		<div class='Ldt-Control2'>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   376
			"			<button id='ldt-CtrlLink'> Partager </button>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   377
			"			<button id='ldt-CtrlSound' onclick='__IriSP.MyApiPlayer.mute()'>Sound</button>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   378
			"		</div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   379
			"  <div class='cleaner'>&nbsp\;</div> \n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   380
			"  <div id='Ldt-Show-Arrow-container'>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   381
			"  	<div id='Ldt-Show-Arrow'> </div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   382
			"  </div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   383
			"</div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   384
			"<div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   385
			" <div id='ldt-Show'> </div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   386
			"	<div id='Ldt-ShowAnnotation-audio' class='demo' >\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   387
			"		<div id='Ldt-SaTitle'></div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   388
			"		<div id='Ldt-SaDescription'></div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   389
			" 		<div class='cleaner'><!--&nbsp\;--></div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   390
			" </div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   391
			" <div id='Ldt-SaKeyword'>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   392
			" <div id='Ldt-SaKeywordText'>  </div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   393
			" <div class='cleaner'></div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   394
			" <div id='Ldt-SaShareTools'>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   395
			" \n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   396
			" "+__IriSP.LdtShareTool+"\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   397
			" \n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   398
			"  </div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   399
			" <div class='cleaner'></div>"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   400
			"</div>  "+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   401
			//"<div id='Ldt-Tags'> Mots clefs : </div>"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   402
			"</div>"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   403
			"<div id='Ldt-output'></div>").appendTo("#"+__IriSP.config.gui.container);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   404
		} else if(__IriSP.config.gui.mode=="video") {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   405
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   406
			__IriSP.jQuery(  "<div id='Ldt-Root'>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   407
			"	<div id='Ldt-PlaceHolder'>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   408
			"		<a href='http://www.adobe.com/go/getflashplayer'>Get flash</a> to see this player	\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   409
			"	</div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   410
			"	<div id='Ldt-controler' class='demo'>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   411
			"		<div class='Ldt-Control1' >\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   412
			"			<button id='ldt-CtrlPlay' onclick='__IriSP.MyApiPlayer.play()'>Lecture / Pause </button>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   413
			"			<button id='ldt-CtrlNext' onclick='__IriSP.MyLdt.nextAnnotation()'>Suivant</button>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   414
			"		</div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   415
			"		<div id='Ldt-Annotations' class='ui-slider'>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   416
			"			<div id='slider-range-min'></div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   417
			"	</div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   418
			"		<div class='Ldt-Control2'>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   419
			"			<button id='ldt-CtrlLink'> Partager </button>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   420
			"			<button id='ldt-CtrlSound' onclick='__IriSP.MyApiPlayer.mute()'>Sound</button>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   421
			"		</div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   422
			"  <div class='cleaner'>&nbsp\;</div> \n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   423
			"  <div id='Ldt-Show-Arrow-container'>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   424
			"  	<div id='Ldt-Show-Arrow'> </div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   425
			"  </div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   426
			"</div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   427
			"<div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   428
			" <div id='ldt-Show'> </div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   429
			"	<div id='Ldt-ShowAnnotation-audio' class='demo' >\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   430
			"		<div id='Ldt-SaTitle'></div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   431
			"		<div id='Ldt-SaDescription'></div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   432
			" 		<div class='cleaner'><!--&nbsp\;--></div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   433
			" </div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   434
			" <div id='Ldt-SaKeyword'>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   435
			" <div id='Ldt-SaKeywordText'>  </div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   436
			" <div class='cleaner'></div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   437
			" <div id='Ldt-SaShareTools'>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   438
			" \n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   439
			" "+__IriSP.LdtShareTool+"\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   440
			" \n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   441
			"  </div>\n"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   442
			" <div class='cleaner'></div>"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   443
			"</div>  "+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   444
			//"<div id='Ldt-Tags'> Mots clefs : </div>"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   445
			"</div>"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   446
			"<div id='Ldt-output'></div>").appendTo("#"+__IriSP.config.gui.container);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   447
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   448
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   449
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   450
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   451
		__IriSP.trace("__IriSP.createHtml","end");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   452
		__IriSP.jQuery("#Ldt-Annotations").width(width-(75*2));
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   453
		__IriSP.jQuery("#Ldt-Show-Arrow-container").width(width-(75*2));
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   454
		__IriSP.jQuery("#Ldt-ShowAnnotation-audio").width(width-10);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   455
		__IriSP.jQuery("#Ldt-ShowAnnotation-video").width(width-10);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   456
		__IriSP.jQuery("#Ldt-SaKeyword").width(width-10);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   457
		__IriSP.jQuery("#Ldt-controler").width(width-10);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   458
		__IriSP.jQuery("#Ldt-Control").attr("z-index","100");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   459
		__IriSP.jQuery("#Ldt-controler").hide();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   460
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   461
		__IriSP.jQuery("<div id='Ldt-load-container'><div id='Ldt-loader'>&nbsp;</div> Chargement... </div>").appendTo("#Ldt-ShowAnnotation-audio");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   462
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   463
		if(__IriSP.config.gui.mode=='radio'){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   464
			__IriSP.jQuery("#Ldt-load-container").attr("width",__IriSP.config.gui.width);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   465
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   466
		// Show or not the output
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   467
		if(__IriSP.config.gui.debug===true){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   468
			__IriSP.jQuery("#Ldt-output").show();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   469
		} else {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   470
			__IriSP.jQuery("#Ldt-output").hide();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   471
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   472
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   473
};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   474
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   475
__IriSP.Media = function (id,url,duration,title,description){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   476
		this.id 		 	= id;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   477
		this.url 		= url;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   478
		this.title 		= title;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   479
		this.description = description;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   480
		this.duration 	= duration;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   481
		this.lignes 	  	= new Array();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   482
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   483
		__IriSP.trace("__IriSP.Media","Media ID : "+id);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   484
		__IriSP.trace("__IriSP.Media","Media URL : "+url);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   485
		__IriSP.trace("__IriSP.Media","Media title : "+title);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   486
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   487
__IriSP.Media.prototype.createPlayerMedia = function (width,height,MyStreamer,MySwfPath){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   488
		__IriSP.MyApiPlayer = new __IriSP.APIplayer(width,height,this.url,this.duration,MyStreamer,MySwfPath);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   489
		//createPlayer(width,height,this.url,this.duration,MyStreamer,MySwfPath);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   490
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   491
__IriSP.Media.prototype.getMediaDuration = function (){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   492
		return (this.duration);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   493
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   494
__IriSP.Media.prototype.getMediaTitle = function (){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   495
		return (this.title);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   496
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   497
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   498
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   499
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   500
/* 	INTERFACE : SLIDER ( CONTROL BAR ) | BUTTON ()   */
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   501
__IriSP.createInterface = function(width,height,duration){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   502
				
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   503
		__IriSP.jQuery("#Ldt-controler").show();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   504
		//__IriSP.jQuery("#Ldt-Root").css('display','visible');
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   505
		__IriSP.trace("__IriSP.createInterface",width+","+height+","+duration+",");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   506
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   507
		__IriSP.jQuery("#Ldt-ShowAnnotation").click(function () { 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   508
			 //__IriSP.jQuery(this).slideUp(); 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   509
		});
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   510
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   511
		var LdtpPlayerY = __IriSP.jQuery("#Ldt-PlaceHolder").attr("top");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   512
		var LdtpPlayerX = __IriSP.jQuery("#Ldt-PlaceHolder").attr("left");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   513
		__IriSP.jQuery("#slider-range-min").slider({ //range: "min",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   514
			value: 0,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   515
			min: 1,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   516
			max: duration/1000,//1:54:52.66 = 3600+3240+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   517
			step: 0.1,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   518
			slide: function(event, ui) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   519
				
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   520
				//__IriSP.jQuery("#amount").val(ui.value+" s");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   521
				//player.sendEvent('SEEK', ui.value)
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   522
				__IriSP.MyApiPlayer.seek(ui.value);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   523
				//changePageUrlOffset(ui.value);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   524
				//player.sendEvent('PAUSE')
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   525
			}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   526
		});
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   527
		__IriSP.trace("__IriSP.createInterface","ICI");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   528
		__IriSP.jQuery("#amount").val(__IriSP.jQuery("#slider-range-min").slider("value")+" s");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   529
		__IriSP.jQuery(".Ldt-Control1 button:first").button({
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   530
			icons: {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   531
				primary: 'ui-icon-play'
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   532
			},
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   533
			text: false
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   534
		}).next().button({
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   535
			icons: {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   536
				primary: 'ui-icon-seek-next'
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   537
			},
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   538
			 text: false
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   539
		});
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   540
		__IriSP.jQuery(".Ldt-Control2 button:first").button({
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   541
			icons: {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   542
				primary: 'ui-icon-transferthick-e-w'//,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   543
				//secondary: 'ui-icon-volume-off'
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   544
			},
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   545
			text: false
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   546
		}).next().button({
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   547
			icons: {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   548
				primary: 'ui-icon-volume-on'
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   549
			},
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   550
			 text: false
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   551
		});
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   552
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   553
		// /!\ PB A MODIFIER 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   554
		//__IriSP.MyTags.draw();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   555
		__IriSP.trace("__IriSP.createInterface","ICI2");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   556
		__IriSP.jQuery("#ldt-CtrlPlay").attr("style","background-color:#CD21C24;");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   557
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   558
		__IriSP.jQuery("#Ldt-load-container").hide();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   559
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   560
		if(__IriSP.config.gui.mode=="radio" & __IriSP.jQuery.browser.msie!=true){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   561
			__IriSP.jQuery("#Ldtplayer1").attr("height","0");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   562
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   563
		__IriSP.trace("__IriSP.createInterface","3");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   564
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   565
		__IriSP.trace("__IriSP.createInterface","END");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   566
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   567
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   568
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   569
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   570
/*  API player - work in progress ... need refactoring of code */ 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   571
__IriSP.APIplayer = function (width,height,url,duration,streamerPath,MySwfPath){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   572
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   573
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   574
		this.player 			= null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   575
		this.hashchangeUpdate 	= null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   576
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   577
		this.width				= width;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   578
		this.height				= height;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   579
		this.url				= url;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   580
		this.duration			= duration;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   581
		this.streamerPath		= streamerPath;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   582
		this.MySwfPath			= MySwfPath;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   583
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   584
		__IriSP.MyApiPlayer		= this;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   585
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   586
		__IriSP.createPlayer(this.url,this.streamerPath);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   587
		__IriSP.trace("__IriSP.APIplayer","__IriSP.createPlayer");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   588
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   589
	//__IriSP.config.player
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   590
	/*
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   591
	- dailymotion  // &enableApi=1&chromeless=1
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   592
	- youtube 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   593
	- html5
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   594
	- flowplayer 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   595
	- jwplayer
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   596
	*/
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   597
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   598
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   599
__IriSP.APIplayer.prototype.ready = function(player){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   600
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   601
	//__IriSP.trace("__IriSP.APIplayer.prototype.APIpReady"," __IriSP.createInterface");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   602
	__IriSP.createInterface(this.width,this.height,this.duration);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   603
	//__IriSP.trace("__IriSP.APIplayer.prototype.APIpReady","END  __IriSP.createInterface");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   604
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   605
	// hashchange EVENT
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   606
	if (window.addEventListener){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   607
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   608
	// pour FIREFOX  hashchange EVENT
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   609
		window.addEventListener("hashchange", function() {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   610
		  var url = window.location.href;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   611
		  var time = __IriSP.retrieveTimeFragment(url);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   612
		  __IriSP.trace("__IriSP.APIplayer.prototype.ready",time);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   613
		  if(__IriSP.MyApiPlayer.hashchangeUpdate==null){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   614
			__IriSP.MyApiPlayer.seek(time);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   615
		  }else{
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   616
			__IriSP.MyApiPlayer.hashchangeUpdate=null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   617
		  }
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   618
		}, false);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   619
	 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   620
	} 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   621
	else if (window.attachEvent){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   622
	// FOR IE hashchange EVENT
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   623
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   624
		window.attachEvent("onhashchange", function() {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   625
		  __IriSP.trace("hashchange",time);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   626
		  var url = window.location.href;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   627
		  var time = __IriSP.retrieveTimeFragment(url);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   628
		  if(__IriSP.MyApiPlayer.hashchangeUpdate==null){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   629
			__IriSP.MyApiPlayer.seek(time);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   630
		  }else{
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   631
			__IriSP.MyApiPlayer.hashchangeUpdate=null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   632
		  }
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   633
		}, false);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   634
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   635
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   636
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   637
__IriSP.APIplayer.prototype.pause = function(){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   638
	this.hashchangeUpdate = true;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   639
	__IriSP.player.sendEvent('PAUSE');
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   640
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   641
__IriSP.APIplayer.prototype.play  = function(){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   642
	this.hashchangeUpdate = true;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   643
	//__IriSP.trace("__IriSP.config.player.type",__IriSP.config.player.type);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   644
	if(__IriSP.config.player.type=='jwplayer'){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   645
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   646
		__IriSP.player.sendEvent('PLAY');
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   647
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   648
	} else if(__IriSP.config.player.type=='dailymotion' 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   649
			  || __IriSP.config.player.type=='youtube'
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   650
			  || __IriSP.config.player.type=='vimeo') {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   651
			  
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   652
		var status = __IriSP.player.getPlayerState();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   653
		__IriSP.trace("__IriSP.APIplayer.prototype.play.status",status);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   654
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   655
		if (status!=1){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   656
			__IriSP.player.playVideo();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   657
			//} else if(__IriSP.config.player.type=='vimeo' ){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   658
		}else{
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   659
			__IriSP.player.pauseVideo();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   660
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   661
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   662
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   663
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   664
__IriSP.APIplayer.prototype.mute  = function(){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   665
	__IriSP.player.sendEvent('MUTE');
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   666
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   667
	//alert(__IriSP.jQuery(".ui-icon-volume-on").css("background-position-x"));
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   668
	if (__IriSP.jQuery(".ui-icon-volume-on").css("background-position")=="-144px -160px"){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   669
		__IriSP.jQuery(".ui-icon-volume-on").css("background-position","-130px -160px");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   670
	} else {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   671
		__IriSP.jQuery(".ui-icon-volume-on").css("background-position","-144px -160px");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   672
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   673
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   674
__IriSP.APIplayer.prototype.share = function(network){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   675
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   676
	var MyMessage = encodeURIComponent("J'écoute Les Retours du Dimanche : ");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   677
	var MyURLNow = window.location.href;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   678
	var shareURL;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   679
	//alert(network+" : "+MyURLNow);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   680
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   681
	if(network == "facebook"){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   682
			shareURL = "http://www.facebook.com/share.php?u=";			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   683
		}else if(network == "twitter"){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   684
			shareURL  = "http://twitter.com/home?status="+MyMessage;	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   685
		}else if(network == "myspace"){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   686
			shareURL ="http://www.myspace.com/Modules/PostTo/Pages/?u=";
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   687
		}else if(network == "delicious"){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   688
			shareURL = "http://delicious.com/save?url=";
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   689
		}else if(network == "JameSpot"){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   690
			shareURL = "http://www.jamespot.com/?action=spotit&u=";
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   691
			//alert(network+" non actif pour l'instant : "+MyURLNow);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   692
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   693
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   694
	window.open(shareURL+encodeURIComponent(MyURLNow));
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   695
	//window.location.href = shareURL+encodeURIComponent(MyURLNow);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   696
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   697
__IriSP.APIplayer.prototype.seek  = function (time){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   698
	__IriSP.trace("__IriSP.APIplayer.prototype.seek",time);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   699
	if(__IriSP.config.player.type=='jwplayer'){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   700
		__IriSP.player.sendEvent('SEEK', time);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   701
	} else if(__IriSP.config.player.type=='dailymotion'
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   702
			|| __IriSP.config.player.type=='youtube') {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   703
		__IriSP.player.seekTo(time);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   704
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   705
	this.changePageUrlOffset(time);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   706
}	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   707
__IriSP.APIplayer.prototype.update = function (time){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   708
	this.hashchangeUpdate = true;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   709
	__IriSP.player.sendEvent('SEEK', time);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   710
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   711
__IriSP.APIplayer.prototype.changePageUrlOffset = function (time) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   712
	//alert(time);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   713
  __IriSP.trace("__IriSP.APIplayer.prototype.changePageUrlOffset","CHANGE URL "+time);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   714
  window.location.hash = "#t=" + time;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   715
  window.location.href =  window.location.href;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   716
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   717
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   718
/* MEDIA FRAGMENT FUNCTION */
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   719
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   720
__IriSP.jumpToTimeoffset = function (form) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   721
	var time = form.time.value;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   722
	__IriSP.MyApiPlayer.changePageUrlOffset(time);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   723
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   724
__IriSP.retrieveTimeFragment = function (url) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   725
  var pageoffset = 0;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   726
  var offsettime = 0;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   727
  
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   728
  if (url.split("#")[1] != null) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   729
	pageoffset = url.split("#")[1];
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   730
		if (pageoffset.substring(2) != null) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   731
			offsettime = pageoffset.substring(2);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   732
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   733
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   734
	return offsettime;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   735
}  
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   736
__IriSP.ignoreTimeFragment = function(url){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   737
 if (url.split("#")[1] != null) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   738
	var pageurl= url.split("#")[0];
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   739
 }
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   740
 return pageurl;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   741
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   742
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   743
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   744
/* CODE SPECIAL JW PLAYER  creation + listener */
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   745
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   746
__IriSP.currentPosition 	= 0; 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   747
__IriSP.currentVolume   	= 50; 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   748
__IriSP.player 				= null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   749
__IriSP.startPosition 		= null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   750
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   751
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   752
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   753
__IriSP.createPlayer = function (url,streamerPath) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   754
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   755
	// vimeo
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   756
	__IriSP.config.player.flashvars.clip_id =  __IriSP.config.player.src;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   757
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   758
	if(__IriSP.config.player.type=='dailymotion'){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   759
		__IriSP.config.player.src = __IriSP.config.player.src+"&chromeless=1&enableApi=1";
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   760
	} else if (__IriSP.config.player.type=='youtube'){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   761
		__IriSP.config.player.src = __IriSP.config.player.src+"&enablejsapi=1&version=3";
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   762
	} else if (__IriSP.config.player.type=='vimeo'){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   763
		__IriSP.config.player.src = "http://vimeo.com/moogaloop.swf";
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   764
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   765
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   766
	__IriSP.trace("__IriSP.createPlayer","start");			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   767
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   768
	__IriSP.myUrlFragment = url.split(streamerPath);	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   769
	__IriSP.config.player.flashvars.streamer =	streamerPath;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   770
	__IriSP.config.player.flashvars.file =	__IriSP.myUrlFragment[1];
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   771
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   772
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   773
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   774
	var flashvars 		  = __IriSP.config.player.flashvars;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   775
	var params 			  = __IriSP.config.player.params;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   776
	var attributes 		  = __IriSP.config.player.attributes;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   777
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   778
	__IriSP.trace(
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   779
				  "__IriSP.createPlayer",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   780
				  "SWFOBJECT src:"+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   781
				  __IriSP.config.player.src+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   782
				  " " +__IriSP.config.gui.width+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   783
				  " " +__IriSP.config.gui.height+
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   784
				  " || src = " +__IriSP.config.player.src
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   785
				  );
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   786
				  
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   787
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   788
	swfobject.embedSWF(
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   789
						__IriSP.config.player.src,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   790
						"Ldt-PlaceHolder",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   791
						__IriSP.config.gui.width,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   792
						__IriSP.config.gui.height,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   793
						"9.0.115",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   794
						false,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   795
						flashvars,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   796
						params,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   797
						attributes
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   798
					);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   799
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   800
	// need a methode to 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   801
	// re execute if this swf call does'nt work 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   802
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   803
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   804
/* HOOK system for player API */
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   805
/* Name of hooked function 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   806
 - PlayerReady
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   807
 - PlayerAddListeners 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   808
 - PlayerPositionListener
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   809
 - PlayerPositionListenerAction
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   810
 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   811
// */
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   812
__IriSP.Hook = {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   813
  hooks: [],
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   814
 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   815
  register: function ( name, callback ) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   816
    if( 'undefined' == typeof( Hook.hooks[name] ) )
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   817
      Hook.hooks[name] = []
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   818
    Hook.hooks[name].push( callback )
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   819
  },
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   820
 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   821
  call: function ( name, arguments ) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   822
    if( 'undefined' != typeof( Hook.hooks[name] ) )
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   823
      for( i = 0; i < Hook.hooks[name].length; ++i )
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   824
        if( true != Hook.hooks[name][i]( arguments ) ) { break; }
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   825
  }
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   826
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   827
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   828
/* API DAILYMOTION 	*/
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   829
onDailymotionPlayerReady = function (playerid){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   830
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   831
	//alert(playerid);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   832
	__IriSP.player = document.getElementById(__IriSP.config.player.attributes.id);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   833
	__IriSP.MyApiPlayer.ready(__IriSP.player);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   834
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   835
	var url = document.location.href;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   836
	var time = __IriSP.retrieveTimeFragment(url);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   837
	__IriSP.startPosition = time;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   838
	__IriSP.DailymotionAddListeners();	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   839
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   840
	__IriSP.MyApiPlayer.ready(playerid);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   841
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   842
__IriSP.DailymotionAddListeners = function () {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   843
	if (__IriSP.player) { 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   844
		__IriSP.trace("__IriSP.addListeners","ADD  Listener ");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   845
		//__IriSP.player.addEventListener("onStateChange", "__IriSP.DailymotionPositionListener");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   846
		setTimeout("__IriSP.DailymotionPositionListener()",100);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   847
		__IriSP.DailymotionPositionListener();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   848
		__IriSP.player.addModelListener("VOLUME", "__IriSP.volumeListener");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   849
		//__IriSP.player.addModelListener('STATE', '__IriSP.stateMonitor');
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   850
	} else {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   851
		__IriSP.setTimeout("__IriSP.DailymotionAddListeners()",100);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   852
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   853
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   854
__IriSP.DailymotionPositionListener = function() { 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   855
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   856
	__IriSP.currentPosition = __IriSP.player.getCurrentTime();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   857
	//__IriSP.trace("__IriSP.DailymotionPositionListener",__IriSP.currentPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   858
	//__IriSP.trace("__IriSP.currentPosition",__IriSP.currentPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   859
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   860
	__IriSP.jQuery("#slider-range-min").slider("value",__IriSP.currentPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   861
	__IriSP.jQuery("#amount").val(__IriSP.currentPosition+" s");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   862
	// afficher annotation 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   863
	/*__IriSP.MyLdt.checkTime(__IriSP.currentPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   864
	*/
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   865
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   866
	setTimeout("__IriSP.DailymotionPositionListener()",10);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   867
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   868
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   869
/* API YOUTUBE 	*/
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   870
onYouTubePlayerReady= function (playerid){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   871
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   872
	var url = document.location.href;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   873
	var time = __IriSP.retrieveTimeFragment(url);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   874
	__IriSP.player = document.getElementById(__IriSP.config.player.attributes.id);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   875
	__IriSP.startPosition = time;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   876
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   877
	__IriSP.MyApiPlayer.ready(__IriSP.player);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   878
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   879
	__IriSP.MyApiPlayer.seek(time);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   880
	__IriSP.MyApiPlayer.play();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   881
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   882
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   883
	__IriSP.YouTubeAddListeners();	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   884
	__IriSP.trace("onYouTubePlayerReady=",time);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   885
	//__IriSP.MyApiPlayer.ready(playerid);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   886
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   887
__IriSP.YouTubeAddListeners = function () {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   888
	if (__IriSP.player) { 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   889
		__IriSP.trace("__IriSP.addListeners","ADD  Listener ");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   890
		__IriSP.player.addEventListener("onStateChange", "__IriSP.YouTubeStateMonitor");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   891
		setTimeout("__IriSP.YouTubePositionListener()",100);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   892
		__IriSP.player.addModelListener("VOLUME", "__IriSP.volumeListener");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   893
		//__IriSP.player.addModelListener('STATE', '__IriSP.stateMonitor');
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   894
	} else {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   895
		__IriSP.setTimeout("__IriSP.YouTubePositionListener()",100);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   896
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   897
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   898
__IriSP.YouTubePositionListener = function() { 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   899
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   900
	__IriSP.currentPosition = __IriSP.player.getCurrentTime();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   901
	//__IriSP.trace("__IriSP.YouTubePositionListener",__IriSP.currentPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   902
	//__IriSP.trace("__IriSP.currentPosition",__IriSP.currentPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   903
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   904
	__IriSP.MyLdt.checkTime(__IriSP.currentPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   905
	__IriSP.jQuery("#slider-range-min").slider("value",__IriSP.currentPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   906
	__IriSP.jQuery("#amount").val(__IriSP.currentPosition+" s");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   907
	// afficher annotation 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   908
	__IriSP.MyLdt.checkTime(__IriSP.currentPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   909
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   910
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   911
	setTimeout("__IriSP.YouTubePositionListener()",10);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   912
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   913
__IriSP.YouTubeStateMonitor = function (obj) { 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   914
	__IriSP.player.addModelListener('__IriSP.YouTubeStateMonitor ', newstate);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   915
	//alert(newstate+" "+obj.newstate);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   916
	 if(newstate == '2')
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   917
    {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   918
		__IriSP.trace("__IriSP.stateMonitor","PAUSE");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   919
		__IriSP.MyApiPlayer.changePageUrlOffset(__IriSP.currentPosition);			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   920
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   921
	}else if (newstate == '1'){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   922
		// une fois la video prete a lire  la déplacer au bon timecode 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   923
		if(__IriSP.startPosition!=null){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   924
			__IriSP.MyApiPlayer.update(__IriSP.startPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   925
			__IriSP.startPosition = null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   926
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   927
	} 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   928
	else if (newstate == '-1'){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   929
		// une fois la video prete a lire  la déplacer au bon timecode 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   930
		if(__IriSP.startPosition!=null){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   931
			__IriSP.MyApiPlayer.update(__IriSP.startPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   932
			__IriSP.startPosition = null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   933
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   934
	} else if (newstate == '3'){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   935
		__IriSP.trace("__IriSP.stateMonitor","BUFFERING : ");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   936
		//changePageUrlOffset(currentPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   937
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   938
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   939
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   940
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   941
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   942
/* API VIMEO 	*/
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   943
onVimeoPlayerReady= function (playerid){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   944
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   945
	var url = document.location.href;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   946
	var time = __IriSP.retrieveTimeFragment(url);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   947
	__IriSP.player = document.getElementById(__IriSP.config.player.attributes.id);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   948
	__IriSP.startPosition = time;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   949
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   950
	__IriSP.MyApiPlayer.ready(__IriSP.player);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   951
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   952
	__IriSP.MyApiPlayer.seek(time);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   953
	__IriSP.MyApiPlayer.play();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   954
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   955
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   956
	__IriSP.YouTubeAddListeners();	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   957
	__IriSP.trace("onYouTubePlayerReady=",time);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   958
	//__IriSP.MyApiPlayer.ready(playerid);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   959
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   960
__IriSP.VimeoAddListeners = function () {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   961
	if (__IriSP.player) { 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   962
		__IriSP.trace("__IriSP.addListeners","ADD  Listener ");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   963
		__IriSP.player.addEventListener("onStateChange", "__IriSP.YouTubeStateMonitor");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   964
		setTimeout("__IriSP.YouTubePositionListener()",100);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   965
		__IriSP.player.addModelListener("VOLUME", "__IriSP.volumeListener");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   966
		//__IriSP.player.addModelListener('STATE', '__IriSP.stateMonitor');
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   967
	} else {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   968
		__IriSP.setTimeout("__IriSP.YouTubePositionListener()",100);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   969
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   970
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   971
__IriSP.VimeoPositionListener = function() { 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   972
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   973
	__IriSP.currentPosition = __IriSP.player.getCurrentTime();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   974
	//__IriSP.trace("__IriSP.YouTubePositionListener",__IriSP.currentPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   975
	//__IriSP.trace("__IriSP.currentPosition",__IriSP.currentPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   976
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   977
	__IriSP.MyLdt.checkTime(__IriSP.currentPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   978
	__IriSP.jQuery("#slider-range-min").slider("value",__IriSP.currentPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   979
	__IriSP.jQuery("#amount").val(__IriSP.currentPosition+" s");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   980
	// afficher annotation 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   981
	__IriSP.MyLdt.checkTime(__IriSP.currentPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   982
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   983
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   984
	setTimeout("__IriSP.YouTubePositionListener()",10);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   985
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   986
__IriSP.VimeoStateMonitor = function (obj) { 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   987
	__IriSP.player.addModelListener('__IriSP.YouTubeStateMonitor ', newstate);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   988
	//alert(newstate+" "+obj.newstate);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   989
	 if(newstate == '2')
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   990
    {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   991
		__IriSP.trace("__IriSP.stateMonitor","PAUSE");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   992
		__IriSP.MyApiPlayer.changePageUrlOffset(__IriSP.currentPosition);			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   993
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   994
	}else if (newstate == '1'){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   995
		// une fois la video prete a lire  la déplacer au bon timecode 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   996
		if(__IriSP.startPosition!=null){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   997
			__IriSP.MyApiPlayer.update(__IriSP.startPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   998
			__IriSP.startPosition = null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
   999
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1000
	} 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1001
	else if (newstate == '-1'){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1002
		// une fois la video prete a lire  la déplacer au bon timecode 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1003
		if(__IriSP.startPosition!=null){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1004
			__IriSP.MyApiPlayer.update(__IriSP.startPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1005
			__IriSP.startPosition = null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1006
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1007
	} else if (newstate == '3'){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1008
		__IriSP.trace("__IriSP.stateMonitor","BUFFERING : ");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1009
		//changePageUrlOffset(currentPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1010
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1011
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1012
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1013
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1014
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1015
/* API JW PLAYER 	*/
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1016
__IriSP.playerReady  = function (thePlayer) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1017
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1018
	//__IriSP.trace("__IriSP.playerReady","PLAYER READY !!!!!!!!!!!!");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1019
	__IriSP.player = window.document[thePlayer.id];
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1020
	//__IriSP.trace("__IriSP.playerReady","API CALL "+__IriSP.player);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1021
	__IriSP.MyApiPlayer.ready(__IriSP.player);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1022
	//__IriSP.trace("__IriSP.playerReady","API CALL END ");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1023
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1024
	var url = document.location.href;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1025
	var time = __IriSP.retrieveTimeFragment(url);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1026
	//__IriSP.trace("__IriSP.playerReady"," "+url+" "+time );
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1027
	__IriSP.startPosition = time;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1028
	//__IriSP.trace("__IriSP.playerReady"," LISTENER LAUCHER");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1029
	__IriSP.addListeners();	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1030
	//__IriSP.trace("__IriSP.playerReady"," LISTENER END");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1031
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1032
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1033
__IriSP.addListeners = function () {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1034
	if (__IriSP.player) { 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1035
		__IriSP.trace("__IriSP.addListeners","ADD  Listener ");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1036
		__IriSP.player.addModelListener("TIME", "__IriSP.positionListener");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1037
		__IriSP.player.addControllerListener("VOLUME", "__IriSP.volumeListener");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1038
		__IriSP.player.addModelListener('STATE', '__IriSP.stateMonitor');
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1039
	} else {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1040
		__IriSP.setTimeout("__IriSP.addListeners()",100);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1041
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1042
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1043
	// et changer les boutons
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1044
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1045
__IriSP.stateMonitor = function (obj) { 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1046
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1047
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1048
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1049
	 if(obj.newstate == 'PAUSED')
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1050
    {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1051
		__IriSP.trace("__IriSP.stateMonitor","PAUSE");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1052
		__IriSP.MyApiPlayer.changePageUrlOffset(__IriSP.currentPosition);			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1053
		__IriSP.jQuery(".ui-icon-play").css("background-position","0px -160px");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1054
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1055
	} else if (obj.newstate == 'PLAYING'){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1056
		// une fois la video prete a lire  la déplacer au bon timecode 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1057
		if(__IriSP.startPosition!=null){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1058
			__IriSP.MyApiPlayer.update(__IriSP.startPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1059
			__IriSP.startPosition = null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1060
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1061
		__IriSP.jQuery(".ui-icon-play").css("background-position","-16px -160px");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1062
	} else if (obj.newstate == 'BUFFERING'){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1063
		__IriSP.trace("__IriSP.stateMonitor","BUFFERING : ");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1064
		//changePageUrlOffset(currentPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1065
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1066
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1067
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1068
__IriSP.positionListener = function(obj) { 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1069
	//__IriSP.trace("__IriSP.positionListener",obj.position);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1070
	__IriSP.currentPosition = obj.position; 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1071
	var tmp = document.getElementById("posit");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1072
	if (tmp) { tmp.innerHTML = "position: " + __IriSP.currentPosition; }
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1073
	__IriSP.jQuery("#slider-range-min").slider("value", obj.position);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1074
	__IriSP.jQuery("#amount").val(obj.position+" s");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1075
	// afficher annotation 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1076
	__IriSP.MyLdt.checkTime(__IriSP.currentPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1077
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1078
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1079
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1080
__IriSP.volumeListener   = function (obj) { 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1081
	__IriSP.currentVolume = obj.percentage; 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1082
	var tmp = document.getElementById("vol");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1083
	if (tmp) { tmp.innerHTML = "volume: " + __IriSP.currentVolume; }
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1084
}	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1085
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1086
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1087
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1088
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1089
/* 	UTIL */
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1090
// code from http://stackoverflow.com/questions/822452/strip-html-from-text-javascript
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1091
__IriSP.stripHtml = function(s){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1092
	return s.replace(/\\&/g, '&amp;').replace(/\\</g, '&lt;').replace(/\\>/g, '&gt;').replace(/\\t/g, '&nbsp;&nbsp;&nbsp;').replace(/\\n/g, '<br />').replace(/'/g, '&#39;').replace(/"/g, '&quot;');
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1093
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1094
// conversion de couleur Decimal vers HexaDecimal || 000 si fff 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1095
__IriSP.DEC_HEXA_COLOR = function (dec){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1096
	 var hexa='0123456789ABCDEF',hex='';
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1097
	 var tmp;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1098
	 while (dec>15){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1099
		  tmp = dec-(Math.floor(dec/16))*16;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1100
		  hex = hexa.charAt(tmp)+hex;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1101
		  dec = Math.floor(dec/16);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1102
	 }
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1103
	 hex = hexa.charAt(dec)+hex;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1104
	 if (hex == "FFCC00"){ hex="";/* by default color of Ldt annotation */ }
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1105
	 return(hex);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1106
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1107
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1108
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1109
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1110
/* CLASS Ligne (annotationType) 	*/
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1111
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1112
__IriSP.LDTligne 	= null;		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1113
__IriSP.Ligne = function (id,title,description,duration){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1114
	this.id 		 = id;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1115
	this.title 		 = title;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1116
	this.description = description;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1117
	//
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1118
	this.annotations = new Array();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1119
	this.duration = duration;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1120
	this.annotationOldRead="";
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1121
	__IriSP.LDTligne = this;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1122
	__IriSP.trace("__IriSP.Ligne","CREATE "+__IriSP.LDTligne);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1123
}	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1124
__IriSP.Ligne.prototype.addAnnotation = function (id,begin,end,media,title,description,color,tags){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1125
	var myAnnotation = new __IriSP.Annotation(id,begin,end,media,title,description,color,tags,this.duration);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1126
	this.annotations.push(myAnnotation);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1127
	//__IriSP.trace("__IriSP.Ligne.prototype.addAnnotation  ","add annotation "+title);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1128
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1129
__IriSP.Ligne.prototype.onClickLigneAnnotation = function(id){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1130
	//changePageUrlOffset(currentPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1131
	//player.sendEvent('SEEK', this.start);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1132
	//__IriSP.trace("SEEK",this.start);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1133
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1134
__IriSP.Ligne.prototype.searchLigneAnnotation = function(id){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1135
	/*for (){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1136
	}*/
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1137
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1138
__IriSP.Ligne.prototype.listAnnotations = function(){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1139
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1140
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1141
__IriSP.Ligne.prototype.nextAnnotation = function (){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1142
	var annotationCibleNumber = this.numAnnotation(this.annotationOldRead)+1;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1143
	var annotationCible = this.annotations[annotationCibleNumber];
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1144
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1145
	if(annotationCibleNumber<this.annotations.length-1){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1146
		annotationCible.begin
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1147
		__IriSP.player .sendEvent('SEEK', annotationCible.begin/1000);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1148
		__IriSP.trace("LIGNE  ","| next = "+annotationCibleNumber+" - "+this.annotations.length+" | seek :"+annotationCible.begin/1000);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1149
	}else{
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1150
		__IriSP.player .sendEvent('SEEK', this.annotations[0].begin/1000);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1151
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1152
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1153
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1154
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1155
__IriSP.Ligne.prototype.numAnnotation = function (annotationCible){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1156
	for (var i=0; i < this.annotations.length; ++i){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1157
		if(annotationCible == this.annotations[i]){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1158
			return i;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1159
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1160
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1161
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1162
__IriSP.Ligne.prototype.checkTime = function(time){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1163
	var annotationTempo = -1;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1164
	//__IriSP.trace("__IriSP.Ligne.prototype.checkTimeLigne",time);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1165
	//__IriSP.trace("__IriSP.Ligne.prototype.checkTimeLigne",this.annotations.length);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1166
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1167
	for (var i=0; i < this.annotations.length; ++i){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1168
		annotationTempo = this.annotations[i];	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1169
		if (time>annotationTempo.begin/1000 && time<annotationTempo.end/1000){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1170
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1171
				// different form the previous
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1172
				if(annotationTempo!=this.annotationOldRead){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1173
					this.annotationOldRead = annotationTempo;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1174
					//__IriSP.trace("Check : ","annotation ici : "+i+" title "+annotationTempo.title);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1175
					//__IriSP.jQuery('#Ldt-ShowAnnotation').slideUp();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1176
					//http://api.jquery.com/delay/  -> 1.4
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1177
					//__IriSP.jQuery("#Ldt-SaTitle").delay(100).text(annotationTempo.title);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1178
					//__IriSP.jQuery("#Ldt-SaDescription").delay(100).text(annotationTempo.description);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1179
					//__IriSP.jQuery('#Ldt-ShowAnnotation').delay(100).slideDown();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1180
					//__IriSP.trace("__IriSP.Ligne.prototype.checkTimeLigne",annotationTempo.title+" "+annotationTempo.description );
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1181
					__IriSP.jQuery("#Ldt-SaTitle").text(annotationTempo.title);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1182
					__IriSP.jQuery("#Ldt-SaDescription").text(annotationTempo.description);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1183
					__IriSP.jQuery("#Ldt-SaKeywordText").html("Mots clefs : "+annotationTempo.htmlTags);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1184
					
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1185
					//__IriSP.jQuery('#Ldt-ShowAnnotation').slideDown();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1186
					var startPourcent 	= annotationTempo.timeToPourcent((annotationTempo.begin*1+(annotationTempo.end*1-annotationTempo.begin*1)/2),annotationTempo.duration*1); 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1187
					__IriSP.jQuery("#Ldt-Show-Arrow").animate({left:startPourcent+'%'},1000);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1188
					__IriSP.jQuery("#"+annotationTempo.id).animate({alpha:'100%'},1000);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1189
					//alert(startPourcent);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1190
					var tempolinkurl  =  __IriSP.ignoreTimeFragment(window.location.href)+"#t="+(this.annotations[i].begin/1000);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1191
				}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1192
			break;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1193
		}else{
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1194
		annotationTempo=-1;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1195
		}		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1196
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1197
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1198
	// si il y en a pas : retractation du volet 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1199
	if( annotationTempo == -1){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1200
		if(annotationTempo!=this.annotationOldRead){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1201
			__IriSP.trace("Check : ","pas d'annotation ici ");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1202
			__IriSP.jQuery("#Ldt-SaTitle").text("");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1203
			__IriSP.jQuery("#Ldt-SaDescription").text("");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1204
			__IriSP.jQuery("#Ldt-SaKeywordText").html("");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1205
			__IriSP.jQuery('#Ldt-ShowAnnotation').slideUp();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1206
			if(this.annotationOldRead){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1207
				__IriSP.jQuery("#"+this.annotationOldRead.id).animate({alpha:'70%'},1000);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1208
			}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1209
			//__IriSP.jQuery("#Ldt-Show-Arrow").animate({left:'0%'},1000);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1210
			this.annotationOldRead = annotationTempo;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1211
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1212
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1213
	__IriSP.trace("__IriSP.Ligne.prototype.checkTimeLigne",annotationTempo);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1214
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1215
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1216
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1217
/* CLASS Annotation */
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1218
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1219
__IriSP.Annotation = function (){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1220
	var id 			= null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1221
	var begin 			= null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1222
	var end 			= null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1223
	var media 			= null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1224
	var description	= null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1225
	var title 			= null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1226
	var color 			= null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1227
	var tags			= null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1228
	__IriSP.trace("annotation ","r�ussi")
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1229
}	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1230
__IriSP.Annotation = function(id,begin,end,media,title,description,color,tags,duration){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1231
	this.id 			= id;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1232
	this.begin 			= begin;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1233
	this.end 			= end;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1234
	this.media 			= media;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1235
	this.description 	= description;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1236
	this.title 			= title;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1237
	this.color 			= color;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1238
	this.tags			= tags;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1239
	this.htmlTags		= "";
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1240
	this.duration		= duration;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1241
	// draw it 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1242
	this.draw();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1243
	this.drawTags();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1244
	//
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1245
	__IriSP.trace("Annotation created : ",id);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1246
}	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1247
__IriSP.Annotation.prototype.draw = function(){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1248
	//alert (this.duration);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1249
	var startPourcent 	= this.timeToPourcent(this.begin,this.duration); // temps du media 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1250
	var endPourcent 	= this.timeToPourcent(this.end,this.duration)-startPourcent;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1251
	var titleForDiv		= this.title.substr(0,55);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1252
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1253
	__IriSP.jQueryAnnotationTemplate = "<div title='"+__IriSP.stripHtml(titleForDiv)+"' id='"+this.id+"'  class='ui-slider-range ui-slider-range-min ui-widget-header iri-chapter' width='100%' style=\"left:"+startPourcent+"%; width:"+endPourcent+"%; padding-top:15px; border-left:solid 1px #aaaaaa; border-right:solid 1px #aaaaaa; background:#"+__IriSP.DEC_HEXA_COLOR(this.color)+";\" onClick=\"__IriSP.MyApiPlayer.seek('"+Math.round(this.begin/1000)+"');__IriSP.jQuery('#Ldt-ShowAnnotation').slideDown();\"    ></div> ";
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1254
	//alert(this.color+" : "+DEC_HEXA_COLOR(this.color));
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1255
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1256
	__IriSP.jQuerytoolTipTemplate = "<div class='Ldt-tooltip'>"
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1257
						+"<div class='title'>"+__IriSP.stripHtml(this.title)+"</div>"
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1258
						+"<div class='time'>"+this.begin+" : "+this.end+"</div>"
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1259
						+"<div class='description'>"+__IriSP.stripHtml(this.description)+"</div>"
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1260
						+"</div>";
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1261
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1262
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1263
	__IriSP.jQuery("<div>"+__IriSP.jQueryAnnotationTemplate+"</div>").appendTo("#Ldt-Annotations");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1264
	// TOOLTIP BUG ! 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1265
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1266
	__IriSP.jQuery("#"+this.id).tooltip({ effect: 'slide'});
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1267
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1268
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1269
	__IriSP.jQuery("#"+this.id).fadeTo(0,0.3);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1270
	__IriSP.jQuery("#"+this.id).mouseover(function() {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1271
		__IriSP.jQuery("#"+this.id).animate({opacity: 0.6}, 5)
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1272
	}).mouseout(function(){		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1273
		__IriSP.jQuery("#"+this.id).animate({opacity: 0.3}, 5)
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1274
	});
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1275
	__IriSP.trace("__IriSP.Annotation.prototype.draw","ADD ANOTATION : "+this.begin+" "+this.end+" "+__IriSP.stripHtml(this.title)+" | "+startPourcent+" | "+endPourcent+" | duration = "+this.duration);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1276
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1277
}	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1278
__IriSP.Annotation.prototype.drawTags = function(){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1279
	var KeywordPattern = '<a href=\"\"> '+' </a>';
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1280
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1281
	//__IriSP.trace(" !? Tags : ",this.tags);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1282
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1283
	if (this.tags!=undefined){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1284
		for (var i = 0; i < this.tags.length; ++i){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1285
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1286
			//this.htmlTags += '<span onclick=\"ShowTag('+this.tags[i]['id-ref']+');\"  > '+MyTags.getTitle(this.tags[i]['id-ref'])+' </span>'+" , ";
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1287
			this.htmlTags += '<span> '+__IriSP.MyTags.getTitle(this.tags[i]['id-ref'])+' </span>'+" , ";
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1288
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1289
		}		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1290
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1291
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1292
__IriSP.Annotation.prototype.tootTipAnnotation = function() {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1293
	// 1 chercher le div correspondant
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1294
	// 2 y mettre les information
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1295
	return this.color + ' ' + this.type + ' apple';
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1296
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1297
__IriSP.Annotation.prototype.onRollOverAnnotation = function (){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1298
	this.tootTip();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1299
}		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1300
__IriSP.Annotation.prototype.timeToPourcent = function(time,timetotal){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1301
	return (parseInt(Math.round(time/timetotal*100)));
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1302
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1303
 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1304
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1305
/* CLASS Tags */
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1306
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1307
__IriSP.Tags = function(object){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1308
	this.myTags 	=	object;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1309
	this.htmlTags 	= 	null;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1310
	this.weigthMax 	= 	0;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1311
	//this.mySegments  = 	new array();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1312
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1313
__IriSP.Tags.prototype.addAnnotation = function (annotation){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1314
	for (var i = 0; i < this.myTags.length; ++i){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1315
		this.myTags[i].mySegments = new Array(); 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1316
		if (annotation.tags!=null){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1317
			for (var j = 0; j < annotation.tags.length; ++j){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1318
				if (this.myTags[i]['id'] == annotation.tags[j]['id-ref']){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1319
					this.myTags[i].mySegments.push([annotation.begin,annotation.end,annotation.id]);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1320
					var weigthTempo = this.myTags[i].mySegments.length
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1321
					var tempo = this.myTags[i].mySegments[weigthTempo-1];
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1322
					//__IriSP.trace ("__IriSP.Tags.prototype.addAnnotation ","  "+this.myTags[i]['meta']['dc:title']+" "+this.myTags[i]['id']+" : "+tempo[0]+" - "+tempo[1]);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1323
					
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1324
					if (this.weigthMax < weigthTempo ){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1325
						this.weigthMax = weigthTempo;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1326
					}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1327
				}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1328
			}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1329
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1330
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1331
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1332
__IriSP.Tags.prototype.getTitle = function (id){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1333
	for (var i = 0; i < this.myTags.length; ++i){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1334
		if(this.myTags[i]['id']==id){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1335
			return(this.myTags[i]['meta']['dc:title']);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1336
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1337
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1338
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1339
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1340
__IriSP.Tags.prototype.draw = function (){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1341
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1342
	__IriSP.trace("__IriSP.Tags.prototype.draw"," !!! WELL START " );
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1343
	for (var i = 0; i < this.myTags.length; ++i){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1344
		__IriSP.trace("__IriSP.Tags.prototype.draw"," ADD Tags : "+this.myTags[i]['id']);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1345
		if(this.myTags[i]['id']!=null){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1346
		this.htmlTags += '<span onclick=\"MyTags.show( \''+this.myTags[i]['id']
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1347
						+'\');\" style=\"font-size:'  +((this.myTags[i].mySegments.length/this.weigthMax*10)+8)
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1348
						+'px;\" alt=\"'+this.myTags[i].mySegments.length
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1349
						+'\"> '+this.myTags[i]['meta']['dc:title']+' </span>'+' , ';
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1350
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1351
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1352
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1353
	__IriSP.jQuery('#Ldt-Tags').html(this.htmlTags);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1354
	__IriSP.trace("__IriSP.Tags.prototype.draw"," !!!!  END WMAX= "+this.weigthMax );
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1355
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1356
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1357
__IriSP.Tags.prototype.show = function (id){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1358
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1359
	var timeStartOffsetA	=	100000000000000000000;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1360
	var timeStartOffsetB	=	100000000000000000000;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1361
	var timeEndOffsetA		=	0;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1362
	var timeEndOffsetB		=	0;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1363
	var timeStartID;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1364
	var timeEndID;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1365
	var WidthPourCent;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1366
	var leftPourCent;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1367
	var timeStartOffset;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1368
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1369
	// case 1 : seul segment 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1370
	// case 2 : 2 ou X segments 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1371
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1372
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1373
	for (var i = 0; i < this.myTags.length; ++i){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1374
		if (this.myTags[i]['id']==id){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1375
			__IriSP.trace("######### TAG DRAWing : "," END" );		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1376
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1377
			for (var j = 0; j < this.myTags[i].mySegments.length; ++j){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1378
				if(timeStartOffset> this.myTags[i].mySegments[j][0]){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1379
					timeStartOffsetA = this.myTags[i].mySegments[j][0];
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1380
					timeStartOffsetB = this.myTags[i].mySegments[j][1];
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1381
					timeStartID		 = this.myTags[i].mySegments[j][2]
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1382
				}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1383
				if(timeStartOffset> this.myTags[i].mySegments[j][0]){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1384
					timeEndOffsetA  = this.myTags[i].mySegments[j][0];
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1385
					timeEndOffsetB  = this.myTags[i].mySegments[j][1];
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1386
					timeEndID		= this.myTags[i].mySegments[j][2]
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1387
				}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1388
			}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1389
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1390
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1391
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1392
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1393
	// -------------------------------------------------
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1394
	// 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1395
	// -------------------------------------------------
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1396
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1397
	leftPourCent 	= __IriSP.timeToPourcent((timeStartOffsetA*1+(timeStartOffsetB-timeStartOffsetA)/2),__IriSP.MyLdt.duration); 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1398
	WidthPourCent	= __IriSP.timeToPourcent((timeEndOffsetA*1+(timeEndOffsetB-timeEndOffsetA)/2),__IriSP.MyLdt.duration)-leftPourCent; 			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1399
	//WidthPourCent	= timeToPourcent((timeEndOffsetA*1+(timeEndOffsetB-timeEndOffsetA)/2),MyLdt.duration)-startPourcent; 			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1400
	__IriSP.jQuery("#Ldt-Show-Tags").css('left',leftPourCent+'%');
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1401
	__IriSP.jQuery("#Ldt-Show-Tags").css('width',WidthPourCent+'%');
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1402
	// like arrow script
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1403
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1404
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1405
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1406
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1407
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1408
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1409
/* CLASS TRACE */
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1410
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1411
__IriSP.traceNum=0;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1412
__IriSP.trace = function(msg,value){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1413
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1414
	if(__IriSP.config.gui.debug===true){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1415
		__IriSP.traceNum += 1;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1416
		__IriSP.jQuery("<div>"+__IriSP.traceNum+" - "+msg+" : "+value+"</div>").appendTo("#Ldt-output");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1417
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1418
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1419
}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1420
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1421
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1422
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1423
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 100
diff changeset
  1424
	
50
a1636b31eb98 polemical timeline
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
diff changeset
  1425