web/res/metadataplayer/src/js/LdtPlayer.js
changeset 202 2bf0fd3432bf
parent 133 9578d3ddce17
child 203 8124cde38141
equal deleted inserted replaced
201:ace2d571aefc 202:2bf0fd3432bf
   451 		this.lignes 	  	= new Array();
   451 		this.lignes 	  	= new Array();
   452 
   452 
   453 		__IriSP.trace("__IriSP.Media","Media ID : "+id);
   453 		__IriSP.trace("__IriSP.Media","Media ID : "+id);
   454 		__IriSP.trace("__IriSP.Media","Media URL : "+url);
   454 		__IriSP.trace("__IriSP.Media","Media URL : "+url);
   455 		__IriSP.trace("__IriSP.Media","Media title : "+title);
   455 		__IriSP.trace("__IriSP.Media","Media title : "+title);
   456 }
   456 };
   457 __IriSP.Media.prototype.createPlayerMedia = function (width,height,MyStreamer,MySwfPath){
   457 __IriSP.Media.prototype.createPlayerMedia = function (width,height,MyStreamer,MySwfPath){
   458 		__IriSP.MyApiPlayer = new __IriSP.APIplayer(width,height,this.url,this.duration,MyStreamer,MySwfPath);
   458 		__IriSP.MyApiPlayer = new __IriSP.APIplayer(width,height,this.url,this.duration,MyStreamer,MySwfPath);
   459 		//createPlayer(width,height,this.url,this.duration,MyStreamer,MySwfPath);
   459 		//createPlayer(width,height,this.url,this.duration,MyStreamer,MySwfPath);
   460 }
   460 };
   461 __IriSP.Media.prototype.getMediaDuration = function (){
   461 __IriSP.Media.prototype.getMediaDuration = function (){
   462 		return (this.duration);
   462 		return (this.duration);
   463 }
   463 };
   464 __IriSP.Media.prototype.getMediaTitle = function (){
   464 __IriSP.Media.prototype.getMediaTitle = function (){
   465 		return (this.title);
   465 		return (this.title);
   466 }
   466 };
   467 
   467 
   468 
   468 
   469 
   469 
   470 /* 	INTERFACE : SLIDER ( CONTROL BAR ) | BUTTON ()   */
   470 /* 	INTERFACE : SLIDER ( CONTROL BAR ) | BUTTON ()   */
   471 __IriSP.createInterface = function(width,height,duration){
   471 __IriSP.createInterface = function(width,height,duration){
   525 		}
   525 		}
   526 		__IriSP.trace("__IriSP.createInterface","3");
   526 		__IriSP.trace("__IriSP.createInterface","3");
   527 
   527 
   528 		__IriSP.trace("__IriSP.createInterface","END");
   528 		__IriSP.trace("__IriSP.createInterface","END");
   529 		
   529 		
   530 	}
   530 	};
   531 
   531 
   532 
   532 
   533 /*  API player - work in progress ... need refactoring of code */ 
   533 /*  API player - work in progress ... need refactoring of code */ 
   534 __IriSP.APIplayer = function (width,height,url,duration,streamerPath,MySwfPath){
   534 __IriSP.APIplayer = function (width,height,url,duration,streamerPath,MySwfPath){
   535 		
   535 		
   556 	- html5
   556 	- html5
   557 	- flowplayer 
   557 	- flowplayer 
   558 	- jwplayer
   558 	- jwplayer
   559 	*/
   559 	*/
   560 		
   560 		
   561 }
   561 };
   562 __IriSP.APIplayer.prototype.ready = function(player){
   562 __IriSP.APIplayer.prototype.ready = function(player){
   563 
   563 
   564 	__IriSP.trace("__IriSP.APIplayer.prototype.APIpReady"," __IriSP.createInterface");
   564 	__IriSP.trace("__IriSP.APIplayer.prototype.APIpReady"," __IriSP.createInterface");
   565 	__IriSP.createInterface(this.width,this.height,this.duration);
   565 	__IriSP.createInterface(this.width,this.height,this.duration);
   566 	__IriSP.trace("__IriSP.APIplayer.prototype.APIpReady","END  __IriSP.createInterface");
   566 	__IriSP.trace("__IriSP.APIplayer.prototype.APIpReady","END  __IriSP.createInterface");
   594 			__IriSP.MyApiPlayer.hashchangeUpdate=null;
   594 			__IriSP.MyApiPlayer.hashchangeUpdate=null;
   595 		  }
   595 		  }
   596 		}, false);
   596 		}, false);
   597 	}
   597 	}
   598 	
   598 	
   599 }
   599 };
   600 __IriSP.APIplayer.prototype.pause = function(){
   600 __IriSP.APIplayer.prototype.pause = function(){
   601 	this.hashchangeUpdate = true;
   601 	this.hashchangeUpdate = true;
   602 	__IriSP.player.sendEvent('PAUSE');
   602 	__IriSP.player.sendEvent('PAUSE');
   603 }
   603 };
   604 __IriSP.APIplayer.prototype.play  = function(){
   604 __IriSP.APIplayer.prototype.play  = function(){
   605 	this.hashchangeUpdate = true;
   605 	this.hashchangeUpdate = true;
   606 	__IriSP.trace("__IriSP.config.player.type",__IriSP.config.player.type);
   606 	__IriSP.trace("__IriSP.config.player.type",__IriSP.config.player.type);
   607 		
   607 		
   608 	if(__IriSP.config.player.type=='jwplayer'){
   608 	if(__IriSP.config.player.type=='jwplayer'){
   619 		
   619 		
   620 	} else if(__IriSP.config.player.type=='vimeo') {
   620 	} else if(__IriSP.config.player.type=='vimeo') {
   621 		__IriSP.trace("vimeo",status);
   621 		__IriSP.trace("vimeo",status);
   622 		var status = 0;
   622 		var status = 0;
   623 		if (status!=1){__IriSP.player.api_play();
   623 		if (status!=1){__IriSP.player.api_play();
   624 		}else{__IriSP.player.remote(moogaloop, 'api_pause')
   624 		}else{__IriSP.player.remote(moogaloop, 'api_pause');
   625 		}
   625 		}
   626 		
   626 		
   627 	
   627 	
   628 	}
   628 	}
   629 }
   629 };
   630 __IriSP.APIplayer.prototype.mute  = function(){
   630 __IriSP.APIplayer.prototype.mute  = function(){
   631 	__IriSP.player.sendEvent('MUTE');
   631 	__IriSP.player.sendEvent('MUTE');
   632 	
   632 	
   633 	//alert(__IriSP.jQuery(".ui-icon-volume-on").css("background-position-x"));
   633 	//alert(__IriSP.jQuery(".ui-icon-volume-on").css("background-position-x"));
   634 	if (__IriSP.jQuery(".ui-icon-volume-on").css("background-position")=="-144px -160px"){
   634 	if (__IriSP.jQuery(".ui-icon-volume-on").css("background-position")=="-144px -160px"){
   635 		__IriSP.jQuery(".ui-icon-volume-on").css("background-position","-130px -160px");
   635 		__IriSP.jQuery(".ui-icon-volume-on").css("background-position","-130px -160px");
   636 	} else {
   636 	} else {
   637 		__IriSP.jQuery(".ui-icon-volume-on").css("background-position","-144px -160px");
   637 		__IriSP.jQuery(".ui-icon-volume-on").css("background-position","-144px -160px");
   638 	}
   638 	}
   639 }
   639 };
   640 __IriSP.APIplayer.prototype.share = function(network){
   640 __IriSP.APIplayer.prototype.share = function(network){
   641 
   641 
   642 	var MyMessage = encodeURIComponent("J'écoute Les Retours du Dimanche : ");
   642 	var MyMessage = encodeURIComponent("J'écoute Les Retours du Dimanche : ");
   643 	var MyURLNow = window.location.href;
   643 	var MyURLNow = window.location.href;
   644 	var shareURL;
   644 	var shareURL;
   657 			//alert(network+" non actif pour l'instant : "+MyURLNow);
   657 			//alert(network+" non actif pour l'instant : "+MyURLNow);
   658 	}
   658 	}
   659 	
   659 	
   660 	window.open(shareURL+encodeURIComponent(MyURLNow));
   660 	window.open(shareURL+encodeURIComponent(MyURLNow));
   661 	//window.location.href = shareURL+encodeURIComponent(MyURLNow);
   661 	//window.location.href = shareURL+encodeURIComponent(MyURLNow);
   662 }
   662 };
   663 __IriSP.APIplayer.prototype.seek  = function (time){
   663 __IriSP.APIplayer.prototype.seek  = function (time){
   664 	__IriSP.trace("__IriSP.APIplayer.prototype.seek",time);
   664 	__IriSP.trace("__IriSP.APIplayer.prototype.seek",time);
   665 	if(__IriSP.config.player.type=='jwplayer'){
   665 	if(__IriSP.config.player.type=='jwplayer'){
   666 		__IriSP.player.sendEvent('SEEK', time);
   666 		__IriSP.player.sendEvent('SEEK', time);
   667 	} else if(__IriSP.config.player.type=='dailymotion'
   667 	} else if(__IriSP.config.player.type=='dailymotion'
   668 			|| __IriSP.config.player.type=='youtube') {
   668 			|| __IriSP.config.player.type=='youtube') {
   669 		__IriSP.player.seekTo(time);
   669 		__IriSP.player.seekTo(time);
   670 	}
   670 	}
   671 	this.changePageUrlOffset(time);
   671 	this.changePageUrlOffset(time);
   672 }	
   672 };
   673 __IriSP.APIplayer.prototype.update = function (time){
   673 __IriSP.APIplayer.prototype.update = function (time){
   674 	this.hashchangeUpdate = true;
   674 	this.hashchangeUpdate = true;
   675 	__IriSP.player.sendEvent('SEEK', time);
   675 	__IriSP.player.sendEvent('SEEK', time);
   676 }
   676 };
   677 __IriSP.APIplayer.prototype.changePageUrlOffset = function (time) {
   677 __IriSP.APIplayer.prototype.changePageUrlOffset = function (time) {
   678 	//alert(time);
   678 	//alert(time);
   679   __IriSP.trace("__IriSP.APIplayer.prototype.changePageUrlOffset","CHANGE URL "+time);
   679   __IriSP.trace("__IriSP.APIplayer.prototype.changePageUrlOffset","CHANGE URL "+time);
   680   window.location.hash = "#t=" + time;
   680   window.location.hash = __IriSP.addTimeFragment(window.location.hash,time);
   681   window.location.href =  window.location.href;
   681   window.location.href =  window.location.href;
   682 }
   682 };
   683 
   683 
   684 /* MEDIA FRAGMENT FUNCTION */
   684 /* MEDIA FRAGMENT FUNCTION */
   685 
   685 
   686 __IriSP.jumpToTimeoffset = function (form) {
   686 __IriSP.jumpToTimeoffset = function (form) {
   687 	var time = form.time.value;
   687 	var time = form.time.value;
   688 	__IriSP.MyApiPlayer.changePageUrlOffset(time);
   688 	__IriSP.MyApiPlayer.changePageUrlOffset(time);
   689 }
   689 };
   690 __IriSP.retrieveTimeFragment = function (url) {
   690 __IriSP.retrieveTimeFragment = function (url) {
   691   var pageoffset = 0;
   691   var pageoffset = "";
   692   var offsettime = 0;
   692   var offsettime = 0;
   693   
   693   
   694   if (url.split("#")[1] != null) {
   694   url_components = url.split("#");
   695 	pageoffset = url.split("#")[1];
   695   
   696 		if (pageoffset.substring(2) != null) {
   696   if (url_components.length > 1){
   697 			offsettime = pageoffset.substring(2);
   697 	anchors = url_components[1];
   698 		}
   698 
   699 	}
   699 	anchors_components = [];
   700 	return offsettime;
   700 	if(anchors.indexOf(";")>=0) {
   701 }  
   701 		anchors_components = anchors.split(";");
       
   702 	}
       
   703 	else if (anchors.indexOf("&")>=0) {
       
   704 		anchors_components = anchors.split("&");
       
   705 	}
       
   706 	
       
   707 	var len = anchors_components.length;
       
   708 	for(var i=0;i<len;i++) {
       
   709 		comp = anchors_components[i];
       
   710 		if(comp.indexOf("t=") === 0) {
       
   711 			pageoffset = comp;
       
   712 		}
       
   713 	}
       
   714 	if (pageoffset.substring(2) != null) {
       
   715 		offsettime = pageoffset.substring(2);
       
   716 	}
       
   717   }
       
   718   return offsettime;
       
   719 };
       
   720 __IriSP.addTimeFragment = function (hash_part,time) {
       
   721 	
       
   722 	if (time.length === 0) {
       
   723 		return hash_part;
       
   724 	}
       
   725 	var t_pos = hash_part.indexOf("t=");
       
   726 	var res = "";
       
   727 	if (t_pos >= 0) {
       
   728 		res = hash_part.replace(/t=\d*/, "t="+time);
       
   729 	}
       
   730 	else {
       
   731 		res = hash_part;
       
   732 		if(res.length === 0) {
       
   733 			res = "#";
       
   734 		}
       
   735 		if(hash_part.length > 0 && hash_part !=="#" ) {
       
   736 			res = res + "&";
       
   737 		}
       
   738 		res = res + "t="+time;
       
   739 	}
       
   740 	return res;
       
   741 };
       
   742   
   702 __IriSP.ignoreTimeFragment = function(url){
   743 __IriSP.ignoreTimeFragment = function(url){
   703  if (url.split("#")[1] != null) {
   744  if (url.split("#")[1] != null) {
   704 	var pageurl= url.split("#")[0];
   745 	var pageurl= url.split("#")[0];
   705  }
   746  }
   706  return pageurl;
   747  return pageurl;
   707 }
   748 };
   708 
   749 
   709 
   750 
   710 /* CODE SPECIAL JW PLAYER  creation + listener */
   751 /* CODE SPECIAL JW PLAYER  creation + listener */
   711 
   752 
   712 __IriSP.currentPosition 	= 0; 
   753 __IriSP.currentPosition 	= 0; 
   763 						attributes
   804 						attributes
   764 					);
   805 					);
   765 	
   806 	
   766 	// need a methode to 
   807 	// need a methode to 
   767 	// re execute if this swf call does'nt work 
   808 	// re execute if this swf call does'nt work 
   768 }
   809 };
   769 
   810 
   770 
   811 
   771 
   812 
   772 /* API DAILYMOTION 	*/
   813 /* API DAILYMOTION 	*/
   773 onDailymotionPlayerReady = function (playerid){
   814 onDailymotionPlayerReady = function (playerid){
   780 	var time = __IriSP.retrieveTimeFragment(url);
   821 	var time = __IriSP.retrieveTimeFragment(url);
   781 	__IriSP.startPosition = time;
   822 	__IriSP.startPosition = time;
   782 	__IriSP.DailymotionAddListeners();	
   823 	__IriSP.DailymotionAddListeners();	
   783 	
   824 	
   784 	__IriSP.MyApiPlayer.ready(playerid);
   825 	__IriSP.MyApiPlayer.ready(playerid);
   785 }
   826 };
   786 __IriSP.DailymotionAddListeners = function () {
   827 __IriSP.DailymotionAddListeners = function () {
   787 	if (__IriSP.player) { 
   828 	if (__IriSP.player) { 
   788 		__IriSP.trace("__IriSP.addListeners","ADD  Listener ");
   829 		__IriSP.trace("__IriSP.addListeners","ADD  Listener ");
   789 		//__IriSP.player.addEventListener("onStateChange", "__IriSP.DailymotionPositionListener");
   830 		//__IriSP.player.addEventListener("onStateChange", "__IriSP.DailymotionPositionListener");
   790 		setTimeout("__IriSP.DailymotionPositionListener()",100);
   831 		setTimeout("__IriSP.DailymotionPositionListener()",100);
   792 		__IriSP.player.addModelListener("VOLUME", "__IriSP.volumeListener");
   833 		__IriSP.player.addModelListener("VOLUME", "__IriSP.volumeListener");
   793 		//__IriSP.player.addModelListener('STATE', '__IriSP.stateMonitor');
   834 		//__IriSP.player.addModelListener('STATE', '__IriSP.stateMonitor');
   794 	} else {
   835 	} else {
   795 		__IriSP.setTimeout("__IriSP.DailymotionAddListeners()",100);
   836 		__IriSP.setTimeout("__IriSP.DailymotionAddListeners()",100);
   796 	}
   837 	}
   797 }
   838 };
   798 __IriSP.DailymotionPositionListener = function() { 
   839 __IriSP.DailymotionPositionListener = function() { 
   799 	
   840 	
   800 	__IriSP.currentPosition = __IriSP.player.getCurrentTime();
   841 	__IriSP.currentPosition = __IriSP.player.getCurrentTime();
   801 	//__IriSP.trace("__IriSP.DailymotionPositionListener",__IriSP.currentPosition);
   842 	//__IriSP.trace("__IriSP.DailymotionPositionListener",__IriSP.currentPosition);
   802 	//__IriSP.trace("__IriSP.currentPosition",__IriSP.currentPosition);
   843 	//__IriSP.trace("__IriSP.currentPosition",__IriSP.currentPosition);
   806 	// afficher annotation 
   847 	// afficher annotation 
   807 	/*__IriSP.MyLdt.checkTime(__IriSP.currentPosition);
   848 	/*__IriSP.MyLdt.checkTime(__IriSP.currentPosition);
   808 	*/
   849 	*/
   809 	
   850 	
   810 	setTimeout("__IriSP.DailymotionPositionListener()",10);
   851 	setTimeout("__IriSP.DailymotionPositionListener()",10);
   811 }
   852 };
   812 
   853 
   813 /* API YOUTUBE 	*/
   854 /* API YOUTUBE 	*/
   814 onYouTubePlayerReady= function (playerid){
   855 onYouTubePlayerReady= function (playerid){
   815 
   856 
   816 	var url = document.location.href;
   857 	var url = document.location.href;
   825 	
   866 	
   826 	
   867 	
   827 	__IriSP.YouTubeAddListeners();	
   868 	__IriSP.YouTubeAddListeners();	
   828 	__IriSP.trace("onYouTubePlayerReady=",time);
   869 	__IriSP.trace("onYouTubePlayerReady=",time);
   829 	//__IriSP.MyApiPlayer.ready(playerid);
   870 	//__IriSP.MyApiPlayer.ready(playerid);
   830 }
   871 };
   831 __IriSP.YouTubeAddListeners = function () {
   872 __IriSP.YouTubeAddListeners = function () {
   832 	if (__IriSP.player) { 
   873 	if (__IriSP.player) { 
   833 		__IriSP.trace("__IriSP.addListeners","ADD  Listener ");
   874 		__IriSP.trace("__IriSP.addListeners","ADD  Listener ");
   834 		__IriSP.player.addEventListener("onStateChange", "__IriSP.YouTubeStateMonitor");
   875 		__IriSP.player.addEventListener("onStateChange", "__IriSP.YouTubeStateMonitor");
   835 		setTimeout("__IriSP.YouTubePositionListener()",100);
   876 		setTimeout("__IriSP.YouTubePositionListener()",100);
   836 		__IriSP.player.addModelListener("VOLUME", "__IriSP.volumeListener");
   877 		__IriSP.player.addModelListener("VOLUME", "__IriSP.volumeListener");
   837 		//__IriSP.player.addModelListener('STATE', '__IriSP.stateMonitor');
   878 		//__IriSP.player.addModelListener('STATE', '__IriSP.stateMonitor');
   838 	} else {
   879 	} else {
   839 		__IriSP.setTimeout("__IriSP.YouTubePositionListener()",100);
   880 		__IriSP.setTimeout("__IriSP.YouTubePositionListener()",100);
   840 	}
   881 	}
   841 }
   882 };
   842 __IriSP.YouTubePositionListener = function() { 
   883 __IriSP.YouTubePositionListener = function() { 
   843 	
   884 	
   844 	__IriSP.currentPosition = __IriSP.player.getCurrentTime();
   885 	__IriSP.currentPosition = __IriSP.player.getCurrentTime();
   845 	//__IriSP.trace("__IriSP.YouTubePositionListener",__IriSP.currentPosition);
   886 	//__IriSP.trace("__IriSP.YouTubePositionListener",__IriSP.currentPosition);
   846 	//__IriSP.trace("__IriSP.currentPosition",__IriSP.currentPosition);
   887 	//__IriSP.trace("__IriSP.currentPosition",__IriSP.currentPosition);
   851 	// afficher annotation 
   892 	// afficher annotation 
   852 	__IriSP.MyLdt.checkTime(__IriSP.currentPosition);
   893 	__IriSP.MyLdt.checkTime(__IriSP.currentPosition);
   853 	
   894 	
   854 	
   895 	
   855 	setTimeout("__IriSP.YouTubePositionListener()",10);
   896 	setTimeout("__IriSP.YouTubePositionListener()",10);
   856 }
   897 };
   857 __IriSP.YouTubeStateMonitor = function (obj) { 
   898 __IriSP.YouTubeStateMonitor = function (obj) { 
   858 	__IriSP.player.addModelListener('__IriSP.YouTubeStateMonitor ', newstate);
   899 	__IriSP.player.addModelListener('__IriSP.YouTubeStateMonitor ', newstate);
   859 	//alert(newstate+" "+obj.newstate);
   900 	//alert(newstate+" "+obj.newstate);
   860 	 if(newstate == '2')
   901 	 if(newstate == '2')
   861     {
   902     {
   878 	} else if (newstate == '3'){
   919 	} else if (newstate == '3'){
   879 		__IriSP.trace("__IriSP.stateMonitor","BUFFERING : ");
   920 		__IriSP.trace("__IriSP.stateMonitor","BUFFERING : ");
   880 		//changePageUrlOffset(currentPosition);
   921 		//changePageUrlOffset(currentPosition);
   881 	}
   922 	}
   882 	
   923 	
   883 }
   924 };
   884 
   925 
   885 /* API VIMEO 	*/
   926 /* API VIMEO 	*/
   886 onVimeoPlayerReady= function (playerid){
   927 onVimeoPlayerReady= function (playerid){
   887 
   928 
   888 	var url = document.location.href;
   929 	var url = document.location.href;
   897 	
   938 	
   898 	
   939 	
   899 	__IriSP.YouTubeAddListeners();	
   940 	__IriSP.YouTubeAddListeners();	
   900 	__IriSP.trace("onYouTubePlayerReady=",time);
   941 	__IriSP.trace("onYouTubePlayerReady=",time);
   901 	//__IriSP.MyApiPlayer.ready(playerid);
   942 	//__IriSP.MyApiPlayer.ready(playerid);
   902 }
   943 };
   903 __IriSP.VimeoAddListeners = function () {
   944 __IriSP.VimeoAddListeners = function () {
   904 	if (__IriSP.player) { 
   945 	if (__IriSP.player) { 
   905 		__IriSP.trace("__IriSP.addListeners","ADD  Listener ");
   946 		__IriSP.trace("__IriSP.addListeners","ADD  Listener ");
   906 		__IriSP.player.addEventListener("onStateChange", "__IriSP.YouTubeStateMonitor");
   947 		__IriSP.player.addEventListener("onStateChange", "__IriSP.YouTubeStateMonitor");
   907 		setTimeout("__IriSP.YouTubePositionListener()",100);
   948 		setTimeout("__IriSP.YouTubePositionListener()",100);
   908 		__IriSP.player.addModelListener("VOLUME", "__IriSP.volumeListener");
   949 		__IriSP.player.addModelListener("VOLUME", "__IriSP.volumeListener");
   909 		//__IriSP.player.addModelListener('STATE', '__IriSP.stateMonitor');
   950 		//__IriSP.player.addModelListener('STATE', '__IriSP.stateMonitor');
   910 	} else {
   951 	} else {
   911 		__IriSP.setTimeout("__IriSP.YouTubePositionListener()",100);
   952 		__IriSP.setTimeout("__IriSP.YouTubePositionListener()",100);
   912 	}
   953 	}
   913 }
   954 };
   914 __IriSP.VimeoPositionListener = function() { 
   955 __IriSP.VimeoPositionListener = function() { 
   915 	
   956 	
   916 	__IriSP.currentPosition = __IriSP.player.getCurrentTime();
   957 	__IriSP.currentPosition = __IriSP.player.getCurrentTime();
   917 	//__IriSP.trace("__IriSP.YouTubePositionListener",__IriSP.currentPosition);
   958 	//__IriSP.trace("__IriSP.YouTubePositionListener",__IriSP.currentPosition);
   918 	//__IriSP.trace("__IriSP.currentPosition",__IriSP.currentPosition);
   959 	//__IriSP.trace("__IriSP.currentPosition",__IriSP.currentPosition);
   923 	// afficher annotation 
   964 	// afficher annotation 
   924 	__IriSP.MyLdt.checkTime(__IriSP.currentPosition);
   965 	__IriSP.MyLdt.checkTime(__IriSP.currentPosition);
   925 	
   966 	
   926 	
   967 	
   927 	setTimeout("__IriSP.YouTubePositionListener()",10);
   968 	setTimeout("__IriSP.YouTubePositionListener()",10);
   928 }
   969 };
   929 __IriSP.VimeoStateMonitor = function (obj) { 
   970 __IriSP.VimeoStateMonitor = function (obj) { 
   930 	__IriSP.player.addModelListener('__IriSP.YouTubeStateMonitor ', newstate);
   971 	__IriSP.player.addModelListener('__IriSP.YouTubeStateMonitor ', newstate);
   931 	//alert(newstate+" "+obj.newstate);
   972 	//alert(newstate+" "+obj.newstate);
   932 	 if(newstate == '2')
   973 	 if(newstate == '2')
   933     {
   974     {
   950 	} else if (newstate == '3'){
   991 	} else if (newstate == '3'){
   951 		__IriSP.trace("__IriSP.stateMonitor","BUFFERING : ");
   992 		__IriSP.trace("__IriSP.stateMonitor","BUFFERING : ");
   952 		//changePageUrlOffset(currentPosition);
   993 		//changePageUrlOffset(currentPosition);
   953 	}
   994 	}
   954 	
   995 	
   955 }
   996 };
   956 
   997 
   957 /* API JW PLAYER 	*/
   998 /* API JW PLAYER 	*/
   958 __IriSP.playerReady  = function (thePlayer) {
   999 __IriSP.playerReady  = function (thePlayer) {
   959 
  1000 
   960 	__IriSP.trace("__IriSP.playerReady","PLAYER READY !!!!!!!!!!!!");
  1001 	__IriSP.trace("__IriSP.playerReady","PLAYER READY !!!!!!!!!!!!");
   973 	__IriSP.startPosition = time;
  1014 	__IriSP.startPosition = time;
   974 	//__IriSP.trace("__IriSP.playerReady"," LISTENER LAUCHER");
  1015 	//__IriSP.trace("__IriSP.playerReady"," LISTENER LAUCHER");
   975 	__IriSP.addListeners();	
  1016 	__IriSP.addListeners();	
   976 	//__IriSP.trace("__IriSP.playerReady"," LISTENER END");
  1017 	//__IriSP.trace("__IriSP.playerReady"," LISTENER END");
   977 	
  1018 	
   978 }
  1019 };
   979 __IriSP.addListeners = function () {
  1020 __IriSP.addListeners = function () {
   980 	if (__IriSP.player) { 
  1021 	if (__IriSP.player) { 
   981 		__IriSP.trace("__IriSP.addListeners","ADD  Listener ");
  1022 		__IriSP.trace("__IriSP.addListeners","ADD  Listener ");
   982 		__IriSP.player.addModelListener("TIME", "__IriSP.positionListener");
  1023 		__IriSP.player.addModelListener("TIME", "__IriSP.positionListener");
   983 		__IriSP.player.addControllerListener("VOLUME", "__IriSP.volumeListener");
  1024 		__IriSP.player.addControllerListener("VOLUME", "__IriSP.volumeListener");
   985 	} else {
  1026 	} else {
   986 		__IriSP.setTimeout("__IriSP.addListeners()",100);
  1027 		__IriSP.setTimeout("__IriSP.addListeners()",100);
   987 	}
  1028 	}
   988 
  1029 
   989 	// et changer les boutons
  1030 	// et changer les boutons
   990 }
  1031 };
   991 __IriSP.stateMonitor = function (obj) { 
  1032 __IriSP.stateMonitor = function (obj) { 
   992 
  1033 
   993 	
  1034 	
   994 	 if(obj.newstate == 'PAUSED')
  1035 	 if(obj.newstate == 'PAUSED')
   995     {
  1036     {
  1008 	} else if (obj.newstate == 'BUFFERING'){
  1049 	} else if (obj.newstate == 'BUFFERING'){
  1009 		__IriSP.trace("__IriSP.stateMonitor","BUFFERING : ");
  1050 		__IriSP.trace("__IriSP.stateMonitor","BUFFERING : ");
  1010 		//changePageUrlOffset(currentPosition);
  1051 		//changePageUrlOffset(currentPosition);
  1011 	}
  1052 	}
  1012 	
  1053 	
  1013 }
  1054 };
  1014 __IriSP.positionListener = function(obj) { 
  1055 __IriSP.positionListener = function(obj) { 
  1015 	//__IriSP.trace("__IriSP.positionListener",obj.position);
  1056 	//__IriSP.trace("__IriSP.positionListener",obj.position);
  1016 	__IriSP.currentPosition = obj.position; 
  1057 	__IriSP.currentPosition = obj.position; 
  1017 	//var tmp = document.getElementById("posit");
  1058 	//var tmp = document.getElementById("posit");
  1018 	//if (tmp) { tmp.innerHTML = "position: " + __IriSP.currentPosition; }
  1059 	//if (tmp) { tmp.innerHTML = "position: " + __IriSP.currentPosition; }
  1023 	//__IriSP.jQuery("#amount").val(obj.position+" s");
  1064 	//__IriSP.jQuery("#amount").val(obj.position+" s");
  1024 	// afficher annotation 
  1065 	// afficher annotation 
  1025 	__IriSP.MyLdt.checkTime(__IriSP.currentPosition);
  1066 	__IriSP.MyLdt.checkTime(__IriSP.currentPosition);
  1026 	
  1067 	
  1027 	
  1068 	
  1028 }
  1069 };
  1029 __IriSP.volumeListener   = function (obj) { 
  1070 __IriSP.volumeListener   = function (obj) { 
  1030 	__IriSP.currentVolume = obj.percentage; 
  1071 	__IriSP.currentVolume = obj.percentage; 
  1031 	var tmp = document.getElementById("vol");
  1072 	var tmp = document.getElementById("vol");
  1032 	if (tmp) { tmp.innerHTML = "volume: " + __IriSP.currentVolume; }
  1073 	if (tmp) { tmp.innerHTML = "volume: " + __IriSP.currentVolume; }
  1033 }	
  1074 };
  1034 
  1075 
  1035 
  1076 
  1036 
  1077 
  1037 
  1078 
  1038 /* 	UTIL */
  1079 /* 	UTIL */
  1039 // code from http://stackoverflow.com/questions/822452/strip-html-from-text-javascript
  1080 // code from http://stackoverflow.com/questions/822452/strip-html-from-text-javascript
  1040 __IriSP.stripHtml = function(s){
  1081 __IriSP.stripHtml = function(s){
  1041 	return s.replace(/\\&/g, '&amp;').replace(/\\</g, '&lt;').replace(/\\>/g, '&gt;').replace(/\\t/g, '&nbsp;&nbsp;&nbsp;').replace(/\\n/g, '<br />').replace(/'/g, '&#39;').replace(/"/g, '&quot;');
  1082 	return s.replace(/\\&/g, '&amp;').replace(/\\</g, '&lt;').replace(/\\>/g, '&gt;').replace(/\\t/g, '&nbsp;&nbsp;&nbsp;').replace(/\\n/g, '<br />').replace(/'/g, '&#39;').replace(/"/g, '&quot;');
  1042 }
  1083 };
  1043 // conversion de couleur Decimal vers HexaDecimal || 000 si fff 
  1084 // conversion de couleur Decimal vers HexaDecimal || 000 si fff 
  1044 __IriSP.DEC_HEXA_COLOR = function (dec){
  1085 __IriSP.DEC_HEXA_COLOR = function (dec){
  1045 	 var hexa='0123456789ABCDEF',hex='';
  1086 	 var hexa='0123456789ABCDEF',hex='';
  1046 	 var tmp;
  1087 	 var tmp;
  1047 	 while (dec>15){
  1088 	 while (dec>15){
  1050 		  dec = Math.floor(dec/16);
  1091 		  dec = Math.floor(dec/16);
  1051 	 }
  1092 	 }
  1052 	 hex = hexa.charAt(dec)+hex;
  1093 	 hex = hexa.charAt(dec)+hex;
  1053 	 //if (hex == "FFCC00"){ hex="";/* by default color of Ldt annotation */ }
  1094 	 //if (hex == "FFCC00"){ hex="";/* by default color of Ldt annotation */ }
  1054 	 return(hex);
  1095 	 return(hex);
  1055 }
  1096 };
  1056 
  1097 
  1057 
  1098 
  1058 /*
  1099 /*
  1059 private function colorNbrToHexaStr(c:int):String{
  1100 private function colorNbrToHexaStr(c:int):String{
  1060                   var s:String = c.toString(16);
  1101                   var s:String = c.toString(16);
  1085 	this.annotations = new Array();
  1126 	this.annotations = new Array();
  1086 	this.duration = duration;
  1127 	this.duration = duration;
  1087 	this.annotationOldRead="";
  1128 	this.annotationOldRead="";
  1088 	__IriSP.LDTligne = this;
  1129 	__IriSP.LDTligne = this;
  1089 	__IriSP.trace("__IriSP.Ligne","CREATE "+__IriSP.LDTligne);
  1130 	__IriSP.trace("__IriSP.Ligne","CREATE "+__IriSP.LDTligne);
  1090 }	
  1131 };
  1091 __IriSP.Ligne.prototype.addAnnotation = function (json){
  1132 __IriSP.Ligne.prototype.addAnnotation = function (json){
  1092 	var myAnnotation = new __IriSP.Annotation(json,this.duration);
  1133 	var myAnnotation = new __IriSP.Annotation(json,this.duration);
  1093 	this.annotations.push(myAnnotation);
  1134 	this.annotations.push(myAnnotation);
  1094 	//__IriSP.trace("__IriSP.Ligne.prototype.addAnnotation  ","add annotation "+title);
  1135 	//__IriSP.trace("__IriSP.Ligne.prototype.addAnnotation  ","add annotation "+title);
  1095 }
  1136 };
  1096 __IriSP.Ligne.prototype.onClickLigneAnnotation = function(id){
  1137 __IriSP.Ligne.prototype.onClickLigneAnnotation = function(id){
  1097 	//changePageUrlOffset(currentPosition);
  1138 	//changePageUrlOffset(currentPosition);
  1098 	//player.sendEvent('SEEK', this.start);
  1139 	//player.sendEvent('SEEK', this.start);
  1099 	//__IriSP.trace("SEEK",this.start);
  1140 	//__IriSP.trace("SEEK",this.start);
  1100 }
  1141 };
  1101 __IriSP.Ligne.prototype.searchLigneAnnotation  = function(id){
  1142 __IriSP.Ligne.prototype.searchLigneAnnotation  = function(id){
  1102 	/*for (){
  1143 	/*for (){
  1103 	}*/
  1144 	}*/
  1104 }
  1145 };
  1105 __IriSP.Ligne.prototype.listAnnotations 	   = function(){
  1146 __IriSP.Ligne.prototype.listAnnotations 	   = function(){
  1106 
  1147 
  1107 }
  1148 };
  1108 __IriSP.Ligne.prototype.nextAnnotation 		   = function (){
  1149 __IriSP.Ligne.prototype.nextAnnotation 		   = function (){
  1109 	var annotationCibleNumber = this.numAnnotation(this.annotationOldRead)+1;
  1150 	var annotationCibleNumber = this.numAnnotation(this.annotationOldRead)+1;
  1110 	var annotationCible = this.annotations[annotationCibleNumber];
  1151 	var annotationCible = this.annotations[annotationCibleNumber];
  1111 
  1152 
  1112 	if(annotationCibleNumber<this.annotations.length-1){
  1153 	if(annotationCibleNumber<this.annotations.length-1){
  1113 		annotationCible.begin
  1154 		annotationCible.begin;
  1114 		__IriSP.player .sendEvent('SEEK', annotationCible.begin/1000);
  1155 		__IriSP.player .sendEvent('SEEK', annotationCible.begin/1000);
  1115 		__IriSP.trace("LIGNE  ","| next = "+annotationCibleNumber+" - "+this.annotations.length+" | seek :"+annotationCible.begin/1000);
  1156 		__IriSP.trace("LIGNE  ","| next = "+annotationCibleNumber+" - "+this.annotations.length+" | seek :"+annotationCible.begin/1000);
  1116 	}else{
  1157 	}else{
  1117 		__IriSP.player .sendEvent('SEEK', this.annotations[0].begin/1000);
  1158 		__IriSP.player .sendEvent('SEEK', this.annotations[0].begin/1000);
  1118 	}
  1159 	}
  1119 	
  1160 	
  1120 	
  1161 	
  1121 }
  1162 };
  1122 __IriSP.Ligne.prototype.numAnnotation 		   = function (annotationCible){
  1163 __IriSP.Ligne.prototype.numAnnotation 		   = function (annotationCible){
  1123 	for (var i=0; i < this.annotations.length; ++i){
  1164 	for (var i=0; i < this.annotations.length; ++i){
  1124 		if(annotationCible == this.annotations[i]){
  1165 		if(annotationCible == this.annotations[i]){
  1125 			return i;
  1166 			return i;
  1126 		}
  1167 		}
  1127 	}
  1168 	}
  1128 }
  1169 };
  1129 __IriSP.Ligne.prototype.checkTime			   = function(time){
  1170 __IriSP.Ligne.prototype.checkTime			   = function(time){
  1130 	var annotationTempo = -1;
  1171 	var annotationTempo = -1;
  1131 	
  1172 	
  1132 	for (var i=0; i < this.annotations.length; ++i){
  1173 	for (var i=0; i < this.annotations.length; ++i){
  1133 		annotationTempo = this.annotations[i];	
  1174 		annotationTempo = this.annotations[i];	
  1167 			//__IriSP.jQuery("#Ldt-Show-Arrow").animate({left:'0%'},1000);
  1208 			//__IriSP.jQuery("#Ldt-Show-Arrow").animate({left:'0%'},1000);
  1168 			this.annotationOldRead = annotationTempo;
  1209 			this.annotationOldRead = annotationTempo;
  1169 		}
  1210 		}
  1170 	}
  1211 	}
  1171 	__IriSP.trace("__IriSP.Ligne.prototype.checkTimeLigne",annotationTempo);
  1212 	__IriSP.trace("__IriSP.Ligne.prototype.checkTimeLigne",annotationTempo);
  1172 }
  1213 };
  1173 
  1214 
  1174 
  1215 
  1175 /* CLASS Annotation */
  1216 /* CLASS Annotation */
  1176 
  1217 
  1177 __IriSP.Annotation = function (){
  1218 __IriSP.Annotation = function (){
  1181 	var media 			= null;
  1222 	var media 			= null;
  1182 	var description	= null;
  1223 	var description	= null;
  1183 	var title 			= null;
  1224 	var title 			= null;
  1184 	var color 			= null;
  1225 	var color 			= null;
  1185 	var tags			= null;
  1226 	var tags			= null;
  1186 	__IriSP.trace("annotation ","r�ussi")
  1227 	__IriSP.trace("annotation ","réussi");
  1187 }	
  1228 };
  1188 __IriSP.Annotation = function(json,duration){
  1229 __IriSP.Annotation = function(json,duration){
  1189 	this.id 			= json.id;
  1230 	this.id 			= json.id;
  1190 	this.begin 			= json.begin;
  1231 	this.begin 			= json.begin;
  1191 	this.end 			= json.end;
  1232 	this.end 			= json.end;
  1192 	this.media 			= json.media;
  1233 	this.media 			= json.media;
  1199 	// draw it 
  1240 	// draw it 
  1200 	this.draw();
  1241 	this.draw();
  1201 	this.drawTags();
  1242 	this.drawTags();
  1202 	//
  1243 	//
  1203 	__IriSP.trace("Annotation created : ",this.id);
  1244 	__IriSP.trace("Annotation created : ",this.id);
  1204 }	
  1245 };
  1205 
  1246 
  1206 __IriSP.Annotation.prototype.draw 				  = function(){
  1247 __IriSP.Annotation.prototype.draw 				  = function(){
  1207 
  1248 
  1208 	
  1249 	
  1209 	//alert (this.duration);
  1250 	//alert (this.duration);
  1223 	//var thisNode = __IriSP.jQuery();
  1264 	//var thisNode = __IriSP.jQuery();
  1224 	//addTip("#"+this.id, __IriSP.stripHtml(titleForDiv),"#000");
  1265 	//addTip("#"+this.id, __IriSP.stripHtml(titleForDiv),"#000");
  1225 	
  1266 	
  1226 	__IriSP.jQuery("#"+this.id).fadeTo(0,0.3);
  1267 	__IriSP.jQuery("#"+this.id).fadeTo(0,0.3);
  1227 	__IriSP.jQuery("#"+this.id).mouseover(function() {
  1268 	__IriSP.jQuery("#"+this.id).mouseover(function() {
  1228 		__IriSP.jQuery("#"+this.id).animate({opacity: 0.6}, 5)
  1269 		__IriSP.jQuery("#"+this.id).animate({opacity: 0.6}, 5);
  1229 	}).mouseout(function(){		
  1270 	}).mouseout(function(){		
  1230 		__IriSP.jQuery("#"+this.id).animate({opacity: 0.3}, 5)
  1271 		__IriSP.jQuery("#"+this.id).animate({opacity: 0.3}, 5);
  1231 	});
  1272 	});
  1232 	__IriSP.trace("__IriSP.Annotation.prototype.draw","ADD ANOTATION : "+this.begin+" "+this.end+" "+__IriSP.stripHtml(this.title)+" | "+startPourcent+" | "+endPourcent+" | duration = "+this.duration);
  1273 	__IriSP.trace("__IriSP.Annotation.prototype.draw","ADD ANOTATION : "+this.begin+" "+this.end+" "+__IriSP.stripHtml(this.title)+" | "+startPourcent+" | "+endPourcent+" | duration = "+this.duration);
  1233 	
  1274 	
  1234 }	
  1275 };
  1235 __IriSP.Annotation.prototype.drawTags 			  = function(){
  1276 __IriSP.Annotation.prototype.drawTags 			  = function(){
  1236 	var KeywordPattern = '<a href=\"\"> '+' </a>';
  1277 	var KeywordPattern = '<a href=\"\"> '+' </a>';
  1237 	
  1278 	
  1238 	//__IriSP.trace(" !? Tags : ",this.tags);
  1279 	//__IriSP.trace(" !? Tags : ",this.tags);
  1239 	
  1280 	
  1240 	if (this.tags!=undefined){
  1281 	if (this.tags!=undefined){
  1241 		for (var i = 0; i < this.tags.length; ++i){
  1282 		for (var i = 0; i < this.tags.length; ++i){
  1242 			this.htmlTags += '<span> '+__IriSP.MyTags.getTitle(this.tags[i]['id-ref'])+' </span>'+" , ";
  1283 			this.htmlTags += '<span> '+__IriSP.MyTags.getTitle(this.tags[i]['id-ref'])+' </span>'+" , ";
  1243 		}		
  1284 		}		
  1244 	}
  1285 	}
  1245 }
  1286 };
  1246 __IriSP.Annotation.prototype.tootTipAnnotation    = function() {
  1287 __IriSP.Annotation.prototype.tootTipAnnotation    = function() {
  1247 	// 1 chercher le div correspondant
  1288 	// 1 chercher le div correspondant
  1248 	// 2 y mettre les information
  1289 	// 2 y mettre les information
  1249 	return this.color + ' ' + this.type + ' apple';
  1290 	return this.color + ' ' + this.type + ' apple';
  1250 }
  1291 };
  1251 __IriSP.Annotation.prototype.onRollOverAnnotation = function (){
  1292 __IriSP.Annotation.prototype.onRollOverAnnotation = function (){
  1252 	//this.tootTip();
  1293 	//this.tootTip();
  1253 }		
  1294 };
  1254 __IriSP.Annotation.prototype.timeToPourcent 	  = function(time,timetotal){
  1295 __IriSP.Annotation.prototype.timeToPourcent 	  = function(time,timetotal){
  1255 	return (parseInt(Math.round(time/timetotal*100)));
  1296 	return (parseInt(Math.round(time/timetotal*100)));
  1256 }
  1297 };
  1257  
  1298  
  1258 
  1299 
  1259 /* CLASS Tags */
  1300 /* CLASS Tags */
  1260 
  1301 
  1261 __IriSP.Tags = function(object){
  1302 __IriSP.Tags = function(object){
  1262 	this.myTags 	=	object;
  1303 	this.myTags 	=	object;
  1263 	this.htmlTags 	= 	null;
  1304 	this.htmlTags 	= 	null;
  1264 	this.weigthMax 	= 	0;
  1305 	this.weigthMax 	= 	0;
  1265 	//this.mySegments  = 	new array();
  1306 	//this.mySegments  = 	new array();
  1266 }
  1307 };
  1267 __IriSP.Tags.prototype.addAnnotation = function (annotation){
  1308 __IriSP.Tags.prototype.addAnnotation = function (annotation){
  1268 	for (var i = 0; i < this.myTags.length; ++i){
  1309 	for (var i = 0; i < this.myTags.length; ++i){
  1269 		this.myTags[i].mySegments = new Array(); 
  1310 		this.myTags[i].mySegments = new Array(); 
  1270 		if (annotation.tags!=null){
  1311 		if (annotation.tags!=null){
  1271 			for (var j = 0; j < annotation.tags.length; ++j){
  1312 			for (var j = 0; j < annotation.tags.length; ++j){
  1272 				if (this.myTags[i]['id'] == annotation.tags[j]['id-ref']){
  1313 				if (this.myTags[i]['id'] == annotation.tags[j]['id-ref']){
  1273 					this.myTags[i].mySegments.push([annotation.begin,annotation.end,annotation.id]);
  1314 					this.myTags[i].mySegments.push([annotation.begin,annotation.end,annotation.id]);
  1274 					var weigthTempo = this.myTags[i].mySegments.length
  1315 					var weigthTempo = this.myTags[i].mySegments.length;
  1275 					var tempo = this.myTags[i].mySegments[weigthTempo-1];
  1316 					var tempo = this.myTags[i].mySegments[weigthTempo-1];
  1276 					//__IriSP.trace ("__IriSP.Tags.prototype.addAnnotation ","  "+this.myTags[i]['meta']['dc:title']+" "+this.myTags[i]['id']+" : "+tempo[0]+" - "+tempo[1]);
  1317 					//__IriSP.trace ("__IriSP.Tags.prototype.addAnnotation ","  "+this.myTags[i]['meta']['dc:title']+" "+this.myTags[i]['id']+" : "+tempo[0]+" - "+tempo[1]);
  1277 					
  1318 					
  1278 					if (this.weigthMax < weigthTempo ){
  1319 					if (this.weigthMax < weigthTempo ){
  1279 						this.weigthMax = weigthTempo;
  1320 						this.weigthMax = weigthTempo;
  1280 					}
  1321 					}
  1281 				}
  1322 				}
  1282 			}
  1323 			}
  1283 		}
  1324 		}
  1284 	}
  1325 	}
  1285 }
  1326 };
  1286 __IriSP.Tags.prototype.getTitle = function (id){
  1327 __IriSP.Tags.prototype.getTitle = function (id){
  1287 	for (var i = 0; i < this.myTags.length; ++i){
  1328 	for (var i = 0; i < this.myTags.length; ++i){
  1288 		if(this.myTags[i]['id']==id){
  1329 		if(this.myTags[i]['id']==id){
  1289 			return(this.myTags[i]['meta']['dc:title']);
  1330 			return(this.myTags[i]['meta']['dc:title']);
  1290 		}
  1331 		}
  1291 	}
  1332 	}
  1292 
  1333 
  1293 }
  1334 };
  1294 __IriSP.Tags.prototype.draw = function (){
  1335 __IriSP.Tags.prototype.draw = function (){
  1295 
  1336 
  1296 	__IriSP.trace("__IriSP.Tags.prototype.draw"," !!! WELL START " );
  1337 	__IriSP.trace("__IriSP.Tags.prototype.draw"," !!! WELL START " );
  1297 	for (var i = 0; i < this.myTags.length; ++i){
  1338 	for (var i = 0; i < this.myTags.length; ++i){
  1298 		__IriSP.trace("__IriSP.Tags.prototype.draw"," ADD Tags : "+this.myTags[i]['id']);
  1339 		__IriSP.trace("__IriSP.Tags.prototype.draw"," ADD Tags : "+this.myTags[i]['id']);
  1305 	}
  1346 	}
  1306 	
  1347 	
  1307 	__IriSP.jQuery('#Ldt-Tags').html(this.htmlTags);
  1348 	__IriSP.jQuery('#Ldt-Tags').html(this.htmlTags);
  1308 	__IriSP.trace("__IriSP.Tags.prototype.draw"," !!!!  END WMAX= "+this.weigthMax );
  1349 	__IriSP.trace("__IriSP.Tags.prototype.draw"," !!!!  END WMAX= "+this.weigthMax );
  1309 	
  1350 	
  1310 }
  1351 };
  1311 __IriSP.Tags.prototype.show = function (id){
  1352 __IriSP.Tags.prototype.show = function (id){
  1312 	
  1353 	
  1313 	var timeStartOffsetA	=	100000000000000000000;
  1354 	var timeStartOffsetA	=	100000000000000000000;
  1314 	var timeStartOffsetB	=	100000000000000000000;
  1355 	var timeStartOffsetB	=	100000000000000000000;
  1315 	var timeEndOffsetA		=	0;
  1356 	var timeEndOffsetA		=	0;
  1330 			
  1371 			
  1331 			for (var j = 0; j < this.myTags[i].mySegments.length; ++j){
  1372 			for (var j = 0; j < this.myTags[i].mySegments.length; ++j){
  1332 				if(timeStartOffset> this.myTags[i].mySegments[j][0]){
  1373 				if(timeStartOffset> this.myTags[i].mySegments[j][0]){
  1333 					timeStartOffsetA = this.myTags[i].mySegments[j][0];
  1374 					timeStartOffsetA = this.myTags[i].mySegments[j][0];
  1334 					timeStartOffsetB = this.myTags[i].mySegments[j][1];
  1375 					timeStartOffsetB = this.myTags[i].mySegments[j][1];
  1335 					timeStartID		 = this.myTags[i].mySegments[j][2]
  1376 					timeStartID		 = this.myTags[i].mySegments[j][2];
  1336 				}
  1377 				}
  1337 				if(timeStartOffset> this.myTags[i].mySegments[j][0]){
  1378 				if(timeStartOffset> this.myTags[i].mySegments[j][0]){
  1338 					timeEndOffsetA  = this.myTags[i].mySegments[j][0];
  1379 					timeEndOffsetA  = this.myTags[i].mySegments[j][0];
  1339 					timeEndOffsetB  = this.myTags[i].mySegments[j][1];
  1380 					timeEndOffsetB  = this.myTags[i].mySegments[j][1];
  1340 					timeEndID		= this.myTags[i].mySegments[j][2]
  1381 					timeEndID		= this.myTags[i].mySegments[j][2];
  1341 				}
  1382 				}
  1342 			}
  1383 			}
  1343 			
  1384 			
  1344 		}
  1385 		}
  1345 	}
  1386 	}
  1355 	__IriSP.jQuery("#Ldt-Show-Tags").css('width',WidthPourCent+'%');
  1396 	__IriSP.jQuery("#Ldt-Show-Tags").css('width',WidthPourCent+'%');
  1356 	// like arrow script
  1397 	// like arrow script
  1357 	
  1398 	
  1358 	
  1399 	
  1359 	
  1400 	
  1360 }
  1401 };
  1361 
  1402 
  1362 		
  1403 		
  1363 /* CLASS TRACE */
  1404 /* CLASS TRACE */
  1364 
  1405 
  1365 __IriSP.traceNum=0;
  1406 __IriSP.traceNum=0;
  1367 
  1408 
  1368 	if(__IriSP.config.gui.debug===true){
  1409 	if(__IriSP.config.gui.debug===true){
  1369 		__IriSP.traceNum += 1;
  1410 		__IriSP.traceNum += 1;
  1370 		__IriSP.jQuery("<div>"+__IriSP.traceNum+" - "+msg+" : "+value+"</div>").appendTo("#Ldt-output");
  1411 		__IriSP.jQuery("<div>"+__IriSP.traceNum+" - "+msg+" : "+value+"</div>").appendTo("#Ldt-output");
  1371 	}
  1412 	}
  1372 
  1413 };
  1373 }
  1414 
  1374 	
       
  1375 	
       
  1376 	
       
  1377 	
       
  1378 	
       
  1379