| author | hamidouk |
| Tue, 13 Sep 2011 14:57:11 +0200 | |
| changeset 44 | 1e295123f2a1 |
| parent 43 | 59a78986f19e |
| child 55 | a5440e1a18a8 |
| permissions | -rw-r--r-- |
| 31 | 1 |
/* |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2 |
* Copyright 2010 Institut de recherche et d'innovation |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3 |
* contributor(s) : Samuel Huron |
| 3 | 4 |
* Use Silvia Pfeiffer 's javascript mediafragment implementation |
5 |
* |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6 |
* contact@iri.centrepompidou.fr |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7 |
* http://www.iri.centrepompidou.fr |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8 |
* |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
9 |
* This software is a computer program whose purpose is to show and add annotations on a video . |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
10 |
* This software is governed by the CeCILL-C license under French law and |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
11 |
* abiding by the rules of distribution of free software. You can use, |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
12 |
* modify and/ or redistribute the software under the terms of the CeCILL-C |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
13 |
* license as circulated by CEA, CNRS and INRIA at the following URL |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
14 |
* "http://www.cecill.info". |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
15 |
* |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
16 |
* The fact that you are presently reading this means that you have had |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
17 |
* knowledge of the CeCILL-C license and that you accept its terms. |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
18 |
*/ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
19 |
|
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
20 |
if ( window.IriSP === undefined && window.__IriSP === undefined ) { |
| 22 | 21 |
var IriSP = {}; |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
22 |
var __IriSP = IriSP; /* for backward compatibility */ |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
23 |
} |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
24 |
|
| 4 | 25 |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
26 |
// Official instance - to refactor ? |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
27 |
IriSP.MyLdt = null; |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
28 |
IriSP.MyTags = null; |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
29 |
IriSP.MyApiPlayer = null; |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
30 |
IriSP.player = null; |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
31 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
32 |
// genral var (old code) - to refactor |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
33 |
IriSP.Durration = null; |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
34 |
IriSP.playerLdtWidth = null; |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
35 |
IriSP.playerLdtHeight = null; |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
36 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
37 |
|
| 31 | 38 |
IriSP.init = function ( config ) { |
| 22 | 39 |
if ( config === null ) { |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
40 |
IriSP.config = IriSP.configDefault; |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
41 |
} else { |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
42 |
|
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
43 |
IriSP.config = config; |
| 22 | 44 |
|
45 |
if ( IriSP.config.player.params == null ) { |
|
46 |
IriSP.config.player.params = IriSP.configDefault.player.params; |
|
47 |
} |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
48 |
|
| 22 | 49 |
if ( IriSP.config.player.flashvars == null ) { |
50 |
IriSP.config.player.flashvars = IriSP.configDefault.player.flashvars; |
|
51 |
} |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
52 |
|
| 22 | 53 |
if ( IriSP.config.player.attributes == null ) { |
54 |
IriSP.config.player.attributes = IriSP.configDefault.player.attributes; |
|
55 |
} |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
56 |
} |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
57 |
|
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
58 |
var metadataSrc = IriSP.config.metadata.src; |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
59 |
var guiContainer = IriSP.config.gui.container; |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
60 |
var guiMode = IriSP.config.gui.mode; |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
61 |
var guiLdtShareTool = IriSP.LdtShareTool; |
| 22 | 62 |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
63 |
// Localize jQuery variable |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
64 |
IriSP.jQuery = null; |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
65 |
|
| 31 | 66 |
/* FIXME : to refactor using popcorn.getscript ? */ |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
67 |
/******** Load jQuery if not present *********/ |
| 22 | 68 |
if ( window.jQuery === undefined || window.jQuery.fn.jquery !== '1.4.2' ) { |
69 |
|
|
70 |
var script_tag = document.createElement( 'script' ); |
|
71 |
script_tag.setAttribute( "type", "text/javascript" ); |
|
72 |
script_tag.setAttribute( "src", IriSP.lib.jQuery ); |
|
73 |
|
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
74 |
script_tag.onload = scriptLibHandler; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
75 |
script_tag.onreadystatechange = function () { // Same thing but for IE |
| 22 | 76 |
if ( this.readyState == 'complete' || this.readyState == 'loaded' ) { |
77 |
scriptLibHandler(); |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
78 |
} |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
79 |
}; |
| 22 | 80 |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
81 |
// Try to find the head, otherwise default to the documentElement |
| 22 | 82 |
( document.getElementsByTagName("head")[0] || document.documentElement ).appendChild( script_tag ); |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
83 |
} else { |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
84 |
// The jQuery version on the window is the one we want to use |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
85 |
IriSP.jQuery = window.jQuery; |
| 22 | 86 |
scriptLibHandler(); |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
87 |
} |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
88 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
89 |
/******** Called once jQuery has loaded ******/ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
90 |
function scriptLibHandler() { |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
91 |
|
| 22 | 92 |
var script_jqUi_tooltip = document.createElement( 'script' ); |
93 |
script_jqUi_tooltip.setAttribute( "type", "text/javascript" ); |
|
94 |
script_jqUi_tooltip.setAttribute( "src", IriSP.lib.jQueryToolTip ); |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
95 |
script_jqUi_tooltip.onload = scriptLoadHandler; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
96 |
script_jqUi_tooltip.onreadystatechange = function () { // Same thing but for IE |
| 22 | 97 |
if ( this.readyState == 'complete' || this.readyState == 'loaded' ) { |
98 |
scriptLoadHandler( "jquery.tools.min.js loded" ); |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
99 |
} |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
100 |
}; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
101 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
102 |
var script_swfObj = document.createElement('script'); |
| 22 | 103 |
script_swfObj.setAttribute( "type","text/javascript" ); |
104 |
script_swfObj.setAttribute( "src",IriSP.lib.swfObject ); |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
105 |
script_swfObj.onload = scriptLoadHandler; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
106 |
script_swfObj.onreadystatechange = function () { // Same thing but for IE |
| 22 | 107 |
if ( this.readyState == 'complete' || this.readyState == 'loaded' ) { |
108 |
scriptLoadHandler( "swfobject.js loded" ); |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
109 |
} |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
110 |
}; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
111 |
|
| 22 | 112 |
var script_jqUi = document.createElement( 'script' ); |
113 |
script_jqUi.setAttribute( "type","text/javascript" ); |
|
114 |
script_jqUi.setAttribute( "src",IriSP.lib.jQueryUI ); |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
115 |
script_jqUi.onload = scriptLoadHandler; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
116 |
script_jqUi.onreadystatechange = function () { // Same thing but for IE |
| 22 | 117 |
if ( this.readyState == 'complete' || this.readyState == 'loaded' ) { |
118 |
scriptLoadHandler( "jquery-ui.min.js loded" ); |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
119 |
} |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
120 |
}; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
121 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
122 |
|
| 22 | 123 |
( document.getElementsByTagName("head")[0] || document.documentElement ).appendChild( script_jqUi_tooltip); |
124 |
( document.getElementsByTagName("head")[0] || document.documentElement ).appendChild( script_jqUi ); |
|
125 |
( document.getElementsByTagName("head")[0] || document.documentElement ).appendChild( script_swfObj ); |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
126 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
127 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
128 |
}; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
129 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
130 |
/******** Called once all lib are loaded ******/ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
131 |
var loadLib = 0; |
| 22 | 132 |
/* FIXME : ugly */ |
133 |
function scriptLoadHandler( Mylib ) { |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
134 |
//alert(Mylib); |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
135 |
loadLib +=1; |
| 22 | 136 |
if( loadLib===3 ) { |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
137 |
main(); |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
138 |
} |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
139 |
}; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
140 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
141 |
/******** Our main function ********/ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
142 |
function main() { |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
143 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
144 |
|
| 22 | 145 |
// Make our own IriSP.jQuery and restore window.jQuery if there was one. |
146 |
IriSP.jQuery = window.jQuery.noConflict( true ); |
|
147 |
// Call ours Jquery |
|
148 |
IriSP.jQuery( document ).ready( function($) { |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
149 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
150 |
/******* Load CSS *******/ |
| 22 | 151 |
var css_link_jquery = IriSP.jQuery( "<link>", { |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
152 |
rel: "stylesheet", |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
153 |
type: "text/css", |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
154 |
href: IriSP.lib.cssjQueryUI, |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
155 |
'class': "dynamic_css" |
| 22 | 156 |
} ); |
157 |
var css_link_custom = IriSP.jQuery( "<link>", { |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
158 |
rel: "stylesheet", |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
159 |
type: "text/css", |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
160 |
href: IriSP.config.gui.css, |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
161 |
'class': "dynamic_css" |
| 22 | 162 |
} ); |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
163 |
|
| 22 | 164 |
css_link_jquery.appendTo( 'head' ); |
165 |
css_link_custom.appendTo( 'head' ); |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
166 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
167 |
// to see dynamicly loaded css on IE |
| 22 | 168 |
if ( $.browser.msie ) { |
169 |
$( '.dynamic_css' ).clone().appendTo( 'head' ); |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
170 |
} |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
171 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
172 |
//__IriSP.trace("main","ready createMyHtml"); |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
173 |
|
| 31 | 174 |
IriSP.createPlayerChrome(); |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
175 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
176 |
/******* Load Metadata *******/ |
| 31 | 177 |
IriSP.getMetadata(); |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
178 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
179 |
}); |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
180 |
} |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
181 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
182 |
}; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
183 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
184 |
|
| 22 | 185 |
__IriSP.Media = function ( id, url, duration, title, description ) { |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
186 |
this.id = id; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
187 |
this.url = url; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
188 |
this.title = title; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
189 |
this.description = description; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
190 |
this.duration = duration; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
191 |
this.lignes = new Array(); |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
192 |
|
| 22 | 193 |
IriSP.trace( "__IriSP.Media" , "Media ID : "+id); |
194 |
IriSP.trace( "__IriSP.Media" , "Media URL : "+url); |
|
195 |
IriSP.trace( "__IriSP.Media" , "Media title : "+title); |
|
196 |
}; |
|
197 |
||
198 |
__IriSP.Media.prototype.createPlayerMedia = function ( width, height, MyStreamer, MySwfPath) { |
|
199 |
IriSP.MyApiPlayer = new __IriSP.APIplayer( width, height, this.url, this.duration, MyStreamer, MySwfPath); |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
200 |
//createPlayer(width,height,this.url,this.duration,MyStreamer,MySwfPath); |
| 22 | 201 |
}; |
202 |
||
203 |
__IriSP.Media.prototype.getMediaDuration = function () { |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
204 |
return (this.duration); |
| 22 | 205 |
}; |
206 |
||
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
207 |
__IriSP.Media.prototype.getMediaTitle = function (){ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
208 |
return (this.title); |
| 22 | 209 |
}; |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
210 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
211 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
212 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
213 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
214 |
|
| 2 | 215 |
|
| 22 | 216 |
/* FIXME : API player - work in progress ... need refactoring of code */ |
217 |
__IriSP.APIplayer = function ( width, height, url, duration, streamerPath, MySwfPath){ |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
218 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
219 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
220 |
this.player = null; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
221 |
this.hashchangeUpdate = null; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
222 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
223 |
this.width = width; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
224 |
this.height = height; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
225 |
this.url = url; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
226 |
this.duration = duration; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
227 |
this.streamerPath = streamerPath; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
228 |
this.MySwfPath = MySwfPath; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
229 |
|
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
230 |
IriSP.MyApiPlayer = this; |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
231 |
|
| 22 | 232 |
IriSP.createPlayer( this.url, this.streamerPath ); |
233 |
IriSP.trace( "__IriSP.APIplayer", "__IriSP.createPlayer" ); |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
234 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
235 |
//__IriSP.config.player |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
236 |
/* |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
237 |
- dailymotion // &enableApi=1&chromeless=1 |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
238 |
- youtube |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
239 |
- html5 |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
240 |
- flowplayer |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
241 |
- jwplayer |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
242 |
*/ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
243 |
|
| 22 | 244 |
}; |
245 |
||
246 |
__IriSP.APIplayer.prototype.ready = function( player ) { |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
247 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
248 |
//__IriSP.trace("__IriSP.APIplayer.prototype.APIpReady"," __IriSP.createInterface"); |
| 22 | 249 |
IriSP.createInterface( this.width, this.height, this.duration ); |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
250 |
//__IriSP.trace("__IriSP.APIplayer.prototype.APIpReady","END __IriSP.createInterface"); |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
251 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
252 |
// hashchange EVENT |
| 22 | 253 |
if ( window.addEventListener ){ |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
254 |
|
| 22 | 255 |
// for firefox hashchange EVENT |
256 |
window.addEventListener( "hashchange", function() { |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
257 |
var url = window.location.href; |
| 22 | 258 |
var time = IriSP.retrieveTimeFragment( url ); |
259 |
IriSP.trace( "__IriSP.APIplayer.prototype.ready", time ); |
|
260 |
if( IriSP.MyApiPlayer.hashchangeUpdate==null ){ |
|
261 |
IriSP.MyApiPlayer.seek( time ); |
|
| 3 | 262 |
|
| 22 | 263 |
} else { |
264 |
IriSP.MyApiPlayer.hashchangeUpdate = null; |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
265 |
} |
| 22 | 266 |
}, false ); |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
267 |
|
| 22 | 268 |
} else if (window.attachEvent){ |
269 |
// for ie hashchange EVENT |
|
270 |
window.attachEvent( "onhashchange", function() { |
|
271 |
IriSP.trace( "hashchange",time ); |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
272 |
var url = window.location.href; |
| 22 | 273 |
var time = IriSP.retrieveTimeFragment( url ); |
274 |
if( IriSP.MyApiPlayer.hashchangeUpdate == null ){ |
|
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
275 |
IriSP.MyApiPlayer.seek(time); |
| 22 | 276 |
} else { |
277 |
IriSP.MyApiPlayer.hashchangeUpdate = null; |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
278 |
} |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
279 |
}, false); |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
280 |
} |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
281 |
|
| 2 | 282 |
// Search |
283 |
//__IriSP.jQuery("#LdtSearchInput").change(function() {__IriSP.Search(this.value);}); |
|
284 |
//__IriSP.jQuery("#LdtSearchInput").live('change', function(event) {__IriSP.Search(this.value);}); |
|
| 22 | 285 |
IriSP.jQuery( "#LdtSearchInput" ).keydown( function() { IriSP.Search( this.value );} ); |
286 |
IriSP.jQuery("#LdtSearchInput").keyup( function() { IriSP.Search( this.value );} ); |
|
| 2 | 287 |
|
| 22 | 288 |
}; |
289 |
||
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
290 |
__IriSP.APIplayer.prototype.pause = function(){ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
291 |
this.hashchangeUpdate = true; |
| 22 | 292 |
IriSP.player.sendEvent( 'PAUSE' ); |
293 |
}; |
|
294 |
||
295 |
__IriSP.APIplayer.prototype.play = function() { |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
296 |
this.hashchangeUpdate = true; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
297 |
//__IriSP.trace("__IriSP.config.player.type",__IriSP.config.player.type); |
| 22 | 298 |
if( IriSP.config.player.type=='jwplayer' ){ |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
299 |
|
| 22 | 300 |
IriSP.player.sendEvent( 'PLAY' ); |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
301 |
|
| 22 | 302 |
} else if(IriSP.config.player.type == 'dailymotion' |
303 |
|| IriSP.config.player.type == 'youtube' ) { |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
304 |
|
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
305 |
var status = IriSP.player.getPlayerState(); |
| 22 | 306 |
IriSP.trace( "__IriSP.APIplayer.prototype.play.status", status); |
307 |
if ( status != 1 ){ |
|
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
308 |
IriSP.player.playVideo(); |
| 22 | 309 |
} else { |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
310 |
IriSP.player.pauseVideo(); |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
311 |
} |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
312 |
} |
| 22 | 313 |
}; |
314 |
||
315 |
__IriSP.APIplayer.prototype.mute = function() { |
|
316 |
IriSP.player.sendEvent( 'MUTE' ); |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
317 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
318 |
//alert(__IriSP.jQuery(".ui-icon-volume-on").css("background-position-x")); |
| 22 | 319 |
/* FIXME : remove hardcoded values */ |
320 |
if ( IriSP.jQuery( ".ui-icon-volume-on" ).css( "background-position" ) == "-144px -160px" ){ |
|
321 |
IriSP.jQuery(" .ui-icon-volume-on ").css(" background-position ", "-130px -160px"); |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
322 |
} else { |
| 22 | 323 |
IriSP.jQuery( ".ui-icon-volume-on" ).css( "background-position", "-144px -160px" ); |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
324 |
} |
| 22 | 325 |
}; |
326 |
||
327 |
/* FIXME : rename */ |
|
328 |
__IriSP.APIplayer.prototype.share = function( network ) { |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
329 |
|
| 22 | 330 |
/* FIXME : remove hardcoded */ |
331 |
var MyMessage = encodeURIComponent( "J'écoute Les Retours du Dimanche : " ); |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
332 |
var MyURLNow = window.location.href; |
| 22 | 333 |
var shareURL = null; |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
334 |
//alert(network+" : "+MyURLNow); |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
335 |
|
| 22 | 336 |
/* FIXME : use a sharing library */ |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
337 |
if(network == "facebook"){ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
338 |
shareURL = "http://www.facebook.com/share.php?u="; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
339 |
}else if(network == "twitter"){ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
340 |
shareURL = "http://twitter.com/home?status="+MyMessage; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
341 |
}else if(network == "myspace"){ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
342 |
shareURL ="http://www.myspace.com/Modules/PostTo/Pages/?u="; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
343 |
}else if(network == "delicious"){ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
344 |
shareURL = "http://delicious.com/save?url="; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
345 |
}else if(network == "JameSpot"){ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
346 |
shareURL = "http://www.jamespot.com/?action=spotit&u="; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
347 |
//alert(network+" non actif pour l'instant : "+MyURLNow); |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
348 |
} |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
349 |
|
| 22 | 350 |
if (shareURL != null) |
351 |
window.open( shareURL+encodeURIComponent(MyURLNow) ); |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
352 |
//window.location.href = shareURL+encodeURIComponent(MyURLNow); |
| 22 | 353 |
}; |
354 |
||
355 |
__IriSP.APIplayer.prototype.seek = function (time) { |
|
356 |
|
|
357 |
if( time==0 ) { time=1; } |
|
358 |
|
|
359 |
IriSP.trace( "__IriSP.APIplayer.prototype.seek", time ); |
|
360 |
|
|
361 |
if( IriSP.config.player.type=='jwplayer') { |
|
| 3 | 362 |
//__IriSP.MyApiPlayer.play() |
| 22 | 363 |
IriSP.player.sendEvent( 'SEEK', time ); |
364 |
} else if( IriSP.config.player.type=='dailymotion' |
|
365 |
|| IriSP.config.player.type=='youtube' ) { |
|
366 |
IriSP.player.seekTo( time ); |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
367 |
} |
| 22 | 368 |
|
369 |
this.changePageUrlOffset( time ); |
|
370 |
}; |
|
371 |
||
372 |
__IriSP.APIplayer.prototype.update = function (time) { |
|
373 |
|
|
374 |
if( time != 0 ) { |
|
375 |
this.hashchangeUpdate = true; |
|
376 |
|
|
377 |
IriSP.trace( "__IriSP.APIplayer.prototype.update" ,time); |
|
378 |
IriSP.player.sendEvent( 'SEEK', time ); |
|
| 3 | 379 |
} |
| 22 | 380 |
}; |
381 |
||
382 |
__IriSP.APIplayer.prototype.changePageUrlOffset = function ( time ) { |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
383 |
//alert(time); |
| 22 | 384 |
IriSP.trace( "__IriSP.APIplayer.prototype.changePageUrlOffset" , "CHANGE URL "+ time); |
| 3 | 385 |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
386 |
window.location.hash = "#t=" + time; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
387 |
window.location.href = window.location.href; |
| 3 | 388 |
|
| 22 | 389 |
}; |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
390 |
|
| 22 | 391 |
/* Media Fragment functionality by Silvia Pfeiffer */ |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
392 |
|
| 22 | 393 |
IriSP.jumpToTimeoffset = function ( form ) { |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
394 |
var time = form.time.value; |
| 22 | 395 |
IriSP.MyApiPlayer.changePageUrlOffset( time ); |
396 |
}; |
|
397 |
||
398 |
IriSP.retrieveTimeFragment = function ( url ) { |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
399 |
var pageoffset = 0; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
400 |
var offsettime = 0; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
401 |
|
| 22 | 402 |
if ( url.split("#")[1] != null ) { |
403 |
pageoffset = url.split( "#" )[1]; |
|
404 |
if ( pageoffset.substring( 2 ) != null ) { |
|
405 |
offsettime = pageoffset.substring( 2 ); |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
406 |
} |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
407 |
} |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
408 |
return offsettime; |
| 22 | 409 |
}; |
410 |
||
411 |
IriSP.ignoreTimeFragment = function( url ){ |
|
412 |
||
413 |
var pageurl = url; |
|
414 |
|
|
415 |
if ( url.split( "#" )[1] != null ) { |
|
416 |
pageurl = url.split( "#" )[0]; |
|
417 |
} |
|
418 |
|
|
419 |
return pageurl; |
|
420 |
}; |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
421 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
422 |
|
| 22 | 423 |
/* code specific to jwplayer / creation and listener */ |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
424 |
|
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
425 |
IriSP.currentPosition = 0; |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
426 |
IriSP.currentVolume = 50; |
| 22 | 427 |
IriSP.player = null; |
428 |
IriSP.startPosition = null; |
|
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
429 |
IriSP.firstplay = false; |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
430 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
431 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
432 |
|
| 22 | 433 |
IriSP.createPlayer = function ( url, streamerPath ) { |
434 |
if( IriSP.config.player.type=='dailymotion' ) { |
|
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
435 |
IriSP.config.player.src = IriSP.config.player.src+"&chromeless=1&enableApi=1"; |
| 22 | 436 |
} else if ( IriSP.config.player.type=='youtube' ){ |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
437 |
IriSP.config.player.src = IriSP.config.player.src+"&enablejsapi=1&version=3"; |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
438 |
} |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
439 |
|
| 22 | 440 |
IriSP.trace( "__IriSP.createPlayer", "start" ); |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
441 |
|
| 22 | 442 |
IriSP.myUrlFragment = url.split( streamerPath ); |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
443 |
|
| 22 | 444 |
var configTemp = IriSP.jQuery.extend( true, {}, IriSP.config ); |
| 3 | 445 |
configTemp.player.flashvars.autostart = "true"; |
446 |
configTemp.player.flashvars.streamer = streamerPath; |
|
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
447 |
configTemp.player.flashvars.file = IriSP.myUrlFragment[1]; |
| 3 | 448 |
|
449 |
var flashvars = configTemp.player.flashvars; |
|
450 |
var params = configTemp.player.params; |
|
451 |
var attributes = configTemp.player.attributes; |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
452 |
|
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
453 |
IriSP.trace( |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
454 |
"__IriSP.createPlayer", |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
455 |
"SWFOBJECT src:"+ |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
456 |
IriSP.config.player.src+ |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
457 |
" " +IriSP.config.gui.width+ |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
458 |
" " +IriSP.config.gui.height |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
459 |
); |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
460 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
461 |
swfobject.embedSWF( |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
462 |
IriSP.config.player.src, |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
463 |
"Ldt-PlaceHolder", |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
464 |
IriSP.config.gui.width, |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
465 |
IriSP.config.gui.height, |
| 22 | 466 |
"9.0.115", // FIXME : de-hardcode version ? |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
467 |
false, |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
468 |
flashvars, |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
469 |
params, |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
470 |
attributes |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
471 |
); |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
472 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
473 |
// need a methode to |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
474 |
// re execute if this swf call does'nt work |
| 22 | 475 |
}; |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
476 |
|
| 3 | 477 |
|
| 22 | 478 |
/* jw player api */ |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
479 |
IriSP.playerReady = function (thePlayer) { |
| 3 | 480 |
|
481 |
//__IriSP.trace("__IriSP.playerReady","PLAYER READY !!!!!!!!!!!!"); |
|
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
482 |
IriSP.player = window.document[thePlayer.id]; |
| 3 | 483 |
//__IriSP.trace("__IriSP.playerReady","API CALL "+__IriSP.player); |
| 22 | 484 |
IriSP.MyApiPlayer.ready( IriSP.player ); |
| 3 | 485 |
//__IriSP.trace("__IriSP.playerReady","API CALL END "); |
486 |
|
|
487 |
var url = document.location.href; |
|
| 22 | 488 |
var time = IriSP.retrieveTimeFragment( url ); |
| 3 | 489 |
//__IriSP.trace("__IriSP.playerReady"," "+url+" "+time ); |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
490 |
IriSP.startPosition = time; |
| 3 | 491 |
//__IriSP.trace("__IriSP.playerReady"," LISTENER LAUCHER"); |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
492 |
IriSP.addListeners(); |
| 3 | 493 |
//__IriSP.trace("__IriSP.playerReady"," LISTENER END"); |
494 |
|
|
| 22 | 495 |
}; |
496 |
||
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
497 |
IriSP.addListeners = function () { |
| 22 | 498 |
if ( IriSP.player ) { |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
499 |
IriSP.trace("__IriSP.addListeners","ADD Listener "); |
| 22 | 500 |
IriSP.player.addModelListener( "TIME", "__IriSP.positionListener"); |
501 |
IriSP.player.addControllerListener( "VOLUME", "__IriSP.volumeListener" ); |
|
502 |
IriSP.player.addModelListener( 'STATE', '__IriSP.stateMonitor' ); |
|
| 3 | 503 |
} else { |
| 22 | 504 |
IriSP.setTimeout( "__IriSP.addListeners()", 100 ); |
| 3 | 505 |
} |
506 |
||
507 |
// et changer les boutons |
|
| 22 | 508 |
}; |
509 |
||
510 |
IriSP.stateMonitor = function ( obj ) { |
|
| 3 | 511 |
|
| 22 | 512 |
if(obj.newstate == 'PAUSED') { |
513 |
IriSP.trace( "__IriSP.stateMonitor", "PAUSE" ); |
|
514 |
IriSP.MyApiPlayer.changePageUrlOffset( IriSP.currentPosition ); |
|
515 |
IriSP.jQuery( ".ui-icon-play" ).css( "background-position","0px -160px" ); |
|
| 3 | 516 |
|
| 22 | 517 |
} else if (obj.newstate == 'PLAYING' ){ |
| 3 | 518 |
|
| 22 | 519 |
IriSP.trace( "__IriSP.stateMonitor", "PLAYING "+IriSP.startPosition ); |
| 3 | 520 |
|
| 22 | 521 |
// force buffering even if autostart is disabled. |
522 |
if ( IriSP.config.player.flashvars.autostart == "false" && IriSP.firstplay == false && IriSP.startPosition == 0 ) { |
|
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
523 |
IriSP.trace("__IriSP.stateMonitor","first stop ???"); |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
524 |
IriSP.MyApiPlayer.play(); |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
525 |
IriSP.firstplay = true; |
| 22 | 526 |
IriSP.MyLdt.checkTime( 1 ); |
| 3 | 527 |
} |
528 |
|
|
| 22 | 529 |
// once that the video is loaded, move it to the correct timecode |
530 |
if( IriSP.startPosition!=null ){ |
|
531 |
IriSP.MyApiPlayer.update( IriSP.startPosition ); |
|
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
532 |
IriSP.startPosition = null; |
| 3 | 533 |
} |
534 |
|
|
535 |
|
|
| 22 | 536 |
IriSP.jQuery( ".ui-icon-play" ).css( "background-position", "-16px -160px" ); |
| 3 | 537 |
} else if (obj.newstate == 'BUFFERING'){ |
| 22 | 538 |
IriSP.trace( "__IriSP.stateMonitor", "BUFFERING : "+IriSP.config.player.flashvars.autostart ); |
| 3 | 539 |
//changePageUrlOffset(currentPosition); |
540 |
} |
|
541 |
|
|
| 22 | 542 |
}; |
543 |
||
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
544 |
IriSP.positionListener = function(obj) { |
| 3 | 545 |
//__IriSP.trace("__IriSP.positionListener",obj.position); |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
546 |
IriSP.currentPosition = obj.position; |
| 22 | 547 |
var tmp = document.getElementById( "posit" ); |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
548 |
if (tmp) { tmp.innerHTML = "position: " + IriSP.currentPosition; } |
| 22 | 549 |
IriSP.jQuery( "#slider-range-min" ).slider( "value", obj.position); |
550 |
IriSP.jQuery( "#amount" ).val(obj.position+" s"); |
|
551 |
// display annotation |
|
552 |
IriSP.MyLdt.checkTime( IriSP.currentPosition ); |
|
| 3 | 553 |
|
| 22 | 554 |
}; |
555 |
||
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
556 |
IriSP.volumeListener = function (obj) { |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
557 |
IriSP.currentVolume = obj.percentage; |
| 3 | 558 |
var tmp = document.getElementById("vol"); |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
559 |
if (tmp) { tmp.innerHTML = "volume: " + IriSP.currentVolume; } |
| 22 | 560 |
}; |
| 3 | 561 |
|
562 |
||
| 22 | 563 |
/* dailymotion api */ |
564 |
onDailymotionPlayerReady = function (playerid) { |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
565 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
566 |
//alert(playerid); |
| 22 | 567 |
IriSP.player = document.getElementById( IriSP.config.player.attributes.id ); |
568 |
IriSP.MyApiPlayer.ready( IriSP.player ); |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
569 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
570 |
var url = document.location.href; |
| 22 | 571 |
var time = IriSP.retrieveTimeFragment( url ); |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
572 |
IriSP.startPosition = time; |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
573 |
IriSP.DailymotionAddListeners(); |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
574 |
|
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
575 |
IriSP.MyApiPlayer.ready(playerid); |
| 22 | 576 |
}; |
577 |
||
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
578 |
IriSP.DailymotionAddListeners = function () { |
| 22 | 579 |
if ( IriSP.player ) { |
580 |
IriSP.trace( "__IriSP.addListeners","ADD Listener " ); |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
581 |
//__IriSP.player.addEventListener("onStateChange", "__IriSP.DailymotionPositionListener"); |
| 22 | 582 |
setTimeout( "__IriSP.DailymotionPositionListener()", 100); |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
583 |
IriSP.DailymotionPositionListener(); |
| 31 | 584 |
/* FIXME : works only with jwplayer */ |
| 22 | 585 |
IriSP.player.addModelListener( "VOLUME", "__IriSP.volumeListener" ); |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
586 |
//__IriSP.player.addModelListener('STATE', '__IriSP.stateMonitor'); |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
587 |
} else { |
| 22 | 588 |
IriSP.setTimeout( "__IriSP.DailymotionAddListeners()", 100); |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
589 |
} |
| 22 | 590 |
}; |
591 |
||
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
592 |
IriSP.DailymotionPositionListener = function() { |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
593 |
|
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
594 |
IriSP.currentPosition = IriSP.player.getCurrentTime(); |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
595 |
//__IriSP.trace("__IriSP.DailymotionPositionListener",__IriSP.currentPosition); |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
596 |
//__IriSP.trace("__IriSP.currentPosition",__IriSP.currentPosition); |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
597 |
|
| 22 | 598 |
IriSP.jQuery( "#slider-range-min" ).slider( "value" , IriSP.currentPosition); |
599 |
IriSP.jQuery( "#amount" ).val( IriSP.currentPosition+" s" ); |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
600 |
// afficher annotation |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
601 |
/*__IriSP.MyLdt.checkTime(__IriSP.currentPosition); |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
602 |
*/ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
603 |
|
| 22 | 604 |
setTimeout( "__IriSP.DailymotionPositionListener()", 10 ); |
605 |
}; |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
606 |
|
| 22 | 607 |
/* youtube api */ |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
608 |
onYouTubePlayerReady= function (playerid){ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
609 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
610 |
var url = document.location.href; |
| 22 | 611 |
var time = IriSP.retrieveTimeFragment( url ); |
612 |
IriSP.player = document.getElementById( IriSP.config.player.attributes.id ); |
|
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
613 |
IriSP.startPosition = time; |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
614 |
|
| 22 | 615 |
IriSP.MyApiPlayer.ready( IriSP.player ); |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
616 |
|
| 22 | 617 |
IriSP.MyApiPlayer.seek( time ); |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
618 |
IriSP.MyApiPlayer.play(); |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
619 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
620 |
|
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
621 |
IriSP.YouTubeAddListeners(); |
| 22 | 622 |
IriSP.trace( "onYouTubePlayerReady=", time); |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
623 |
//__IriSP.MyApiPlayer.ready(playerid); |
| 22 | 624 |
}; |
625 |
||
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
626 |
IriSP.YouTubeAddListeners = function () { |
| 22 | 627 |
if ( IriSP.player ) { |
628 |
IriSP.trace( "__IriSP.addListeners", "ADD Listener " ); |
|
629 |
IriSP.player.addEventListener( "onStateChange", "__IriSP.YouTubeStateMonitor" ); |
|
630 |
setTimeout( "__IriSP.YouTubePositionListener()", 100 ); |
|
| 31 | 631 |
|
632 |
/* FIXME : works only with jwplayer */ |
|
| 22 | 633 |
IriSP.player.addModelListener( "VOLUME", "__IriSP.volumeListener" ); |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
634 |
//__IriSP.player.addModelListener('STATE', '__IriSP.stateMonitor'); |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
635 |
} else { |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
636 |
} |
| 22 | 637 |
}; |
638 |
||
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
639 |
IriSP.YouTubePositionListener = function() { |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
640 |
|
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
641 |
IriSP.currentPosition = IriSP.player.getCurrentTime(); |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
642 |
//__IriSP.trace("__IriSP.YouTubePositionListener",__IriSP.currentPosition); |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
643 |
//__IriSP.trace("__IriSP.currentPosition",__IriSP.currentPosition); |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
644 |
|
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
645 |
IriSP.MyLdt.checkTime(IriSP.currentPosition); |
| 22 | 646 |
IriSP.jQuery( "#slider-range-min" ).slider( "value", IriSP.currentPosition ); |
647 |
IriSP.jQuery( "#amount" ).val( IriSP.currentPosition+" s" ); |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
648 |
// afficher annotation |
| 22 | 649 |
IriSP.MyLdt.checkTime( IriSP.currentPosition ); |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
650 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
651 |
|
| 22 | 652 |
setTimeout( "__IriSP.YouTubePositionListener()", 10 ); |
653 |
}; |
|
654 |
||
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
655 |
IriSP.YouTubeStateMonitor = function (obj) { |
| 22 | 656 |
IriSP.player.addModelListener( '__IriSP.YouTubeStateMonitor ', newstate ); |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
657 |
//alert(newstate+" "+obj.newstate); |
| 22 | 658 |
if(newstate == '2') { |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
659 |
IriSP.trace("__IriSP.stateMonitor","PAUSE"); |
| 22 | 660 |
IriSP.MyApiPlayer.changePageUrlOffset( IriSP.currentPosition ); |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
661 |
|
| 22 | 662 |
} else if (newstate == '1' || newstate == '1') { |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
663 |
// une fois la video prete a lire la déplacer au bon timecode |
| 22 | 664 |
if( IriSP.startPosition!=null ) { |
665 |
IriSP.MyApiPlayer.update( IriSP.startPosition ); |
|
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
666 |
IriSP.startPosition = null; |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
667 |
} |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
668 |
} else if (newstate == '3'){ |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
669 |
IriSP.trace("__IriSP.stateMonitor","BUFFERING : "); |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
670 |
//changePageUrlOffset(currentPosition); |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
671 |
} |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
672 |
|
| 22 | 673 |
}; |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
674 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
675 |
|
| 22 | 676 |
/* utils */ |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
677 |
// code from http://stackoverflow.com/questions/822452/strip-html-from-text-javascript |
| 22 | 678 |
/* FIXME: maybe make it a little more robust */ |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
679 |
IriSP.stripHtml = function(s){ |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
680 |
return s.replace(/\\&/g, '&').replace(/\\</g, '<').replace(/\\>/g, '>').replace(/\\t/g, ' ').replace(/\\n/g, '<br />').replace(/'/g, ''').replace(/"/g, '"'); |
| 22 | 681 |
}; |
682 |
||
683 |
// conversion de couleur Decimal vers HexaDecimal || 000 si fff |
|
684 |
/* FIXME : move it somewhere else */ |
|
685 |
IriSP.DEC_HEXA_COLOR = function (dec) { |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
686 |
var hexa='0123456789ABCDEF',hex=''; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
687 |
var tmp; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
688 |
while (dec>15){ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
689 |
tmp = dec-(Math.floor(dec/16))*16; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
690 |
hex = hexa.charAt(tmp)+hex; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
691 |
dec = Math.floor(dec/16); |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
692 |
} |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
693 |
hex = hexa.charAt(dec)+hex; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
694 |
if (hex == "FFCC00"){ hex="";/* by default color of Ldt annotation */ } |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
695 |
return(hex); |
| 22 | 696 |
}; |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
697 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
698 |
|
| 22 | 699 |
/* Search methods */ |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
700 |
IriSP.SearchOldValue=""; |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
701 |
IriSP.searchblockOpen=false; |
| 22 | 702 |
IriSP.searchblock = function () { |
703 |
IriSP.trace( "__IriSP.searchblock", IriSP.searchblockOpen ); |
|
704 |
|
|
705 |
if ( IriSP.searchblockOpen == false ) { |
|
706 |
IriSP.jQuery( ".ui-icon-search" ).css( "background-position", "-144px -112px" ); |
|
| 2 | 707 |
//__IriSP.jQuery("#LdtSearch").animate({height:26},250); |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
708 |
IriSP.jQuery("#LdtSearch").show(250); |
| 22 | 709 |
/* FIXME : refactor this */ |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
710 |
IriSP.jQuery("#LdtSearchInput").css('background-color','#fff'); |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
711 |
IriSP.jQuery("#LdtSearchInput").focus(); |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
712 |
IriSP.jQuery("#LdtSearchInput").attr('value',IriSP.SearchOldValue); |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
713 |
IriSP.Search(IriSP.SearchOldValue); |
| 22 | 714 |
IriSP.searchblockOpen = true; |
| 2 | 715 |
} else { |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
716 |
IriSP.SearchOldValue = IriSP.jQuery("#LdtSearchInput").attr('value'); |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
717 |
IriSP.jQuery("#LdtSearchInput").attr('value',''); |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
718 |
IriSP.SearchClean(); |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
719 |
IriSP.jQuery(".ui-icon-search").css("background-position","-160px -112px"); |
| 2 | 720 |
//__IriSP.jQuery("#LdtSearch").animate({height:0},250); |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
721 |
IriSP.jQuery("#LdtSearch").hide(250); |
| 22 | 722 |
IriSP.searchblockOpen = false; |
| 2 | 723 |
} |
| 22 | 724 |
}; |
725 |
||
| 40 | 726 |
/* Search with typeahead */ |
| 22 | 727 |
IriSP.Search = function ( value ){ |
| 2 | 728 |
|
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
729 |
annotations = IriSP.LDTligne.annotations; |
| 2 | 730 |
|
| 22 | 731 |
IriSP.trace("__IriSP.Search", annotations.length+" "+value); |
| 40 | 732 |
|
733 |
var found = 0; |
|
| 3 | 734 |
var findmem = 0; |
735 |
var factor = 0; |
|
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
736 |
IriSP.trace(value,value.length); |
| 5 | 737 |
var valueS = value.toLowerCase(); |
| 22 | 738 |
IriSP.trace("__IriSP.Search", annotations.length+" "+valueS); |
| 5 | 739 |
if(valueS.length>=3){ |
| 2 | 740 |
|
741 |
for (var i=0; i < annotations.length; ++i){ |
|
742 |
annotation = annotations[i]; |
|
743 |
|
|
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
744 |
IriSP.jQuery("#output2").text(annotation.title+" ?= "+value); |
| 5 | 745 |
|
| 2 | 746 |
chaine1 = annotation.title.toLowerCase(); |
747 |
chaine2 = annotation.description.toLowerCase(); |
|
748 |
chaine3 = annotation.htmlTags.toLowerCase(); |
|
749 |
|
|
| 5 | 750 |
if(chaine1.indexOf(valueS,0) !=-1){ |
| 40 | 751 |
found+=1; |
| 2 | 752 |
} |
| 5 | 753 |
if(chaine2.indexOf(valueS,0) !=-1){ |
| 40 | 754 |
found+=1; |
| 2 | 755 |
} |
| 5 | 756 |
if(chaine3.indexOf(valueS,0) !=-1){ |
| 40 | 757 |
found+=1; |
| 2 | 758 |
} |
759 |
|
|
| 40 | 760 |
findmem += found; |
761 |
if(found>0){ |
|
762 |
factor = found*8; |
|
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
763 |
IriSP.jQuery("#"+annotation.id).dequeue(); |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
764 |
IriSP.jQuery("#"+annotation.id).animate({height:factor},200); |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
765 |
IriSP.jQuery("#"+annotation.id).css('border','2px'); |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
766 |
IriSP.jQuery("#"+annotation.id).css('border-color','red'); |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
767 |
IriSP.jQuery("#"+annotation.id).animate({opacity:0.6},200); |
| 2 | 768 |
|
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
769 |
IriSP.trace("!!!!!!!!!!!!!!!!!!"," ?= "+annotation.id); |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
770 |
IriSP.jQuery("#LdtSearchInput").css('background-color','#e1ffe1'); |
| 2 | 771 |
}else { |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
772 |
IriSP.jQuery("#"+annotation.id).dequeue(); |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
773 |
IriSP.jQuery("#"+annotation.id).animate({height:0},250); |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
774 |
IriSP.jQuery("#"+annotation.id).animate({opacity:0.3},200); |
| 2 | 775 |
} |
776 |
|
|
| 40 | 777 |
found = 0; |
| 2 | 778 |
} |
779 |
if(findmem==0){ |
|
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
780 |
IriSP.jQuery("#LdtSearchInput").css('background-color','#f6f6f6'); |
| 2 | 781 |
} |
782 |
|
|
783 |
} else if(value.length==0){ |
|
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
784 |
IriSP.SearchClean(); |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
785 |
IriSP.jQuery("#LdtSearchInput").css('background-color','#fff'); |
| 2 | 786 |
} else { |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
787 |
IriSP.SearchClean(); |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
788 |
IriSP.jQuery("#LdtSearchInput").css('background-color','#f6f6f6'); |
| 2 | 789 |
} |
| 22 | 790 |
}; |
791 |
||
792 |
IriSP.SearchClean = function (){ |
|
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
793 |
annotations = IriSP.LDTligne.annotations; |
| 4 | 794 |
|
| 2 | 795 |
for (var i=0; i < annotations.length; ++i){ |
796 |
annotation = annotations[i]; |
|
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
797 |
IriSP.jQuery("#"+annotation.id).dequeue(); |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
798 |
IriSP.jQuery("#"+annotation.id).animate({height:0},100); |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
799 |
IriSP.jQuery("#"+annotation.id).css('border','0px'); |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
800 |
IriSP.jQuery("#"+annotation.id).css('border-color','red'); |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
801 |
IriSP.jQuery("#"+annotation.id).animate({opacity:0.3},100); |
| 2 | 802 |
} |
| 22 | 803 |
}; |
804 |
||
| 42 | 805 |
|
| 22 | 806 |
IriSP.SearchThisSegment = function (annotation){ |
807 |
/* FIXME: to implement */ |
|
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
808 |
IriSP.jQuery("#LdtSearchInput").text(annotation.title); |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
809 |
IriSP.trace("__IriSP.Ligne.prototype.checkTimeLigne",annotation.title); |
| 2 | 810 |
/*__IriSP.jQuery("#Ldt-SaDescription").text(annotationTempo.description); |
811 |
__IriSP.jQuery("#Ldt-SaKeywordText").html("Mots clefs : "+annotationTempo.htmlTags);*/ |
|
| 22 | 812 |
}; |
| 2 | 813 |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
814 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
815 |
/* CLASS Ligne (annotationType) */ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
816 |
|
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
817 |
IriSP.LDTligne = null; |
| 22 | 818 |
__IriSP.Ligne = function( id, title, description, duration ) { |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
819 |
this.id = id; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
820 |
this.title = title; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
821 |
this.description = description; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
822 |
// |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
823 |
this.annotations = new Array(); |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
824 |
this.duration = duration; |
| 22 | 825 |
this.annotationOldRead = ""; |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
826 |
IriSP.LDTligne = this; |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
827 |
IriSP.trace("__IriSP.Ligne","CREATE "+IriSP.LDTligne); |
| 22 | 828 |
}; |
829 |
||
830 |
__IriSP.Ligne.prototype.addAnnotation = function ( id, begin, end, media, title, description, color, tags ) { |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
831 |
var myAnnotation = new __IriSP.Annotation(id,begin,end,media,title,description,color,tags,this.duration); |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
832 |
this.annotations.push(myAnnotation); |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
833 |
//__IriSP.trace("__IriSP.Ligne.prototype.addAnnotation ","add annotation "+title); |
| 22 | 834 |
}; |
835 |
||
836 |
__IriSP.Ligne.prototype.onClickLigneAnnotation = function( id ) { |
|
837 |
/* TODO implement */ |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
838 |
//changePageUrlOffset(currentPosition); |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
839 |
//player.sendEvent('SEEK', this.start); |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
840 |
//__IriSP.trace("SEEK",this.start); |
| 22 | 841 |
}; |
842 |
||
843 |
__IriSP.Ligne.prototype.searchLigneAnnotation = function( id ) { |
|
844 |
/* TODO implement */ |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
845 |
/*for (){ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
846 |
}*/ |
| 22 | 847 |
}; |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
848 |
|
| 22 | 849 |
__IriSP.Ligne.prototype.listAnnotations = function() { |
850 |
/* TODO implement */ |
|
851 |
}; |
|
852 |
||
853 |
__IriSP.Ligne.prototype.nextAnnotation = function () { |
|
854 |
|
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
855 |
var annotationCibleNumber = this.numAnnotation(this.annotationOldRead)+1; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
856 |
var annotationCible = this.annotations[annotationCibleNumber]; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
857 |
|
| 22 | 858 |
if( annotationCibleNumber<this.annotations.length-1 ){ |
859 |
IriSP.player.sendEvent( 'SEEK', annotationCible.begin/1000 ); |
|
860 |
IriSP.trace( "LIGNE ", "| next = "+annotationCibleNumber+" - "+this.annotations.length+" | seek :"+annotationCible.begin/1000); |
|
861 |
} else { |
|
862 |
IriSP.player.sendEvent( 'SEEK', this.annotations[0].begin/1000); |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
863 |
} |
| 22 | 864 |
|
865 |
}; |
|
866 |
||
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
867 |
__IriSP.Ligne.prototype.numAnnotation = function (annotationCible){ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
868 |
for (var i=0; i < this.annotations.length; ++i){ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
869 |
if(annotationCible == this.annotations[i]){ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
870 |
return i; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
871 |
} |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
872 |
} |
| 22 | 873 |
}; |
874 |
||
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
875 |
__IriSP.Ligne.prototype.checkTime = function(time){ |
| 2 | 876 |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
877 |
var annotationTempo = -1; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
878 |
//__IriSP.trace("__IriSP.Ligne.prototype.checkTimeLigne",time); |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
879 |
//__IriSP.trace("__IriSP.Ligne.prototype.checkTimeLigne",this.annotations.length); |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
880 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
881 |
for (var i=0; i < this.annotations.length; ++i){ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
882 |
annotationTempo = this.annotations[i]; |
| 2 | 883 |
|
884 |
//__IriSP.SearchThisSegment(annotationTempo); |
|
885 |
|
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
886 |
if (time>annotationTempo.begin/1000 && time<annotationTempo.end/1000){ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
887 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
888 |
// different form the previous |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
889 |
if(annotationTempo!=this.annotationOldRead){ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
890 |
this.annotationOldRead = annotationTempo; |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
891 |
IriSP.jQuery("#Ldt-SaTitle").text(annotationTempo.title); |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
892 |
IriSP.jQuery("#Ldt-SaDescription").text(annotationTempo.description); |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
893 |
IriSP.jQuery("#Ldt-SaKeywordText").html("Mots clefs : "+annotationTempo.htmlTags); |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
894 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
895 |
//__IriSP.jQuery('#Ldt-ShowAnnotation').slideDown(); |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
896 |
var startPourcent = annotationTempo.timeToPourcent((annotationTempo.begin*1+(annotationTempo.end*1-annotationTempo.begin*1)/2),annotationTempo.duration*1); |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
897 |
IriSP.jQuery("#Ldt-Show-Arrow").animate({left:startPourcent+'%'},1000); |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
898 |
IriSP.jQuery("#"+annotationTempo.id).animate({alpha:'100%'},1000); |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
899 |
//alert(startPourcent); |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
900 |
var tempolinkurl = IriSP.ignoreTimeFragment(window.location.href)+"#t="+(this.annotations[i].begin/1000); |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
901 |
} |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
902 |
break; |
| 22 | 903 |
} else { |
904 |
annotationTempo = -1; |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
905 |
} |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
906 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
907 |
} |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
908 |
// si il y en a pas : retractation du volet |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
909 |
if( annotationTempo == -1){ |
| 22 | 910 |
if(annotationTempo != this.annotationOldRead){ |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
911 |
IriSP.trace("Check : ","pas d'annotation ici "); |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
912 |
IriSP.jQuery("#Ldt-SaTitle").text(""); |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
913 |
IriSP.jQuery("#Ldt-SaDescription").text(""); |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
914 |
IriSP.jQuery("#Ldt-SaKeywordText").html(""); |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
915 |
IriSP.jQuery('#Ldt-ShowAnnotation').slideUp(); |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
916 |
if(this.annotationOldRead){ |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
917 |
IriSP.jQuery("#"+this.annotationOldRead.id).animate({alpha:'70%'},1000); |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
918 |
} |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
919 |
//__IriSP.jQuery("#Ldt-Show-Arrow").animate({left:'0%'},1000); |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
920 |
this.annotationOldRead = annotationTempo; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
921 |
} |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
922 |
} |
| 2 | 923 |
//__IriSP.trace("__IriSP.Ligne.prototype.checkTimeLigne",annotationTempo); |
| 22 | 924 |
}; |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
925 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
926 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
927 |
/* CLASS Annotation */ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
928 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
929 |
__IriSP.Annotation = function (){ |
| 22 | 930 |
var id = null; |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
931 |
var begin = null; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
932 |
var end = null; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
933 |
var media = null; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
934 |
var description = null; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
935 |
var title = null; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
936 |
var color = null; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
937 |
var tags = null; |
| 22 | 938 |
IriSP.trace("annotation ","réussi"); |
939 |
}; |
|
940 |
||
941 |
__IriSP.Annotation = function( id, begin, end, media, title, description, color, tags, duration ){ |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
942 |
this.id = id; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
943 |
this.begin = begin; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
944 |
this.end = end; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
945 |
this.media = media; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
946 |
this.description = description; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
947 |
this.title = title; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
948 |
this.color = color; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
949 |
this.tags = tags; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
950 |
this.htmlTags = ""; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
951 |
this.duration = duration; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
952 |
// draw it |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
953 |
this.draw(); |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
954 |
this.drawTags(); |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
955 |
// |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
956 |
IriSP.trace("Annotation created : ",id); |
| 22 | 957 |
}; |
958 |
||
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
959 |
__IriSP.Annotation.prototype.draw = function(){ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
960 |
//alert (this.duration); |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
961 |
var startPourcent = this.timeToPourcent(this.begin,this.duration); // temps du media |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
962 |
var endPourcent = this.timeToPourcent(this.end,this.duration)-startPourcent; |
| 43 | 963 |
var divTitle = this.title.substr(0,55); |
964 |
|
|
965 |
IriSP.jQueryAnnotationTemplate = Mustache.to_html(IriSP.annotation_template, |
|
966 |
{"divTitle" : divTitle, "id" : this.id, "startPourcent" : startPourcent, |
|
967 |
"endPourcent" : endPourcent, "hexa_color" : IriSP.DEC_HEXA_COLOR(this.color), |
|
968 |
"seekPlace" : Math.round(this.begin/1000)}); |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
969 |
|
| 42 | 970 |
IriSP.jQuerytoolTipTemplate = Mustache.to_html(IriSP.tooltip_template, |
971 |
{"title" : this.title, "begin" : this.begin, "end" : this.end, |
|
972 |
"description": this.description}); |
|
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
973 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
974 |
|
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
975 |
IriSP.jQuery("<div>"+IriSP.jQueryAnnotationTemplate+"</div>").appendTo("#Ldt-Annotations"); |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
976 |
// TOOLTIP BUG ! |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
977 |
|
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
978 |
IriSP.jQuery("#"+this.id).tooltip({ effect: 'slide'}); |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
979 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
980 |
|
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
981 |
IriSP.jQuery("#"+this.id).fadeTo(0,0.3); |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
982 |
IriSP.jQuery("#"+this.id).mouseover(function() { |
| 22 | 983 |
IriSP.jQuery("#"+this.id).animate({opacity: 0.6}, 5); |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
984 |
}).mouseout(function(){ |
| 22 | 985 |
IriSP.jQuery("#"+this.id).animate({opacity: 0.3}, 5); |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
986 |
}); |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
987 |
IriSP.trace("__IriSP.Annotation.prototype.draw","ADD ANOTATION : "+this.begin+" "+this.end+" "+IriSP.stripHtml(this.title)+" | "+startPourcent+" | "+endPourcent+" | duration = "+this.duration); |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
988 |
|
| 22 | 989 |
}; |
990 |
||
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
991 |
__IriSP.Annotation.prototype.drawTags = function(){ |
| 22 | 992 |
/* FIXME : to implement */ |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
993 |
var KeywordPattern = '<a href=\"\"> '+' </a>'; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
994 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
995 |
//__IriSP.trace(" !? Tags : ",this.tags); |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
996 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
997 |
if (this.tags!=undefined){ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
998 |
for (var i = 0; i < this.tags.length; ++i){ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
999 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1000 |
//this.htmlTags += '<span onclick=\"ShowTag('+this.tags[i]['id-ref']+');\" > '+MyTags.getTitle(this.tags[i]['id-ref'])+' </span>'+" , "; |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
1001 |
this.htmlTags += '<span> '+IriSP.MyTags.getTitle(this.tags[i]['id-ref'])+' </span>'+" , "; |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1002 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1003 |
} |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1004 |
} |
| 22 | 1005 |
}; |
1006 |
||
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1007 |
__IriSP.Annotation.prototype.tootTipAnnotation = function() { |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1008 |
// 1 chercher le div correspondant |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1009 |
// 2 y mettre les information |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1010 |
return this.color + ' ' + this.type + ' apple'; |
| 22 | 1011 |
}; |
1012 |
||
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1013 |
__IriSP.Annotation.prototype.onRollOverAnnotation = function (){ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1014 |
this.tootTip(); |
| 22 | 1015 |
}; |
1016 |
||
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1017 |
__IriSP.Annotation.prototype.timeToPourcent = function(time,timetotal){ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1018 |
return (parseInt(Math.round(time/timetotal*100))); |
| 22 | 1019 |
}; |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1020 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1021 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1022 |
/* CLASS Tags */ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1023 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1024 |
__IriSP.Tags = function(object){ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1025 |
this.myTags = object; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1026 |
this.htmlTags = null; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1027 |
this.weigthMax = 0; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1028 |
//this.mySegments = new array(); |
| 22 | 1029 |
}; |
1030 |
||
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1031 |
__IriSP.Tags.prototype.addAnnotation = function (annotation){ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1032 |
for (var i = 0; i < this.myTags.length; ++i){ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1033 |
this.myTags[i].mySegments = new Array(); |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1034 |
if (annotation.tags!=null){ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1035 |
for (var j = 0; j < annotation.tags.length; ++j){ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1036 |
if (this.myTags[i]['id'] == annotation.tags[j]['id-ref']){ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1037 |
this.myTags[i].mySegments.push([annotation.begin,annotation.end,annotation.id]); |
| 22 | 1038 |
var weigthTempo = this.myTags[i].mySegments.length; |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1039 |
var tempo = this.myTags[i].mySegments[weigthTempo-1]; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1040 |
//__IriSP.trace ("__IriSP.Tags.prototype.addAnnotation "," "+this.myTags[i]['meta']['dc:title']+" "+this.myTags[i]['id']+" : "+tempo[0]+" - "+tempo[1]); |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1041 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1042 |
if (this.weigthMax < weigthTempo ){ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1043 |
this.weigthMax = weigthTempo; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1044 |
} |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1045 |
} |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1046 |
} |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1047 |
} |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1048 |
} |
| 22 | 1049 |
}; |
1050 |
||
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1051 |
__IriSP.Tags.prototype.getTitle = function (id){ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1052 |
for (var i = 0; i < this.myTags.length; ++i){ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1053 |
if(this.myTags[i]['id']==id){ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1054 |
return(this.myTags[i]['meta']['dc:title']); |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1055 |
} |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1056 |
} |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1057 |
|
| 22 | 1058 |
}; |
1059 |
||
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1060 |
__IriSP.Tags.prototype.draw = function (){ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1061 |
|
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
1062 |
IriSP.trace("__IriSP.Tags.prototype.draw"," !!! WELL START " ); |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1063 |
for (var i = 0; i < this.myTags.length; ++i){ |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
1064 |
IriSP.trace("__IriSP.Tags.prototype.draw"," ADD Tags : "+this.myTags[i]['id']); |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1065 |
if(this.myTags[i]['id']!=null){ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1066 |
this.htmlTags += '<span onclick=\"MyTags.show( \''+this.myTags[i]['id'] |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1067 |
+'\');\" style=\"font-size:' +((this.myTags[i].mySegments.length/this.weigthMax*10)+8) |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1068 |
+'px;\" alt=\"'+this.myTags[i].mySegments.length |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1069 |
+'\"> '+this.myTags[i]['meta']['dc:title']+' </span>'+' , '; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1070 |
} |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1071 |
} |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1072 |
|
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
1073 |
IriSP.jQuery('#Ldt-Tags').html(this.htmlTags); |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
1074 |
IriSP.trace("__IriSP.Tags.prototype.draw"," !!!! END WMAX= "+this.weigthMax ); |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1075 |
|
| 22 | 1076 |
}; |
1077 |
||
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1078 |
__IriSP.Tags.prototype.show = function (id){ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1079 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1080 |
var timeStartOffsetA = 100000000000000000000; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1081 |
var timeStartOffsetB = 100000000000000000000; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1082 |
var timeEndOffsetA = 0; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1083 |
var timeEndOffsetB = 0; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1084 |
var timeStartID; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1085 |
var timeEndID; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1086 |
var WidthPourCent; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1087 |
var leftPourCent; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1088 |
var timeStartOffset; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1089 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1090 |
// case 1 : seul segment |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1091 |
// case 2 : 2 ou X segments |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1092 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1093 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1094 |
for (var i = 0; i < this.myTags.length; ++i){ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1095 |
if (this.myTags[i]['id']==id){ |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
1096 |
IriSP.trace("######### TAG DRAWing : "," END" ); |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1097 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1098 |
for (var j = 0; j < this.myTags[i].mySegments.length; ++j){ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1099 |
if(timeStartOffset> this.myTags[i].mySegments[j][0]){ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1100 |
timeStartOffsetA = this.myTags[i].mySegments[j][0]; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1101 |
timeStartOffsetB = this.myTags[i].mySegments[j][1]; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1102 |
timeStartID = this.myTags[i].mySegments[j][2] |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1103 |
} |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1104 |
if(timeStartOffset> this.myTags[i].mySegments[j][0]){ |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1105 |
timeEndOffsetA = this.myTags[i].mySegments[j][0]; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1106 |
timeEndOffsetB = this.myTags[i].mySegments[j][1]; |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1107 |
timeEndID = this.myTags[i].mySegments[j][2] |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1108 |
} |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1109 |
} |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1110 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1111 |
} |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1112 |
} |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1113 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1114 |
// ------------------------------------------------- |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1115 |
// |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1116 |
// ------------------------------------------------- |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1117 |
|
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
1118 |
leftPourCent = IriSP.timeToPourcent((timeStartOffsetA*1+(timeStartOffsetB-timeStartOffsetA)/2),IriSP.MyLdt.duration); |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
1119 |
WidthPourCent = IriSP.timeToPourcent((timeEndOffsetA*1+(timeEndOffsetB-timeEndOffsetA)/2),IriSP.MyLdt.duration)-leftPourCent; |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1120 |
//WidthPourCent = timeToPourcent((timeEndOffsetA*1+(timeEndOffsetB-timeEndOffsetA)/2),MyLdt.duration)-startPourcent; |
|
16
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
1121 |
IriSP.jQuery("#Ldt-Show-Tags").css('left',leftPourCent+'%'); |
|
81a63a89ed35
renamed the object __IriSP in IriSP. Took care of backward compatibility.
hamidouk
parents:
8
diff
changeset
|
1122 |
IriSP.jQuery("#Ldt-Show-Tags").css('width',WidthPourCent+'%'); |
| 22 | 1123 |
IriSP.jQuery("#Ldt-Show-Tags").text('joijoij'); |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1124 |
// like arrow script |
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1125 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1126 |
|
|
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1127 |
|
| 22 | 1128 |
}; |
|
0
c357d5b60635
First import. Last version from France culture
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1129 |