56 border-right:solid 1px #aaaaaa;' |
58 border-right:solid 1px #aaaaaa;' |
57 } |
59 } |
58 |
60 |
59 .tooltip { |
61 .tooltip { |
60 display:none; |
62 display:none; |
61 background:transparent url(css/tooltip/white_arrow.png); |
63 background:transparent url(css/jq-css/tooltip/white_arrow.png); |
62 font-size:12px; |
64 font-size:12px; |
63 height:100px; |
65 height:100px; |
64 width:180px; |
66 width:180px; |
65 padding:10px; |
67 padding:10px; |
66 padding-left:15px; |
68 padding-left:15px; |
67 padding-right:15px; |
69 padding-right:15px; |
68 color:#000; |
70 color:#000; |
69 } |
71 } |
70 |
72 |
71 .annotations{ |
73 #Annotations{ |
|
74 padding-left:5px; |
|
75 width:470px; |
|
76 float:left; |
72 } |
77 } |
73 #ldtSaTitle{ |
78 #ldtSaTitle{ |
74 padding-top:2px; |
79 padding-top:2px; |
|
80 padding-bottom:5px; |
75 font-size:18px; |
81 font-size:18px; |
76 color:#FFF; |
82 color:#FFF; |
77 height:22p; |
83 height:22p; |
78 } |
84 } |
79 #ldtSaDescription{ |
85 #ldtSaDescription{ |
80 font-size:12px; |
86 font-size:12px; |
81 color:#FFF; |
87 color:#FFF; |
82 } |
88 } |
83 #ShowAnnotation{ |
89 #ShowAnnotation{ |
84 position: absolute; |
90 position:absolute; |
85 z-index: 999; |
91 z-index: 999; |
86 padding:5px; |
92 padding:5px; |
87 background:url(css/custom-theme/images/trans.png);padding:5px; |
93 background:url(css/custom/images/transBlack.png); |
|
94 } |
|
95 |
|
96 #ldtPlaceHolder{ |
|
97 position:absolue; |
|
98 float:none; |
|
99 } |
|
100 .ldtControl1{ |
|
101 width:70px; |
|
102 float:left; |
|
103 } |
|
104 .ldtControl2{ |
|
105 padding-left:10px; |
|
106 width:70px; |
|
107 float:left; |
88 } |
108 } |
89 </style> |
109 </style> |
90 |
110 |
91 <!-- INTERFACE : SLIDER ( CONTROL BAR ) | BUTTON () --> |
111 <!-- INTERFACE : SLIDER ( CONTROL BAR ) | BUTTON () --> |
92 <script type="text/javascript"> |
112 <script type="text/javascript"> |
|
113 |
93 function createInterface (width,height,duration){ |
114 function createInterface (width,height,duration){ |
94 $jIRI(function() { |
115 $jIRI(function() { |
95 |
116 |
96 $jIRI("#Annotations").width(width-(78*2)); |
117 $jIRI("#Annotations").width(width-(78*2)); |
97 $jIRI("#ShowAnnotation").width(width); |
118 $jIRI("#ShowAnnotation").width(width-10); |
98 //$jIRI("#ShowAnnotation").width(width); |
|
99 $jIRI("ldtSaTitle").width(width); |
|
100 $jIRI("ldtSaDescription").width(width); |
|
101 $jIRI("#controlerLdt").width(width); |
119 $jIRI("#controlerLdt").width(width); |
|
120 $jIRI("#Ldtplayer1").attr("z-index","100"); |
|
121 |
|
122 $jIRI("#ShowAnnotation").click(function () { |
|
123 $jIRI(this).slideUp(); |
|
124 }); |
|
125 |
|
126 var LdtpPlayerY = $jIRI("#ldtPlaceHolder").attr("top"); |
|
127 var LdtpPlayerX = $jIRI("#ldtPlaceHolder").attr("left"); |
|
128 |
|
129 //alert(LdtpPlayerY+" | "+LdtpPlayerX); |
|
130 <!--PB possible sur IE 7 et 6 pour show annotation --> |
|
131 //$jIRI("#ShowAnnotation").attr("position","absolute"); |
|
132 /*$jIRI("#ShowAnnotation").attr("top",0); |
|
133 $jIRI("#ShowAnnotation").attr("left",0);*/ |
|
134 |
102 //$jIRI("#slider-range-min").roll |
135 //$jIRI("#slider-range-min").roll |
103 $jIRI("#slider-range-min").slider({ //range: "min", |
136 $jIRI("#slider-range-min").slider({ //range: "min", |
104 value: 0, |
137 value: 0, |
105 min: 1, |
138 min: 1, |
106 max: duration/1000,//1:54:52.66 = 3600+3240+ |
139 max: duration/1000,//1:54:52.66 = 3600+3240+ |
158 |
191 |
159 function addListeners() { |
192 function addListeners() { |
160 if (player) { |
193 if (player) { |
161 player.addModelListener("TIME", "positionListener"); |
194 player.addModelListener("TIME", "positionListener"); |
162 player.addControllerListener("VOLUME", "volumeListener"); |
195 player.addControllerListener("VOLUME", "volumeListener"); |
|
196 player.addPlayPauseListener("PLAY", "state"); |
163 } else { |
197 } else { |
164 setTimeout("addListeners()",100); |
198 setTimeout("addListeners()",100); |
165 } |
199 } |
166 |
200 |
167 |
|
168 // et changer les boutons |
201 // et changer les boutons |
169 |
|
170 |
|
171 } |
202 } |
172 |
203 |
173 //function |
204 //function |
174 |
205 |
|
206 function addPlayPauseListener(obj) { |
|
207 if(obj){ |
|
208 $jIRI(".control1 button:first").button({ |
|
209 icons: { |
|
210 primary: 'ui-icon-pause' |
|
211 }, |
|
212 text: false |
|
213 }); |
|
214 }else{ |
|
215 $jIRI(".control1 button:first").button({ |
|
216 icons: { |
|
217 primary: 'ui-icon-play' |
|
218 }, |
|
219 text: false |
|
220 }); |
|
221 } |
|
222 } |
|
223 |
175 function positionListener(obj) { |
224 function positionListener(obj) { |
176 currentPosition = obj.position; |
225 currentPosition = obj.position; |
177 var tmp = document.getElementById("posit"); |
226 var tmp = document.getElementById("posit"); |
178 if (tmp) { tmp.innerHTML = "position: " + currentPosition; } |
227 if (tmp) { tmp.innerHTML = "position: " + currentPosition; } |
179 $jIRI("#slider-range-min").slider("value", obj.position); |
228 $jIRI("#slider-range-min").slider("value", obj.position); |
209 } |
267 } |
210 |
268 |
211 swfobject.embedSWF("swf/player.swf", "ldtPlaceHolder", width, height, "9.0.115", false, flashvars, params, attributes); |
269 swfobject.embedSWF("swf/player.swf", "ldtPlaceHolder", width, height, "9.0.115", false, flashvars, params, attributes); |
212 } |
270 } |
213 |
271 |
214 function streamOrNot(){ |
272 |
215 |
|
216 } |
|
217 |
|
218 function timeToPourcent(time,timetotal){ |
|
219 return (Math.round(time/timetotal*100)); |
|
220 } |
|
221 |
273 |
222 |
274 |
223 </script> |
275 </script> |
224 |
276 |
225 <!-- LOAD JSON AND PARSE IT --> |
277 <!-- LOAD JSON AND PARSE IT --> |
226 <script type="text/javascript"> |
278 <script type="text/javascript"> |
227 |
279 |
|
280 |
228 var MyLdt; |
281 var MyLdt; |
229 function loadJson (width,height,url){ |
282 var Durration; |
230 |
283 var playerLdtWidth; |
231 $jIRI.getJSON(url, |
284 var playerLdtHeight; |
232 function(json){ |
285 |
233 /* START PARSING ----------------------- */ |
286 function loadJson (width,height,urlJson){ |
234 /* metas , medias , annotation-types , annotations , lists , tags , views */ |
287 |
235 /* # fonction avec 1 seul media et 1 seul annotation type code a cleaner */ |
288 playerLdtWidth=width; |
236 //var MyLigne; |
289 playerLdtHeight=height; |
237 |
290 |
238 /* # créer le player */ |
291 $jIRI.ajax({ |
239 $jIRI.each(json.medias, function(i,item) { |
292 dataType: 'jsonp', |
240 $jIRI("<div></div>").appendTo("#output"); |
293 url:urlJson, |
241 MyMedia = new Media(item.id,item.url,item["dc:duration"],item['dc:title'],item['dc:description']); |
294 success: function(json){ |
242 MyMedia.createPlayer(width,height); |
295 |
243 }); |
296 //alert("success !"); |
244 |
297 |
245 /* # créer la ligne */ |
298 |
246 $jIRI.each(json['annotation-types'], function(i,item) { |
299 } |
247 |
300 ,error: function(data){ |
248 MyLdt = new Ligne (item.id,item['dc:title'],item['dc:description']); |
301 alert("ERROR : "+data); |
249 |
302 } |
250 }); |
303 }); |
251 |
304 } |
252 /* # créer les annotations */ |
305 |
253 $jIRI.each(json.annotations, function(i,item) { |
306 function callbackLdts(json){ |
254 |
307 /* START PARSING ----------------------- */ |
255 MyLdt.addAnnotation( |
308 /* metas , medias , annotation-types , annotations , lists , tags , views */ |
256 item.id, |
309 /* # fonction avec 1 seul media et 1 seul annotation type code a cleaner */ |
257 item.begin, |
310 /* # créer le player */ |
258 item.end, |
311 //$jIRI.each(json.medias, function(i,item) { |
259 item.media, |
312 //}); |
260 item.content.title, |
313 $jIRI("<div></div>").appendTo("#output"); |
261 item.content.description, |
314 MyMedia = new Media(json.medias[0].id,json.medias[0].url,json.medias[0]["dc:duration"],json.medias[0]['dc:title'],json.medias[0]['dc:description']); |
262 item.content.color); |
315 MyMedia.createPlayer(playerLdtWidth,playerLdtHeight); |
263 |
316 |
264 }); |
317 /* # créer lignes */ |
265 |
318 /*$jIRI.each(json['annotation-types'], function(i,item) { |
266 |
319 });*/ |
267 $jIRI.each(json.lists, function(i,item) { |
320 MyLdt = new Ligne (json['annotation-types'][0].id,json['annotation-types'][0]['dc:title'],json['annotation-types'][0]['dc:description'],json.medias[0]["dc:duration"]); |
268 trace("lists",""); |
321 //alert("duration : "+json.medias[0]["dc:duration"]); |
269 }); |
322 |
270 |
323 /* # créer les annotations */ |
271 $jIRI.each(json.tags, function(i,item) { |
324 $jIRI.each(json.annotations, function(i,item) { |
272 trace("tags",""); |
325 |
273 }); |
326 MyLdt.addAnnotation( |
274 |
327 item.id, |
275 $jIRI.each(json.views, function(i,item) { |
328 item.begin, |
276 trace("views",""); |
329 item.end, |
277 }); |
330 item.media, |
278 |
331 item.content.title, |
279 |
332 item.content.description, |
280 /* END PARSING ----------------------- */ |
333 item.content.color); |
281 }); |
334 |
282 |
335 }); |
283 } |
336 $jIRI.each(json.lists, function(i,item) { |
284 |
337 trace("lists",""); |
|
338 }); |
|
339 $jIRI.each(json.tags, function(i,item) { |
|
340 trace("tags",""); |
|
341 }); |
|
342 $jIRI.each(json.views, function(i,item) { |
|
343 trace("views",""); |
|
344 }); |
|
345 /* END PARSING ----------------------- */ |
|
346 |
|
347 } |
|
348 |
285 function trace (msg,value){ |
349 function trace (msg,value){ |
286 $jIRI("<div>"+msg+" : "+value+"</div>").appendTo("#output"); |
350 $jIRI("<div>"+msg+" : "+value+"</div>").appendTo("#output"); |
287 } |
351 } |
288 |
352 |
289 </script> |
353 </script> |
290 |
354 |
291 <!-- INIT player LDT --> |
355 <!-- INIT player LDT --> |
292 <script type="text/javascript"> |
356 <script type="text/javascript"> |
293 |
357 |
294 function playerLdt (width,height,file){ |
358 function playerLdt (width,height,file,divId){ |
295 loadJson(width,height,"js/cinelabModelV1.js"); |
359 |
|
360 //$jIRI("#playerLdt").append("<div id=\"div1\">hello</div>"); |
|
361 |
|
362 |
|
363 $jIRI("#"+divId).append("<div id=\"ldtShow\">\n <div id=\"ShowAnnotation\" class=\"demo\" >\n <div id=\"ldtSaTitle\"></div>\n <div id=\"ldtSaDescription\"></div>\n </div> <div id=\"ldtPlaceHolder\">\n <a href=\"http://www.adobe.com/go/getflashplayer\">Get flash</a> to see this player \n </div>\n </div>\n <div id=\"controlerLdt\" class=\"demo\">\n <div class=\"ldtControl1\" >\n <button id=\"ldtCtrlPlay\" onclick=\"player.sendEvent('PLAY')\">Play</button>\n <button id=\"ldtCtrlNext\" onclick=\"player.sendEvent('SEEK', currentPosition+10)\">next</button>\n </div>\n <div id=\"Annotations\" class=\"ui-slider\">\n <div id=\"slider-range-min\"></div>\n </div>\n <div class=\"ldtControl2\">\n <button id=\"ldtCtrlScreen\" onclick=\"player.fullscreen('true')\">Enlarge</button>\n <button id=\"ldtCtrlSound\" onclick=\"player.sendEvent('MUTE')\">Sound</button>\n </div>\n </div>"); |
|
364 loadJson(width,height,file); |
296 } |
365 } |
297 |
366 |
298 |
367 |
299 |
368 |
300 </script> |
369 </script> |
376 this.addAnnotation = addAnnotationligne; |
445 this.addAnnotation = addAnnotationligne; |
377 this.clickAnnotation= onClickLigneAnnotation; |
446 this.clickAnnotation= onClickLigneAnnotation; |
378 this.checkTime = checkTimeLigne; |
447 this.checkTime = checkTimeLigne; |
379 } |
448 } |
380 |
449 |
381 function Ligne (id,title,description){ |
450 function Ligne (id,title,description,duration){ |
382 this.id = id; |
451 this.id = id; |
383 this.title = title; |
452 this.title = title; |
384 this.description = description; |
453 this.description = description; |
385 // |
454 // |
386 this.annotations = new Array(); |
455 this.annotations = new Array(); |
387 this.addAnnotation = addLigneAnnotation; |
456 this.addAnnotation = addLigneAnnotation; |
388 this.checkTime = checkTimeLigne; |
457 this.checkTime = checkTimeLigne; |
|
458 this.duration = duration; |
|
459 trace("LIGNE ","créer "); |
389 } |
460 } |
390 |
461 |
391 function addLigneAnnotation(id,begin,end,media,title,description,color){ |
462 function addLigneAnnotation(id,begin,end,media,title,description,color){ |
392 var myAnnotation = new Annotation(id,begin,end,media,title,description,color); |
463 var myAnnotation = new Annotation(id,begin,end,media,title,description,color,this.duration); |
393 this.annotations.push(myAnnotation); |
464 this.annotations.push(myAnnotation); |
|
465 trace("LIGNE ","add annotation "); |
394 } |
466 } |
395 |
467 |
396 function onClickLigneAnnotation(id){ |
468 function onClickLigneAnnotation(id){ |
397 player.sendEvent('SEEK', this.start); |
469 player.sendEvent('SEEK', this.start); |
398 } |
470 } |
460 this.toolTip = rollOverAnnotation; |
532 this.toolTip = rollOverAnnotation; |
461 this.draw = drawAnnotation; |
533 this.draw = drawAnnotation; |
462 trace("annotation ","réussi") |
534 trace("annotation ","réussi") |
463 } |
535 } |
464 |
536 |
465 function Annotation (id,begin,end,media,title,description,color){ |
537 function Annotation (id,begin,end,media,title,description,color,duration){ |
466 this.id = id; |
538 this.id = id; |
467 this.begin = begin; |
539 this.begin = begin; |
468 this.end = end; |
540 this.end = end; |
469 this.media = media; |
541 this.media = media; |
470 this.description = description; |
542 this.description = description; |
471 this.title = title; |
543 this.title = title; |
472 this.color = title; |
544 this.color = title; |
|
545 this.duration = duration; |
473 // |
546 // |
474 this.onRollOver = onRollOverAnnotation; |
547 this.onRollOver = onRollOverAnnotation; |
475 //this.onClick = onClickAnnotation; |
548 //this.onClick = onClickAnnotation; |
476 this.toolTip = tootTipAnnotation; |
549 this.toolTip = tootTipAnnotation; |
477 this.draw = drawAnnotation; |
550 this.draw = drawAnnotation; |
482 // |
555 // |
483 trace("Annotation created : ",id); |
556 trace("Annotation created : ",id); |
484 } |
557 } |
485 |
558 |
486 function drawAnnotation (){ |
559 function drawAnnotation (){ |
487 startPourcent = timeToPourcent(this.begin,6892.66); // temps du média |
560 //alert (this.duration); |
488 endPourcent = timeToPourcent(this.end,6892.66)-startPourcent; |
561 startPourcent = timeToPourcent(this.begin,this.duration); // temps du média |
489 trace(" ### START : ",startPourcent); |
562 endPourcent = timeToPourcent(this.end,this.duration)-startPourcent; |
490 trace(" ### END : ",endPourcent); |
563 |
491 |
564 $AnnotationTemplate = "<div title='"+this.title+"' id='"+this.id+"' class='ui-slider-range ui-slider-range-min ui-widget-header iri-chapter' width='100%' style='left:"+startPourcent+"%; width:"+endPourcent+"%; padding-top:15px; border-left:solid 1px #aaaaaa; border-right:solid 1px #aaaaaa;' onclick=\"player.sendEvent('SEEK', '"+Math.round(this.begin/1000)+"');$jIRI('#ShowAnnotation').slideDown().delay(5000).slideUp();\" ></div> "; |
492 $AnnotationTemplate = "<div title='"+this.title+"' id='"+this.id+"' class='ui-slider-range ui-slider-range-min ui-widget-header iri-chapter' width='100%' style='left:"+startPourcent+"%; width:"+endPourcent+"%; padding-top:15px; border-left:solid 1px #aaaaaa; border-right:solid 1px #aaaaaa;' onclick=\"player.sendEvent('SEEK', '"+this.begin+"');\" ></div>"; |
|
493 |
565 |
494 |
566 |
495 |
567 |
496 $toolTipTemplate = "<div class='tooltip'>" |
568 $toolTipTemplate = "<div class='tooltip'>" |
497 +"<div class='title'>"+this.title+"</div>" |
569 +"<div class='title'>"+this.title+"</div>" |
525 |
601 |
526 function addTrace(){ |
602 function addTrace(){ |
527 |
603 |
528 } |
604 } |
529 |
605 |
530 </script> |
606 |
531 |
607 |
532 <!-- TEST --> |
608 </script> |
|
609 |
|
610 |
|
611 </head> |
|
612 |
|
613 |
|
614 <!-- createPlayer --> |
|
615 |
|
616 <body > |
|
617 |
|
618 |
|
619 |
|
620 |
|
621 |
|
622 <div id="playerLdt"></div> |
533 <script type="text/javascript"> |
623 <script type="text/javascript"> |
534 /* |
624 //playerLdt(550,310, "js/cinelabModel_Peter.js","playerLdt"); |
535 var MyMedia = new Media("kia_closeup", |
625 playerLdt(550,310, "http://dev.prototype-w.com/wu.mu/cinelabModel_Peter.js","playerLdt"); |
536 "rtmp://media.iri.centrepompidou.fr/ddc_player/video/stephenfrears_lesliaisonsdangereuses.flv", |
626 //playerLdt(550,310, "http://dev.prototype-w.com/wu.mu/cinelabModelB.js","playerLdt"); |
537 "689266", |
627 </script> |
538 "Liaison Dangereuse", |
628 |
539 "Blobal bla bla bla bla bla bla bla bla bla bla "); |
629 |
540 |
630 <br/><br/><br/><br/><br/> |
541 var MyLigne = new Ligne ("dp_1","titre ligne","description"); |
631 |
542 |
|
543 function addAnnotation(){ |
|
544 MyLigne.addAnnotation("test", |
|
545 5000, |
|
546 6500, |
|
547 "kia_closeup", |
|
548 "mon annotation", |
|
549 "ma description bla bla bla bla", |
|
550 "color"); |
|
551 //(id,begin,end,media,title,description,color) |
|
552 } |
|
553 |
|
554 */ |
|
555 |
|
556 </script> |
|
557 |
|
558 |
|
559 </head> |
|
560 |
|
561 |
|
562 <!-- createPlayer --> |
|
563 |
|
564 <body > |
|
565 |
|
566 |
|
567 |
|
568 <script type="text/javascript"> |
|
569 playerLdt(550,310,"http://www.cybunk.com/iritest/player-iri/js/cinelabModelV1.php"); |
|
570 </script> |
|
571 |
|
572 <div id="playerLdt"> |
|
573 |
|
574 <!-- VIDEO PLAYER --> |
|
575 <div id="ldtShow"> |
|
576 <!-- Zone Affichage annotation --> |
|
577 <div id="ShowAnnotation" class="demo" > |
|
578 <div id="ldtSaTitle">Test</div> |
|
579 <div id="ldtSaDescription">le journaliste et M. Ahankhah passent le portail et se dirigent vers la |
|
580 </div> |
|
581 <div id="ldtSaBoutons"> <a> Fermer </a></div> |
|
582 </div> |
|
583 <!-- Zone Player --> |
|
584 <div id="ldtPlaceHolder"> |
|
585 <a href="http://www.adobe.com/go/getflashplayer">Get flash</a> to see this player |
|
586 </div> |
|
587 </div> |
|
588 <!-- CONTROLER --> |
|
589 <div id="controlerLdt" class="demo"> |
|
590 <div class="control1" style="width:70px;float:left;"> |
|
591 <button id="ldtCtrlPlay" onclick="player.sendEvent('PLAY')">Play</button> |
|
592 <button id="ldtCtrlNext" onclick="player.sendEvent('SEEK', currentPosition+10)">next</button> |
|
593 </div> |
|
594 <div id="Annotations" class="ui-slider" style="padding-left:5px;width:470px;float:left;"> |
|
595 <div id="slider-range-min"></div> |
|
596 </div> |
|
597 <div class="control2" style="padding-left:10px;width:70px;float:left;"> |
|
598 <button id="ldtCtrlScreen" onclick="player.fullscreen('true')">Enlarge</button> |
|
599 <button id="ldtCtrlSound" onclick="player.sendEvent('MUTE')">Sound</button> |
|
600 </div> |
|
601 </div> |
|
602 <br/> |
632 <br/> |
603 <!-- DEBUG --> |
633 <!-- DEBUG TESTS ET AUTRES --> |
604 <div id="output" class="demo"></div> |
634 <div id="output" class="demo"></div> |
605 |
|
606 </div> |
|
607 <br/><br/><br/><br/><br/> |
|
608 |
|
609 <div> |
|
610 <!-- TESTS ET AUTRES --> |
|
611 <a href="#" onclick="player.sendEvent('PLAY')">play/pause toggle</a><br> |
|
612 <a href="#" onclick="player.sendEvent('STOP')">stop playing and buffering</a><br> |
|
613 <a href="#" onclick="player.sendEvent('SEEK', currentPosition+10)">seek current position +10 seconds</a><br> |
|
614 <a href="#" onclick="player.sendEvent('SEEK', currentPosition-10)">seek current position -10 seconds</a><br> |
|
615 <a href="#" onclick="player.sendEvent('VOLUME', currentVolume+10)">set current volume +10%</a><br> |
|
616 <a href="#" onclick="player.sendEvent('VOLUME', currentVolume-10)">set current volume -10%</a><br> |
|
617 <a href="#" onclick="slider.max=100">update slider </a><br> |
|
618 <div id="vol">vol</div> |
|
619 <div id="posit">posit</div> |
|
620 <div id="amount"></div> |
|
621 </div> |
|
622 |
|
623 |
635 |
624 </body> |
636 </body> |
625 </html> |
637 </html> |