|
31
|
1 |
/* site.js - all our site-dependent config : player chrome, cdn locations, etc...*/ |
|
|
2 |
|
|
|
3 |
IriSP.lib = { |
|
|
4 |
jQuery:"http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js", |
|
|
5 |
jQueryUI:"http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/jquery-ui.min.js", |
|
|
6 |
jQueryToolTip:"http://cdn.jquerytools.org/1.2.4/all/jquery.tools.min.js", |
|
|
7 |
swfObject:"http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js", |
|
|
8 |
cssjQueryUI:"http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/themes/base/jquery-ui.css" |
|
|
9 |
}; |
|
|
10 |
|
|
|
11 |
//Player Configuration |
|
|
12 |
IriSP.config = undefined; |
|
|
13 |
IriSP.configDefault = { |
|
|
14 |
metadata:{ |
|
|
15 |
format:'cinelab', |
|
|
16 |
src:'', |
|
|
17 |
load:'jsonp' |
|
|
18 |
}, |
|
|
19 |
gui:{ |
|
|
20 |
width:650, |
|
|
21 |
height:0, |
|
|
22 |
mode:'radio', |
|
|
23 |
container:'LdtPlayer', |
|
|
24 |
debug:false, |
|
|
25 |
css:'../src/css/LdtPlayer.css' |
|
|
26 |
}, |
|
|
27 |
player:{ |
|
|
28 |
type:'jwplayer', |
|
|
29 |
src:'../res/swf/player.swf', |
|
|
30 |
params:{ |
|
|
31 |
allowfullscreen:"true", |
|
|
32 |
allowscriptaccess:"always", |
|
|
33 |
wmode:"transparent" |
|
|
34 |
}, |
|
|
35 |
flashvars:{ |
|
|
36 |
streamer:"streamer", |
|
|
37 |
file:"file", |
|
|
38 |
live:"true", |
|
|
39 |
autostart:"false", |
|
|
40 |
controlbar:"none", |
|
|
41 |
playerready:"IriSP.playerReady" |
|
|
42 |
}, |
|
|
43 |
attributes:{ |
|
|
44 |
id:"Ldtplayer1", |
|
|
45 |
name:"Ldtplayer1" |
|
|
46 |
} |
|
|
47 |
}, |
|
|
48 |
module:null |
|
|
49 |
}; |
|
|
50 |
|
|
|
51 |
//Player Variable |
|
|
52 |
/* FIXME: use an sharing library */ |
|
|
53 |
IriSP.LdtShareTool = ""+ |
|
|
54 |
"\n<a onclick=\"__IriSP.MyApiPlayer.share('delicious');\" title='partager avec delicious'><span class='share shareDelicious'> </span></a>"+ |
|
|
55 |
"\n<a onclick=\"__IriSP.MyApiPlayer.share('facebook');\" title='partager avec facebook'> <span class='share shareFacebook'> </span></a>"+ |
|
|
56 |
"\n<a onclick=\"__IriSP.MyApiPlayer.share('twitter');\" title='partager avec twitter'> <span class='share shareTwitter'> </span></a>"+ |
|
|
57 |
"\n<a onclick=\"__IriSP.MyApiPlayer.share('myspace');\" title='partager avec Myspace'> <span class='share shareMySpace'> </span></a>"; |
|
|
58 |
|
|
|
59 |
/* FIXME: move the function out of this file to ui.js*/ |
|
|
60 |
IriSP.createPlayerChrome = function(){ |
|
|
61 |
var width = IriSP.config.gui.width; |
|
|
62 |
var height = IriSP.config.gui.height; |
|
|
63 |
var heightS = IriSP.config.gui.height-20; |
|
|
64 |
|
|
|
65 |
// AUDIO */ |
|
|
66 |
// PB dans le html : ; |
|
|
67 |
IriSP.trace( "__IriSP.createMyHtml",IriSP.config.gui.container ); |
|
|
68 |
|
|
|
69 |
|
|
|
70 |
/* FIXME : factor this in another file */ |
|
|
71 |
if( IriSP.config.gui.mode=="radio" ){ |
|
|
72 |
|
|
|
73 |
IriSP.jQuery( "#"+IriSP.config.gui.container ).before( |
|
|
74 |
"<div id='LdtSearchContainer' style='margin-left:445px;position:absolute;'>\n"+ |
|
|
75 |
"<div id='LdtSearch' style='display:none;background-color:#EEE;width:165px;boder:1px;border-color:#CFCFCF;position:absolute;text-align:center;'><input id='LdtSearchInput' style='margin-top:2px;margin-bottom:2px;' /></div> \n"+ |
|
|
76 |
"</div>\n"+ |
|
|
77 |
" <div class='cleaner'></div>"); |
|
|
78 |
IriSP.trace("__IriSP.createHtml",IriSP.config.gui.container); |
|
|
79 |
|
|
|
80 |
IriSP.jQuery( "<div id='Ldt-Root'>\n"+ |
|
|
81 |
" <div id='Ldt-PlaceHolder'>\n"+ |
|
|
82 |
" <a href='http://www.adobe.com/go/getflashplayer'>Get flash</a> to see this player \n"+ |
|
|
83 |
" </div>\n"+ |
|
|
84 |
" <div id='Ldt-controler' class='demo'>\n"+ |
|
|
85 |
" <div class='Ldt-Control1' >\n"+ |
|
|
86 |
" <button id='ldt-CtrlPlay' onclick='__IriSP.MyApiPlayer.play()'>Lecture / Pause </button>\n"+ |
|
|
87 |
" <button id='ldt-CtrlNext' onclick='__IriSP.MyLdt.nextAnnotation()'>Suivant</button>\n"+ |
|
|
88 |
" </div>\n"+ |
|
|
89 |
" <div id='Ldt-Annotations' class='ui-slider'>\n"+ |
|
|
90 |
" <div id='slider-range-min'></div>\n"+ |
|
|
91 |
" </div>\n"+ |
|
|
92 |
" <div class='Ldt-Control2'>\n"+ |
|
|
93 |
" <button id='ldt-CtrlLink' onclick='__IriSP.searchblock()'> Rechercher </button>\n"+ |
|
|
94 |
" <button id='ldt-CtrlSound' onclick='__IriSP.MyApiPlayer.mute()'>Sound</button>\n"+ |
|
|
95 |
" </div>\n"+ |
|
|
96 |
" <div class='cleaner'> \;</div> \n"+ |
|
|
97 |
" <div id='Ldt-Show-Arrow-container'>\n"+ |
|
|
98 |
" <div id='Ldt-Show-Arrow'> </div>\n"+ |
|
|
99 |
" </div>\n"+ |
|
|
100 |
"</div>\n"+ |
|
|
101 |
"<div>\n"+ |
|
|
102 |
" <div id='ldt-Show'> </div>\n"+ |
|
|
103 |
" <div id='Ldt-ShowAnnotation-audio' class='demo' >\n"+ |
|
|
104 |
" <div id='Ldt-SaTitle'></div>\n"+ |
|
|
105 |
" <div id='Ldt-SaDescription'></div>\n"+ |
|
|
106 |
" <div class='cleaner'><!-- \;--></div>\n"+ |
|
|
107 |
" </div>\n"+ |
|
|
108 |
" <div id='Ldt-SaKeyword'>\n"+ |
|
|
109 |
" <div id='Ldt-SaKeywordText'> </div>\n"+ |
|
|
110 |
" <div class='cleaner'></div>\n"+ |
|
|
111 |
" <div id='Ldt-SaShareTools'>\n"+ |
|
|
112 |
" \n"+ |
|
|
113 |
" "+IriSP.LdtShareTool+"\n"+ |
|
|
114 |
" \n"+ |
|
|
115 |
" </div>\n"+ |
|
|
116 |
" <div class='cleaner'></div>"+ |
|
|
117 |
"</div> "+ |
|
|
118 |
//"<div id='Ldt-Tags'> Mots clefs : </div>"+ |
|
|
119 |
"</div>"+ |
|
|
120 |
"<div id='Ldt-output' style='clear:left;float:none;position:relative;height:200px;width:"+width+"px;overflow:scroll;' ></div>").appendTo("#"+IriSP.config.gui.container); |
|
|
121 |
// special tricks IE 7 |
|
|
122 |
if (IriSP.jQuery.browser.msie==true && IriSP.jQuery.browser.version=="7.0"){ |
|
|
123 |
//LdtSearchContainer |
|
|
124 |
//__IriSP.jQuery("#LdtPlayer").attr("margin-top","50px"); |
|
|
125 |
IriSP.jQuery("#Ldt-Root").css("padding-top","25px"); |
|
|
126 |
IriSP.trace("__IriSP.createHtml","IE7 SPECIAL "); |
|
|
127 |
} |
|
|
128 |
} else if(IriSP.config.gui.mode=="video") { |
|
|
129 |
|
|
|
130 |
IriSP.jQuery( "<div id='LdtSearchContainer' style='margin-top:"+heightS+"px;margin-left:445px;position:absolute;'>\n"+ |
|
|
131 |
"<div id='LdtSearch' style='background-color:#EEE;display:none;width:165px;boder:1px;border-color:#CFCFCF;position:absolute;text-align:center;z-index:999;'><input id='LdtSearchInput' style='margin-top:2px;margin-bottom:2px;' /></div> \n"+ |
|
|
132 |
"</div>\n"+ |
|
|
133 |
"<div id='Ldt-Root'>\n"+ |
|
|
134 |
" <div id='Ldt-PlaceHolder'>\n"+ |
|
|
135 |
" <a href='http://www.adobe.com/go/getflashplayer'>Get flash</a> to see this player \n"+ |
|
|
136 |
" </div>\n"+ |
|
|
137 |
|
|
|
138 |
" <div id='Ldt-controler' class='demo'>\n"+ |
|
|
139 |
" <div class='Ldt-Control1' >\n"+ |
|
|
140 |
" <button id='ldt-CtrlPlay' onclick='__IriSP.MyApiPlayer.play()'>Lecture / Pause </button>\n"+ |
|
|
141 |
" <button id='ldt-CtrlNext' onclick='__IriSP.MyLdt.nextAnnotation()'>Suivant</button>\n"+ |
|
|
142 |
" </div>\n"+ |
|
|
143 |
" <div id='Ldt-Annotations' class='ui-slider'>\n"+ |
|
|
144 |
" <div id='slider-range-min'></div>\n"+ |
|
|
145 |
" </div>\n"+ |
|
|
146 |
" <div class='Ldt-Control2'>\n"+ |
|
|
147 |
" <button id='ldt-CtrlLink' onclick='__IriSP.searchblock()'> Rechercher </button>\n"+ |
|
|
148 |
" <button id='ldt-CtrlSound' onclick='__IriSP.MyApiPlayer.mute()'>Sound</button>\n"+ |
|
|
149 |
" </div>\n"+ |
|
|
150 |
" <div class='cleaner'> \;</div> \n"+ |
|
|
151 |
" <div id='Ldt-Show-Arrow-container'>\n"+ |
|
|
152 |
" <div id='Ldt-Show-Arrow'> </div>\n"+ |
|
|
153 |
" </div>\n"+ |
|
|
154 |
"</div>\n"+ |
|
|
155 |
"<div>\n"+ |
|
|
156 |
" <div id='ldt-Show'> </div>\n"+ |
|
|
157 |
" <div id='Ldt-ShowAnnotation-audio' class='demo' >\n"+ |
|
|
158 |
" <div id='Ldt-SaTitle'></div>\n"+ |
|
|
159 |
" <div id='Ldt-SaDescription'></div>\n"+ |
|
|
160 |
" <div class='cleaner'><!-- \;--></div>\n"+ |
|
|
161 |
" </div>\n"+ |
|
|
162 |
" <div id='Ldt-SaKeyword'>\n"+ |
|
|
163 |
" <div id='Ldt-SaKeywordText'> </div>\n"+ |
|
|
164 |
" <div class='cleaner'></div>\n"+ |
|
|
165 |
" <div id='Ldt-SaShareTools'>\n"+ |
|
|
166 |
" \n"+ |
|
|
167 |
" "+IriSP.LdtShareTool+"\n"+ |
|
|
168 |
" \n"+ |
|
|
169 |
" </div>\n"+ |
|
|
170 |
" <div class='cleaner'></div>"+ |
|
|
171 |
"</div> "+ |
|
|
172 |
//"<div id='Ldt-Tags'> Mots clefs : </div>"+ |
|
|
173 |
"</div>"+ |
|
|
174 |
"<div id='Ldt-output'></div>").appendTo("#"+IriSP.config.gui.container); |
|
|
175 |
|
|
|
176 |
} |
|
|
177 |
|
|
|
178 |
|
|
|
179 |
IriSP.trace("__IriSP.createHtml",IriSP.jQuery.browser.msie+" "+IriSP.jQuery.browser.version); |
|
|
180 |
IriSP.trace("__IriSP.createHtml","end"); |
|
|
181 |
IriSP.jQuery("#Ldt-Annotations").width(width-(75*2)); |
|
|
182 |
IriSP.jQuery("#Ldt-Show-Arrow-container").width(width-(75*2)); |
|
|
183 |
IriSP.jQuery("#Ldt-ShowAnnotation-audio").width(width-10); |
|
|
184 |
IriSP.jQuery("#Ldt-ShowAnnotation-video").width(width-10); |
|
|
185 |
IriSP.jQuery("#Ldt-SaKeyword").width(width-10); |
|
|
186 |
IriSP.jQuery("#Ldt-controler").width(width-10); |
|
|
187 |
IriSP.jQuery("#Ldt-Control").attr("z-index","100"); |
|
|
188 |
IriSP.jQuery("#Ldt-controler").hide(); |
|
|
189 |
|
|
|
190 |
IriSP.jQuery("<div id='Ldt-load-container'><div id='Ldt-loader'> </div> Chargement... </div>").appendTo("#Ldt-ShowAnnotation-audio"); |
|
|
191 |
|
|
|
192 |
if(IriSP.config.gui.mode=='radio'){ |
|
|
193 |
IriSP.jQuery("#Ldt-load-container").attr("width",IriSP.config.gui.width); |
|
|
194 |
} |
|
|
195 |
// Show or not the output |
|
|
196 |
if(IriSP.config.gui.debug===true){ |
|
|
197 |
IriSP.jQuery("#Ldt-output").show(); |
|
|
198 |
} else { |
|
|
199 |
IriSP.jQuery("#Ldt-output").hide(); |
|
|
200 |
} |
|
|
201 |
|
|
|
202 |
}; |
|
|
203 |
|