src/js/LdtPlayer.js
author hamidouk
Tue, 29 Nov 2011 11:09:08 +0100
branchpopcorn-port
changeset 345 8a088f7daa66
parent 90 1ea53c071ebe
permissions -rw-r--r--
rollover over the interface buttons now works as expected. Also changed the width of the buttons to the correct size. Resized the width and height of the sprites to be the same as the boxes we display them in.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
55
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
     1
/* 	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
     2
 *	Copyright 2010 Institut de recherche et d'innovation 
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
     3
 *	contributor(s) : Samuel Huron 
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
     4
 *	Use Silvia Pfeiffer 's javascript mediafragment implementation
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
     5
 *
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
     6
 *	contact@iri.centrepompidou.fr
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
     7
 *	http://www.iri.centrepompidou.fr 
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
     8
 *	 
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
     9
 *	This software is a computer program whose purpose is to show and add annotations on a video .
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    10
 *	This software is governed by the CeCILL-C license under French law and
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    11
 *	abiding by the rules of distribution of free software. You can  use, 
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    12
 *	modify and/ or redistribute the software under the terms of the CeCILL-C
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    13
 *	license as circulated by CEA, CNRS and INRIA at the following URL
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    14
 *	"http://www.cecill.info". 
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    15
 *	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    16
 *	The fact that you are presently reading this means that you have had
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    17
 *	knowledge of the CeCILL-C license and that you accept its terms.
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    18
*/
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    19
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    20
if ( window.IriSP === undefined && window.__IriSP === undefined ) { 
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    21
	var IriSP = {}; 
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    22
	var __IriSP = IriSP; /* for backward compatibility */
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    23
}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    24
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    25
		
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    26
// Official instance - to refactor ?
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    27
IriSP.MyLdt 		= null;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    28
IriSP.MyTags 		= null;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    29
IriSP.MyApiPlayer	= null;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    30
IriSP.player		= null;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    31
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    32
// genral var (old code) - to refactor 
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    33
IriSP.Durration		= null;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    34
IriSP.playerLdtWidth	= null;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    35
IriSP.playerLdtHeight	= null;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    36
71
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
    37
IriSP.loadLibs = function( libs, customCssPath, callback ) {
55
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    38
		// Localize jQuery variable
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    39
		IriSP.jQuery = null;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    40
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    41
		/* FIXME : to refactor using popcorn.getscript ? */
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    42
		/******** Load jQuery if not present *********/
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    43
		if ( window.jQuery === undefined || window.jQuery.fn.jquery !== '1.4.2' ) {
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    44
			
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    45
			var script_tag = document.createElement( 'script' );
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    46
			script_tag.setAttribute( "type", "text/javascript" );
71
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
    47
			script_tag.setAttribute( "src", libs.jQuery );
55
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    48
			
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    49
			script_tag.onload = scriptLibHandler;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    50
			script_tag.onreadystatechange = function () { // Same thing but for IE
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    51
				if ( this.readyState == 'complete' || this.readyState == 'loaded' ) {
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    52
					scriptLibHandler();					
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    53
				}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    54
			};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    55
			
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    56
			// Try to find the head, otherwise default to the documentElement
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    57
			( document.getElementsByTagName("head")[0] || document.documentElement ).appendChild( script_tag );
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    58
		} else {
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    59
			// The jQuery version on the window is the one we want to use
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    60
			 IriSP.jQuery = window.jQuery;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    61
			 scriptLibHandler();
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    62
		}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    63
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    64
		/******** Called once jQuery has loaded ******/
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    65
		function scriptLibHandler() {
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    66
			
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    67
			var script_jqUi_tooltip = document.createElement( 'script' );
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    68
			script_jqUi_tooltip.setAttribute( "type", "text/javascript" );
71
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
    69
			script_jqUi_tooltip.setAttribute( "src", libs.jQueryToolTip );
55
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    70
			script_jqUi_tooltip.onload = scriptLoadHandler;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    71
			script_jqUi_tooltip.onreadystatechange = function () { // Same thing but for IE
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    72
				if ( this.readyState == 'complete' || this.readyState == 'loaded' ) {
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    73
					scriptLoadHandler( "jquery.tools.min.js loded" );
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    74
				}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    75
			};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    76
			
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    77
			var script_swfObj = document.createElement('script');
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    78
			script_swfObj.setAttribute( "type","text/javascript" );
71
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
    79
			script_swfObj.setAttribute( "src",libs.swfObject );
55
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    80
			script_swfObj.onload = scriptLoadHandler;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    81
			script_swfObj.onreadystatechange = function () { // Same thing but for IE
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    82
				if ( this.readyState == 'complete' || this.readyState == 'loaded' ) {
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    83
					scriptLoadHandler( "swfobject.js loded" );
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    84
				}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    85
			};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    86
		
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    87
			var script_jqUi = document.createElement( 'script' );
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    88
			script_jqUi.setAttribute( "type","text/javascript" );
71
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
    89
			script_jqUi.setAttribute( "src",libs.jQueryUI );
55
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    90
			script_jqUi.onload = scriptLoadHandler;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    91
			script_jqUi.onreadystatechange = function () { // Same thing but for IE
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    92
				if ( this.readyState == 'complete' || this.readyState == 'loaded' ) {
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    93
					scriptLoadHandler( "jquery-ui.min.js loded" );
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    94
				}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    95
			};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    96
		
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    97
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    98
			( document.getElementsByTagName("head")[0] || document.documentElement ).appendChild( script_jqUi_tooltip);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
    99
			( document.getElementsByTagName("head")[0] || document.documentElement ).appendChild( script_jqUi );
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   100
			( document.getElementsByTagName("head")[0] || document.documentElement ).appendChild( script_swfObj );
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   101
			
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   102
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   103
		};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   104
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   105
		/******** Called once all lib are loaded ******/
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   106
		var loadLib = 0;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   107
		/* FIXME : ugly */
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   108
		function scriptLoadHandler( Mylib ) {
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   109
			//alert(Mylib);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   110
			loadLib +=1;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   111
			if( loadLib===3 ) { 
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   112
				main(); 			  
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   113
			}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   114
		};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   115
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   116
		/******** Our main function ********/
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   117
		function main() { 
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   118
			
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   119
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   120
			//  Make our own IriSP.jQuery and restore window.jQuery if there was one. 
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   121
			IriSP.jQuery = window.jQuery.noConflict( true );
71
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
   122
			// Call our Jquery
55
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   123
			IriSP.jQuery( document ).ready( function($) { 
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   124
				
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   125
				/******* Load CSS *******/
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   126
				var css_link_jquery = IriSP.jQuery( "<link>", { 
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   127
					rel: "stylesheet", 
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   128
					type: "text/css", 
71
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
   129
					href: libs.cssjQueryUI,
55
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   130
					'class': "dynamic_css"
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   131
				} );
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   132
				var css_link_custom = IriSP.jQuery( "<link>", { 
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   133
					rel: "stylesheet", 
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   134
					type: "text/css", 
71
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
   135
					href: customCssPath,
55
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   136
					'class': "dynamic_css"
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   137
				} );
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   138
				
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   139
				css_link_jquery.appendTo( 'head' );
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   140
				css_link_custom.appendTo( 'head' );   
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   141
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   142
				// to see dynamicly loaded css on IE
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   143
				if ( $.browser.msie ) {
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   144
					$( '.dynamic_css' ).clone().appendTo( 'head' );
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   145
				}
71
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
   146
        
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
   147
        callback();
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
   148
      });
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
   149
    }
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
   150
};
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
   151
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
   152
IriSP.init = function ( config ) {		
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
   153
		if ( config === null ) {
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
   154
			IriSP.config 			 = IriSP.configDefault;
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
   155
		} else {
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
   156
			
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
   157
			IriSP.config 			 = config;
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
   158
						
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
   159
			if ( IriSP.config.player.params == null ) {
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
   160
				IriSP.config.player.params = IriSP.configDefault.player.params;
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
   161
			}
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
   162
			
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
   163
			if ( IriSP.config.player.flashvars == null ) {
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
   164
				IriSP.config.player.flashvars = IriSP.configDefault.player.flashvars;
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
   165
			}
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
   166
			
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
   167
			if ( IriSP.config.player.attributes == null ) {
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
   168
				IriSP.config.player.attributes = IriSP.configDefault.player.attributes;
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
   169
			}
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
   170
		}
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
   171
		
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
   172
		var metadataSrc 		 = IriSP.config.metadata.src;
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
   173
		var guiContainer		 = IriSP.config.gui.container;
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
   174
		var guiMode				 = IriSP.config.gui.mode;
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
   175
		var guiLdtShareTool		 = IriSP.LdtShareTool;
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
   176
		
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
   177
    IriSP.loadLibs(IriSP.lib, IriSP.config.gui.css, function() {
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
   178
    	IriSP.createPlayerChrome();			
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
   179
      /******* Load Metadata *******/
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
   180
      IriSP.getMetadata();	
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
   181
    });
55
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   182
				
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   183
				//__IriSP.trace("main","ready createMyHtml");
71
7bc3a4651ec3 broke up initialization in two functions :
hamidouk
parents: 56
diff changeset
   184
						
55
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   185
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   186
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   187
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   188
__IriSP.Media = function ( id, url, duration, title, description ) {
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   189
		this.id 		 	= id;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   190
		this.url 		= url;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   191
		this.title 		= title;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   192
		this.description = description;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   193
		this.duration 	= duration;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   194
		this.lignes 	  	= new Array();
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   195
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   196
		IriSP.trace( "__IriSP.Media" , "Media ID : "+id);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   197
		IriSP.trace( "__IriSP.Media" , "Media URL : "+url);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   198
		IriSP.trace( "__IriSP.Media" , "Media title : "+title);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   199
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   200
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   201
__IriSP.Media.prototype.createPlayerMedia = function ( width, height, MyStreamer, MySwfPath) {
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   202
		IriSP.MyApiPlayer = new __IriSP.APIplayer( width, height, this.url, this.duration, MyStreamer, MySwfPath);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   203
		//createPlayer(width,height,this.url,this.duration,MyStreamer,MySwfPath);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   204
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   205
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   206
__IriSP.Media.prototype.getMediaDuration = function () {
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   207
		return (this.duration);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   208
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   209
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   210
__IriSP.Media.prototype.getMediaTitle = function (){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   211
		return (this.title);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   212
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   213
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   214
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   215
__IriSP.APIplayer = function ( width, height, url, duration, streamerPath, MySwfPath){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   216
		
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   217
		
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   218
		this.player 			= null;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   219
		this.hashchangeUpdate 	= null;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   220
		
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   221
		this.width				= width;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   222
		this.height				= height;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   223
		this.url				= url;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   224
		this.duration			= duration;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   225
		this.streamerPath		= streamerPath;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   226
		this.MySwfPath			= MySwfPath;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   227
		
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   228
		IriSP.MyApiPlayer		= this;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   229
		
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   230
		IriSP.createPlayer( this.url, this.streamerPath );
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   231
		IriSP.trace( "__IriSP.APIplayer", "__IriSP.createPlayer" );
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   232
	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   233
	//__IriSP.config.player
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   234
	/*
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   235
	- dailymotion  // &enableApi=1&chromeless=1
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   236
	- youtube 
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   237
	- html5
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   238
	- flowplayer 
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   239
	- jwplayer
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   240
	*/
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   241
		
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   242
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   243
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   244
__IriSP.APIplayer.prototype.ready = function( player ) {
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   245
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   246
	//__IriSP.trace("__IriSP.APIplayer.prototype.APIpReady"," __IriSP.createInterface");
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   247
	IriSP.createInterface( this.width, this.height, this.duration );
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   248
	//__IriSP.trace("__IriSP.APIplayer.prototype.APIpReady","END  __IriSP.createInterface");
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   249
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   250
	// Search
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   251
	//__IriSP.jQuery("#LdtSearchInput").change(function() {__IriSP.Search(this.value);});
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   252
	//__IriSP.jQuery("#LdtSearchInput").live('change', function(event) {__IriSP.Search(this.value);}); 
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   253
	IriSP.jQuery( "#LdtSearchInput" ).keydown( function() { IriSP.Search( this.value );} );
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   254
	IriSP.jQuery("#LdtSearchInput").keyup( function() { IriSP.Search( this.value );} );
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   255
	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   256
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   257
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   258
__IriSP.APIplayer.prototype.pause = function(){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   259
	this.hashchangeUpdate = true;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   260
	IriSP.player.sendEvent( 'PAUSE' );
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   261
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   262
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   263
__IriSP.APIplayer.prototype.play  = function() {  
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   264
	this.hashchangeUpdate = true;  
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   265
  var status = IriSP.player.media.paused;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   266
      
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   267
  if ( status == true ){        
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   268
    IriSP.player.play();
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   269
  } else {
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   270
    IriSP.player.pause();
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   271
  }
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   272
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   273
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   274
__IriSP.APIplayer.prototype.mute  = function() {
56
72180e18b021 A lot of cleaning up - basically replaced all player-specific code by popcorn.
hamidouk
parents: 55
diff changeset
   275
  if (!IriSP.player.muted()) {    
72180e18b021 A lot of cleaning up - basically replaced all player-specific code by popcorn.
hamidouk
parents: 55
diff changeset
   276
    IriSP.player.mute(true);
72180e18b021 A lot of cleaning up - basically replaced all player-specific code by popcorn.
hamidouk
parents: 55
diff changeset
   277
    IriSP.jQuery(" .ui-icon-volume-on ").css("background-position", "-130px -160px");    
72180e18b021 A lot of cleaning up - basically replaced all player-specific code by popcorn.
hamidouk
parents: 55
diff changeset
   278
  } else {
72180e18b021 A lot of cleaning up - basically replaced all player-specific code by popcorn.
hamidouk
parents: 55
diff changeset
   279
    IriSP.player.mute(false);
72180e18b021 A lot of cleaning up - basically replaced all player-specific code by popcorn.
hamidouk
parents: 55
diff changeset
   280
    IriSP.jQuery( ".ui-icon-volume-on" ).css("background-position", "-144px -160px" );
72180e18b021 A lot of cleaning up - basically replaced all player-specific code by popcorn.
hamidouk
parents: 55
diff changeset
   281
  }
72180e18b021 A lot of cleaning up - basically replaced all player-specific code by popcorn.
hamidouk
parents: 55
diff changeset
   282
55
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   283
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   284
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   285
__IriSP.APIplayer.prototype.share = function( network ) {
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   286
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   287
	/* FIXME : remove hardcoded */
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   288
	var MyMessage = encodeURIComponent( "J'écoute Les Retours du Dimanche : " );
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   289
	var MyURLNow = window.location.href;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   290
	var shareURL = null;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   291
	//alert(network+" : "+MyURLNow);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   292
	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   293
	/* FIXME : use a sharing library */
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   294
	if(network == "facebook"){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   295
			shareURL = "http://www.facebook.com/share.php?u=";			
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   296
		}else if(network == "twitter"){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   297
			shareURL  = "http://twitter.com/home?status="+MyMessage;	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   298
		}else if(network == "myspace"){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   299
			shareURL ="http://www.myspace.com/Modules/PostTo/Pages/?u=";
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   300
		}else if(network == "delicious"){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   301
			shareURL = "http://delicious.com/save?url=";
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   302
		}else if(network == "JameSpot"){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   303
			shareURL = "http://www.jamespot.com/?action=spotit&u=";
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   304
			//alert(network+" non actif pour l'instant : "+MyURLNow);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   305
	}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   306
	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   307
	if (shareURL != null)
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   308
		window.open( shareURL+encodeURIComponent(MyURLNow) );
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   309
	//window.location.href = shareURL+encodeURIComponent(MyURLNow);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   310
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   311
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   312
__IriSP.APIplayer.prototype.seek = function (time) {
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   313
	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   314
	if( time==0 ) { time=1; }
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   315
	
56
72180e18b021 A lot of cleaning up - basically replaced all player-specific code by popcorn.
hamidouk
parents: 55
diff changeset
   316
	IriSP.trace( "__IriSP.APIplayer.prototype.seek", time );	
72180e18b021 A lot of cleaning up - basically replaced all player-specific code by popcorn.
hamidouk
parents: 55
diff changeset
   317
	IriSP.player.currentTime( time );		
55
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   318
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   319
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   320
IriSP.currentPosition 	= 0; 
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   321
IriSP.player 			= null;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   322
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   323
IriSP.createPlayer = function ( url, streamerPath ) {
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   324
  IriSP.jQuery("#Ldt-PlaceHolder").html(""); // clear the message "you need flash to display this player
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   325
  
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   326
	if( IriSP.config.player.type=='dailymotion' ) {
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   327
  
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   328
		IriSP.config.player.src = IriSP.config.player.src+"&chromeless=1&enableApi=1";
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   329
	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   330
  } else if ( IriSP.config.player.type=='youtube' ) {
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   331
	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   332
    
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   333
    templ = "width: {{width}}px; height: {{height}}px; margin-bottom: 5px;";
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   334
    var str = Mustache.to_html(templ, {width: IriSP.config.gui.width, height: IriSP.config.gui.height});    
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   335
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   336
    // Popcorn.youtube wants us to specify the size of the player in the style attribute of its container div.
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   337
    IriSP.jQuery("#Ldt-PlaceHolder").attr("style", str);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   338
    
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   339
    IriSP.player = Popcorn.youtube( '#Ldt-PlaceHolder', IriSP.config.player.src, {"controls": 0} );    
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   340
    
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   341
	} else if ( IriSP.config.player.type=='jwplayer' ) {
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   342
    
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   343
    // for some reason, a stream won't play when it's display: none;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   344
    IriSP.jQuery("#Ldt-PlaceHolder").attr("style", "visibility: hidden;");
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   345
    IriSP.player = Popcorn.jwplayer( '#Ldt-PlaceHolder', "", 
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   346
                                     {file : "video/franceculture/franceculture_retourdudimanche20100620.flv", streamer: streamerPath, flashplayer : IriSP.config.player.src,
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   347
                                     live: true, "controlbar.position" : "none", height: IriSP.config.gui.height, width: IriSP.config.gui.width, provider: "rtmp"} ); 
56
72180e18b021 A lot of cleaning up - basically replaced all player-specific code by popcorn.
hamidouk
parents: 55
diff changeset
   348
                               
55
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   349
  }
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   350
 
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   351
  IriSP.player.listen("timeupdate", IriSP.positionListener);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   352
  IriSP.player.listen("volumechange", IriSP.volumeListener);
56
72180e18b021 A lot of cleaning up - basically replaced all player-specific code by popcorn.
hamidouk
parents: 55
diff changeset
   353
  IriSP.player.listen("play", IriSP.stateMonitor);
72180e18b021 A lot of cleaning up - basically replaced all player-specific code by popcorn.
hamidouk
parents: 55
diff changeset
   354
  IriSP.player.listen("pause", IriSP.stateMonitor);
55
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   355
  IriSP.MyApiPlayer.ready();
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   356
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   357
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   358
56
72180e18b021 A lot of cleaning up - basically replaced all player-specific code by popcorn.
hamidouk
parents: 55
diff changeset
   359
IriSP.stateMonitor = function () {      
72180e18b021 A lot of cleaning up - basically replaced all player-specific code by popcorn.
hamidouk
parents: 55
diff changeset
   360
	 if(IriSP.player.paused()) {				    
72180e18b021 A lot of cleaning up - basically replaced all player-specific code by popcorn.
hamidouk
parents: 55
diff changeset
   361
		IriSP.jQuery( ".ui-icon-play" ).css( "background-position","0px -160px" );
72180e18b021 A lot of cleaning up - basically replaced all player-specific code by popcorn.
hamidouk
parents: 55
diff changeset
   362
    IriSP.jQuery( "#ldt-CtrlPlay" ).attr("title", "Pause");
72180e18b021 A lot of cleaning up - basically replaced all player-specific code by popcorn.
hamidouk
parents: 55
diff changeset
   363
	} else { /* playing */	
72180e18b021 A lot of cleaning up - basically replaced all player-specific code by popcorn.
hamidouk
parents: 55
diff changeset
   364
		IriSP.jQuery( ".ui-icon-play" ).css( "background-position", "-16px -160px" );
72180e18b021 A lot of cleaning up - basically replaced all player-specific code by popcorn.
hamidouk
parents: 55
diff changeset
   365
    IriSP.jQuery( "#ldt-CtrlPlay" ).attr("title", "Play");
55
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   366
	}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   367
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   368
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   369
IriSP.positionListener = function() {  	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   370
	IriSP.currentPosition = IriSP.player.currentTime(); 
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   371
  
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   372
	var tmp = document.getElementById( "posit" );
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   373
	if (tmp) { tmp.innerHTML = "position: " + IriSP.currentPosition; }
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   374
	IriSP.jQuery( "#slider-range-min" ).slider( "value", IriSP.currentPosition);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   375
	IriSP.jQuery( "#amount" ).val(IriSP.currentPosition+" s");
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   376
	// display annotation 
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   377
	IriSP.MyLdt.checkTime( IriSP.currentPosition );
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   378
	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   379
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   380
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   381
IriSP.volumeListener   = function (obj) { 
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   382
	IriSP.currentVolume = obj.volume; 
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   383
	var tmp = document.getElementById("vol");
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   384
	if (tmp) { tmp.innerHTML = "volume: " + IriSP.currentVolume; }
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   385
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   386
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   387
/* 	utils */
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   388
// code from http://stackoverflow.com/questions/822452/strip-html-from-text-javascript
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   389
/* FIXME: maybe make it a little more robust */
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   390
IriSP.stripHtml = function(s){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   391
	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;');
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   392
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   393
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   394
// conversion de couleur Decimal vers HexaDecimal || 000 si fff
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   395
/* FIXME : move it somewhere else */
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   396
IriSP.DEC_HEXA_COLOR = function (dec) {
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   397
	 var hexa='0123456789ABCDEF',hex='';
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   398
	 var tmp;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   399
	 while (dec>15){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   400
		  tmp = dec-(Math.floor(dec/16))*16;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   401
		  hex = hexa.charAt(tmp)+hex;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   402
		  dec = Math.floor(dec/16);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   403
	 }
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   404
	 hex = hexa.charAt(dec)+hex;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   405
	 if (hex == "FFCC00"){ hex="";/* by default color of Ldt annotation */ }
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   406
	 return(hex);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   407
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   408
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   409
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   410
/* Search  methods	*/
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   411
IriSP.SearchOldValue="";
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   412
IriSP.searchblockOpen=false;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   413
IriSP.searchblock = function () {
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   414
	IriSP.trace( "__IriSP.searchblock", IriSP.searchblockOpen );
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   415
	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   416
	if ( IriSP.searchblockOpen == false ) {
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   417
		IriSP.jQuery( ".ui-icon-search" ).css( "background-position", "-144px -112px" );
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   418
		//__IriSP.jQuery("#LdtSearch").animate({height:26},250);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   419
		IriSP.jQuery("#LdtSearch").show(250);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   420
		/* FIXME : refactor this */
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   421
		IriSP.jQuery("#LdtSearchInput").css('background-color','#fff');
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   422
		IriSP.jQuery("#LdtSearchInput").focus();
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   423
		IriSP.jQuery("#LdtSearchInput").attr('value',IriSP.SearchOldValue);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   424
		IriSP.Search(IriSP.SearchOldValue);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   425
		IriSP.searchblockOpen = true;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   426
	} else {
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   427
		IriSP.SearchOldValue = IriSP.jQuery("#LdtSearchInput").attr('value');
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   428
		IriSP.jQuery("#LdtSearchInput").attr('value','');
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   429
		IriSP.SearchClean();
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   430
		IriSP.jQuery(".ui-icon-search").css("background-position","-160px -112px");
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   431
		//__IriSP.jQuery("#LdtSearch").animate({height:0},250);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   432
		IriSP.jQuery("#LdtSearch").hide(250);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   433
		IriSP.searchblockOpen = false;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   434
	}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   435
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   436
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   437
/* Search with typeahead */
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   438
IriSP.Search = function ( value ){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   439
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   440
	annotations = IriSP.LDTligne.annotations;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   441
	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   442
	IriSP.trace("__IriSP.Search", annotations.length+" "+value);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   443
	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   444
	var found  = 0;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   445
	var findmem = 0;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   446
	var factor  = 0;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   447
	IriSP.trace(value,value.length);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   448
	var valueS = value.toLowerCase();
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   449
	IriSP.trace("__IriSP.Search", annotations.length+" "+valueS);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   450
	if(valueS.length>=3){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   451
		
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   452
		for (var i=0; i < annotations.length; ++i){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   453
			annotation = annotations[i];
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   454
			
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   455
			IriSP.jQuery("#output2").text(annotation.title+" ?= "+value);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   456
			
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   457
			chaine1 = annotation.title.toLowerCase();
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   458
			chaine2 = annotation.description.toLowerCase();
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   459
			chaine3 = annotation.htmlTags.toLowerCase();
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   460
			
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   461
			if(chaine1.indexOf(valueS,0) !=-1){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   462
				found+=1;	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   463
			}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   464
			if(chaine2.indexOf(valueS,0) !=-1){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   465
				found+=1;	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   466
			}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   467
			if(chaine3.indexOf(valueS,0) !=-1){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   468
				found+=1;	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   469
			}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   470
			
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   471
			findmem += found;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   472
			if(found>0){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   473
				factor = found*8;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   474
				IriSP.jQuery("#"+annotation.id).dequeue();
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   475
				IriSP.jQuery("#"+annotation.id).animate({height:factor},200);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   476
				IriSP.jQuery("#"+annotation.id).css('border','2px');
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   477
				IriSP.jQuery("#"+annotation.id).css('border-color','red');
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   478
				IriSP.jQuery("#"+annotation.id).animate({opacity:0.6},200);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   479
				
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   480
				IriSP.trace("!!!!!!!!!!!!!!!!!!"," ?= "+annotation.id);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   481
				IriSP.jQuery("#LdtSearchInput").css('background-color','#e1ffe1');
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   482
			}else {
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   483
				IriSP.jQuery("#"+annotation.id).dequeue();
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   484
				IriSP.jQuery("#"+annotation.id).animate({height:0},250);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   485
				IriSP.jQuery("#"+annotation.id).animate({opacity:0.3},200);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   486
			}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   487
			
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   488
			found = 0;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   489
		}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   490
		if(findmem==0){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   491
				IriSP.jQuery("#LdtSearchInput").css('background-color','#f6f6f6');
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   492
		}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   493
		
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   494
	} else if(value.length==0){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   495
		IriSP.SearchClean();
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   496
		IriSP.jQuery("#LdtSearchInput").css('background-color','#fff');		
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   497
	} else {
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   498
		IriSP.SearchClean();
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   499
		IriSP.jQuery("#LdtSearchInput").css('background-color','#f6f6f6');
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   500
	}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   501
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   502
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   503
IriSP.SearchClean = function (){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   504
	annotations = IriSP.LDTligne.annotations;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   505
	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   506
	for (var i=0; i < annotations.length; ++i){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   507
			annotation = annotations[i];
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   508
			IriSP.jQuery("#"+annotation.id).dequeue();
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   509
			IriSP.jQuery("#"+annotation.id).animate({height:0},100);	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   510
			IriSP.jQuery("#"+annotation.id).css('border','0px');
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   511
			IriSP.jQuery("#"+annotation.id).css('border-color','red');
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   512
			IriSP.jQuery("#"+annotation.id).animate({opacity:0.3},100);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   513
		}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   514
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   515
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   516
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   517
IriSP.SearchThisSegment = function (annotation){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   518
	/* FIXME: to implement */
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   519
					IriSP.jQuery("#LdtSearchInput").text(annotation.title);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   520
					IriSP.trace("__IriSP.Ligne.prototype.checkTimeLigne",annotation.title);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   521
					/*__IriSP.jQuery("#Ldt-SaDescription").text(annotationTempo.description);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   522
					__IriSP.jQuery("#Ldt-SaKeywordText").html("Mots clefs : "+annotationTempo.htmlTags);*/
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   523
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   524
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   525
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   526
/* CLASS Ligne (annotationType) 	*/
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   527
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   528
IriSP.LDTligne 	= null;		
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   529
__IriSP.Ligne = function( id, title, description, duration ) {
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   530
	this.id 		 = id;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   531
	this.title 		 = title;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   532
	this.description = description;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   533
	//
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   534
	this.annotations = new Array();
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   535
	this.duration = duration;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   536
	this.annotationOldRead = "";
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   537
	IriSP.LDTligne = this;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   538
	IriSP.trace("__IriSP.Ligne","CREATE "+IriSP.LDTligne);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   539
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   540
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   541
__IriSP.Ligne.prototype.addAnnotation = function ( id, begin, end, media, title, description, color, tags ) {
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   542
	var myAnnotation = new __IriSP.Annotation(id,begin,end,media,title,description,color,tags,this.duration);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   543
	this.annotations.push(myAnnotation);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   544
	//__IriSP.trace("__IriSP.Ligne.prototype.addAnnotation  ","add annotation "+title);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   545
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   546
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   547
__IriSP.Ligne.prototype.onClickLigneAnnotation = function( id ) {
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   548
	/* TODO implement */
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   549
	//changePageUrlOffset(currentPosition);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   550
	//player.sendEvent('SEEK', this.start);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   551
	//__IriSP.trace("SEEK",this.start);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   552
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   553
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   554
__IriSP.Ligne.prototype.searchLigneAnnotation = function( id ) {
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   555
	/* TODO implement */
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   556
	/*for (){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   557
	}*/
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   558
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   559
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   560
__IriSP.Ligne.prototype.listAnnotations = function() {
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   561
	/* TODO implement */
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   562
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   563
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   564
__IriSP.Ligne.prototype.nextAnnotation = function () {
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   565
	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   566
	var annotationCibleNumber = this.numAnnotation(this.annotationOldRead)+1;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   567
	var annotationCible = this.annotations[annotationCibleNumber];  
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   568
  
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   569
	if( annotationCibleNumber<this.annotations.length-1 ){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   570
		IriSP.player.currentTime(annotationCible.begin/1000);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   571
		IriSP.trace( "LIGNE  ", "| next = "+annotationCibleNumber+" - "+this.annotations.length+" | seek :"+annotationCible.begin/1000);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   572
	} else {    
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   573
		IriSP.player.currentTime(this.annotations[0].begin/1000);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   574
	}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   575
		
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   576
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   577
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   578
__IriSP.Ligne.prototype.numAnnotation = function (annotationCible){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   579
	for (var i=0; i < this.annotations.length; ++i){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   580
		if(annotationCible == this.annotations[i]){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   581
			return i;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   582
		}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   583
	}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   584
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   585
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   586
__IriSP.Ligne.prototype.checkTime = function(time){	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   587
	var annotationTempo = -1;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   588
	//__IriSP.trace("__IriSP.Ligne.prototype.checkTimeLigne",time);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   589
	//__IriSP.trace("__IriSP.Ligne.prototype.checkTimeLigne",this.annotations.length);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   590
	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   591
	for (var i=0; i < this.annotations.length; ++i){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   592
		annotationTempo = this.annotations[i];	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   593
		
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   594
		//__IriSP.SearchThisSegment(annotationTempo);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   595
		
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   596
		if (time>annotationTempo.begin/1000 && time<annotationTempo.end/1000){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   597
			
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   598
				// different form the previous
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   599
				if(annotationTempo!=this.annotationOldRead){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   600
					this.annotationOldRead = annotationTempo;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   601
					IriSP.jQuery("#Ldt-SaTitle").text(annotationTempo.title);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   602
					IriSP.jQuery("#Ldt-SaDescription").text(annotationTempo.description);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   603
					IriSP.jQuery("#Ldt-SaKeywordText").html("Mots clefs : "+annotationTempo.htmlTags);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   604
					
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   605
					//__IriSP.jQuery('#Ldt-ShowAnnotation').slideDown();
90
1ea53c071ebe indent cleanup
hamidouk
parents: 71
diff changeset
   606
					var startPourcent = annotationTempo.timeToPourcent((annotationTempo.begin*1+(annotationTempo.end*1-annotationTempo.begin*1)/2),annotationTempo.duration*1); 
55
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   607
					IriSP.jQuery("#Ldt-Show-Arrow").animate({left:startPourcent+'%'},1000);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   608
					IriSP.jQuery("#"+annotationTempo.id).animate({alpha:'100%'},1000);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   609
					//alert(startPourcent);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   610
					var tempolinkurl  =  IriSP.ignoreTimeFragment(window.location.href)+"#t="+(this.annotations[i].begin/1000);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   611
				}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   612
			break;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   613
		} else {
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   614
		annotationTempo = -1;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   615
		}		
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   616
		
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   617
	}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   618
	// si il y en a pas : retractation du volet 
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   619
	if( annotationTempo == -1){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   620
		if(annotationTempo != this.annotationOldRead){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   621
			IriSP.trace("Check : ","pas d'annotation ici ");
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   622
			IriSP.jQuery("#Ldt-SaTitle").text("");
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   623
			IriSP.jQuery("#Ldt-SaDescription").text("");
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   624
			IriSP.jQuery("#Ldt-SaKeywordText").html("");
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   625
			IriSP.jQuery('#Ldt-ShowAnnotation').slideUp();
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   626
			if(this.annotationOldRead){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   627
				IriSP.jQuery("#"+this.annotationOldRead.id).animate({alpha:'70%'},1000);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   628
			}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   629
			//__IriSP.jQuery("#Ldt-Show-Arrow").animate({left:'0%'},1000);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   630
			this.annotationOldRead = annotationTempo;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   631
		}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   632
	}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   633
	//__IriSP.trace("__IriSP.Ligne.prototype.checkTimeLigne",annotationTempo);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   634
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   635
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   636
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   637
/* CLASS Annotation */
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   638
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   639
__IriSP.Annotation = function (){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   640
	var id 	= null;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   641
	var begin 			= null;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   642
	var end 			= null;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   643
	var media 			= null;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   644
	var description	= null;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   645
	var title 			= null;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   646
	var color 			= null;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   647
	var tags			= null;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   648
	IriSP.trace("annotation ","réussi");
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   649
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   650
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   651
__IriSP.Annotation = function( id, begin, end, media, title, description, color, tags, duration ){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   652
	this.id 			= id;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   653
	this.begin 			= begin;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   654
	this.end 			= end;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   655
	this.media 			= media;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   656
	this.description 	= description;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   657
	this.title 			= title;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   658
	this.color 			= color;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   659
	this.tags			= tags;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   660
	this.htmlTags		= "";
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   661
	this.duration		= duration;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   662
	// draw it 
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   663
	this.draw();
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   664
	this.drawTags();
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   665
	//
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   666
	IriSP.trace("Annotation created : ",id);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   667
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   668
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   669
__IriSP.Annotation.prototype.draw = function(){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   670
	//alert (this.duration);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   671
	var startPourcent 	= this.timeToPourcent(this.begin,this.duration); // temps du media 
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   672
	var endPourcent 	= this.timeToPourcent(this.end,this.duration)-startPourcent;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   673
	var divTitle		= this.title.substr(0,55);	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   674
		
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   675
	IriSP.jQueryAnnotationTemplate = Mustache.to_html(IriSP.annotation_template,
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   676
			{"divTitle" : divTitle, "id" : this.id, "startPourcent" : startPourcent,
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   677
			"endPourcent" : endPourcent, "hexa_color" : IriSP.DEC_HEXA_COLOR(this.color),
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   678
			"seekPlace" : Math.round(this.begin/1000)});
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   679
	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   680
	IriSP.jQuerytoolTipTemplate = Mustache.to_html(IriSP.tooltip_template, 
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   681
				{"title" : this.title, "begin" : this.begin, "end" : this.end,
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   682
				"description": this.description});
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   683
	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   684
	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   685
	IriSP.jQuery("<div>"+IriSP.jQueryAnnotationTemplate+"</div>").appendTo("#Ldt-Annotations");
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   686
	// TOOLTIP BUG ! 
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   687
	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   688
	IriSP.jQuery("#"+this.id).tooltip({ effect: 'slide'});
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   689
	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   690
	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   691
	IriSP.jQuery("#"+this.id).fadeTo(0,0.3);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   692
	IriSP.jQuery("#"+this.id).mouseover(function() {
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   693
		IriSP.jQuery("#"+this.id).animate({opacity: 0.6}, 5);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   694
	}).mouseout(function(){		
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   695
		IriSP.jQuery("#"+this.id).animate({opacity: 0.3}, 5);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   696
	});
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   697
	IriSP.trace("__IriSP.Annotation.prototype.draw","ADD ANOTATION : "+this.begin+" "+this.end+" "+IriSP.stripHtml(this.title)+" | "+startPourcent+" | "+endPourcent+" | duration = "+this.duration);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   698
	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   699
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   700
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   701
__IriSP.Annotation.prototype.drawTags = function(){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   702
	/* FIXME : to implement */
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   703
	var KeywordPattern = '<a href=\"\"> '+' </a>';
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   704
	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   705
	//__IriSP.trace(" !? Tags : ",this.tags);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   706
	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   707
	if (this.tags!=undefined){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   708
		for (var i = 0; i < this.tags.length; ++i){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   709
			
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   710
			//this.htmlTags += '<span onclick=\"ShowTag('+this.tags[i]['id-ref']+');\"  > '+MyTags.getTitle(this.tags[i]['id-ref'])+' </span>'+" , ";
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   711
			this.htmlTags += '<span> '+IriSP.MyTags.getTitle(this.tags[i]['id-ref'])+' </span>'+" , ";
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   712
			
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   713
		}		
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   714
	}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   715
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   716
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   717
__IriSP.Annotation.prototype.tootTipAnnotation = function() {
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   718
	// 1 chercher le div correspondant
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   719
	// 2 y mettre les information
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   720
	return this.color + ' ' + this.type + ' apple';
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   721
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   722
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   723
__IriSP.Annotation.prototype.onRollOverAnnotation = function (){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   724
	this.tootTip();
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   725
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   726
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   727
__IriSP.Annotation.prototype.timeToPourcent = function(time,timetotal){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   728
	return (parseInt(Math.round(time/timetotal*100)));
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   729
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   730
 
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   731
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   732
/* CLASS Tags */
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   733
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   734
__IriSP.Tags = function(object){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   735
	this.myTags 	=	object;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   736
	this.htmlTags 	= 	null;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   737
	this.weigthMax 	= 	0;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   738
	//this.mySegments  = 	new array();
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   739
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   740
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   741
__IriSP.Tags.prototype.addAnnotation = function (annotation){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   742
	for (var i = 0; i < this.myTags.length; ++i){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   743
		this.myTags[i].mySegments = new Array(); 
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   744
		if (annotation.tags!=null){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   745
			for (var j = 0; j < annotation.tags.length; ++j){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   746
				if (this.myTags[i]['id'] == annotation.tags[j]['id-ref']){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   747
					this.myTags[i].mySegments.push([annotation.begin,annotation.end,annotation.id]);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   748
					var weigthTempo = this.myTags[i].mySegments.length;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   749
					var tempo = this.myTags[i].mySegments[weigthTempo-1];
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   750
					//__IriSP.trace ("__IriSP.Tags.prototype.addAnnotation ","  "+this.myTags[i]['meta']['dc:title']+" "+this.myTags[i]['id']+" : "+tempo[0]+" - "+tempo[1]);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   751
					
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   752
					if (this.weigthMax < weigthTempo ){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   753
						this.weigthMax = weigthTempo;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   754
					}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   755
				}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   756
			}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   757
		}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   758
	}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   759
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   760
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   761
__IriSP.Tags.prototype.getTitle = function (id){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   762
	for (var i = 0; i < this.myTags.length; ++i){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   763
		if(this.myTags[i]['id']==id){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   764
			return(this.myTags[i]['meta']['dc:title']);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   765
		}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   766
	}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   767
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   768
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   769
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   770
__IriSP.Tags.prototype.draw = function (){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   771
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   772
	IriSP.trace("__IriSP.Tags.prototype.draw"," !!! WELL START " );
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   773
	for (var i = 0; i < this.myTags.length; ++i){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   774
		IriSP.trace("__IriSP.Tags.prototype.draw"," ADD Tags : "+this.myTags[i]['id']);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   775
		if(this.myTags[i]['id']!=null){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   776
		this.htmlTags += '<span onclick=\"MyTags.show( \''+this.myTags[i]['id']
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   777
						+'\');\" style=\"font-size:'  +((this.myTags[i].mySegments.length/this.weigthMax*10)+8)
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   778
						+'px;\" alt=\"'+this.myTags[i].mySegments.length
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   779
						+'\"> '+this.myTags[i]['meta']['dc:title']+' </span>'+' , ';
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   780
		}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   781
	}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   782
	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   783
	IriSP.jQuery('#Ldt-Tags').html(this.htmlTags);
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   784
	IriSP.trace("__IriSP.Tags.prototype.draw"," !!!!  END WMAX= "+this.weigthMax );
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   785
	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   786
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   787
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   788
__IriSP.Tags.prototype.show = function (id){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   789
	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   790
	var timeStartOffsetA	=	100000000000000000000;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   791
	var timeStartOffsetB	=	100000000000000000000;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   792
	var timeEndOffsetA		=	0;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   793
	var timeEndOffsetB		=	0;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   794
	var timeStartID;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   795
	var timeEndID;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   796
	var WidthPourCent;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   797
	var leftPourCent;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   798
	var timeStartOffset;
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   799
	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   800
	// case 1 : seul segment 
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   801
	// case 2 : 2 ou X segments 
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   802
	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   803
	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   804
	for (var i = 0; i < this.myTags.length; ++i){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   805
		if (this.myTags[i]['id']==id){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   806
			IriSP.trace("######### TAG DRAWing : "," END" );		
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   807
			
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   808
			for (var j = 0; j < this.myTags[i].mySegments.length; ++j){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   809
				if(timeStartOffset> this.myTags[i].mySegments[j][0]){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   810
					timeStartOffsetA = this.myTags[i].mySegments[j][0];
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   811
					timeStartOffsetB = this.myTags[i].mySegments[j][1];
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   812
					timeStartID		 = this.myTags[i].mySegments[j][2]
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   813
				}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   814
				if(timeStartOffset> this.myTags[i].mySegments[j][0]){
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   815
					timeEndOffsetA  = this.myTags[i].mySegments[j][0];
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   816
					timeEndOffsetB  = this.myTags[i].mySegments[j][1];
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   817
					timeEndID		= this.myTags[i].mySegments[j][2]
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   818
				}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   819
			}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   820
			
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   821
		}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   822
	}
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   823
	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   824
	// -------------------------------------------------
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   825
	// 
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   826
	// -------------------------------------------------
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   827
	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   828
	leftPourCent 	= IriSP.timeToPourcent((timeStartOffsetA*1+(timeStartOffsetB-timeStartOffsetA)/2),IriSP.MyLdt.duration); 
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   829
	WidthPourCent	= IriSP.timeToPourcent((timeEndOffsetA*1+(timeEndOffsetB-timeEndOffsetA)/2),IriSP.MyLdt.duration)-leftPourCent; 			
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   830
	//WidthPourCent	= timeToPourcent((timeEndOffsetA*1+(timeEndOffsetB-timeEndOffsetA)/2),MyLdt.duration)-startPourcent; 			
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   831
	IriSP.jQuery("#Ldt-Show-Tags").css('left',leftPourCent+'%');
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   832
	IriSP.jQuery("#Ldt-Show-Tags").css('width',WidthPourCent+'%');
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   833
	IriSP.jQuery("#Ldt-Show-Tags").text('joijoij');
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   834
	// like arrow script
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   835
	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   836
	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   837
	
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   838
};
a5440e1a18a8 A bunch of changes to make the code use popcorn. Bumped the version of jwplayer
hamidouk
parents: 43
diff changeset
   839