Mettre un lecteur média player personalisée..

Utilisateur anonyme -  
 Utilisateur anonyme -
Bonjour à tous,
Je souhaite en fait mettre une vidéo d'un flux mms, dans un lecteur avec des bontons play et stop personalisée, comme sur certains sites de web radio, je n'arrive pas à trouver un script qui permet de faire cela, même en fouillans dans les sources des sites web.

Si y'a quelqu'un qui peut me répondre?
Configuration: Windows XP
Internet Explorer 7.0
Cariboost 2.0

1 réponse

  1. Utilisateur anonyme
     
    UP:
    j'ai commencer le script mais les boutons ne sont pas à la bonne place
    c'est sur la page béta de L@ Cinq à http://www.lacinqtv.fr/betasite1/direct.html la vidéo est un test... Mais ce sera pour notre flux.
    <script type="text/javascript">
    <!--
    
    function newImage(arg) {
    	if (document.images) {
    		rslt = new Image();
    		rslt.src = arg;
    		return rslt;
    	}
    }
    
    function changeImages() {
    	if (document.images && (preloadFlag == true)) {
    		for (var i=0; i<changeImages.arguments.length; i+=2) {
    			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
    		}
    	}
    }
    
    var preloadFlag = false;
    function preloadImages() {
    	if (document.images) {
    		decoupe_05_over = newImage("images_V3/decoupe_05-over.jpg");
    		decoupe_06_over = newImage("images_V3/decoupe_06-over.jpg");
    		decoupe_07_over = newImage("images_V3/decoupe_07-over.jpg");
    		decoupe_08_over = newImage("images_V3/decoupe_08-over.jpg");
    		decoupe_15_over = newImage("images_V3/decoupe_15-over.jpg");
    		decoupe_18_over = newImage("images_V3/decoupe_18-over.jpg");
    		decoupe_24_over = newImage("images_V3/decoupe_24-over.jpg");
    		decoupe_27_over = newImage("images_V3/decoupe_27-over.jpg");
    		decoupe_28_over = newImage("images_V3/decoupe_28-over.jpg");
    		decoupe_29_over = newImage("images_V3/decoupe_29-over.jpg");
    		decoupe_30_over = newImage("images_V3/decoupe_30-over.jpg");
    		decoupe_31_over = newImage("images_V3/decoupe_31-over.jpg");
    		decoupe_36_over = newImage("images_V3/decoupe_36-over.jpg");
    		decoupe_37_over = newImage("images_V3/decoupe_37-over.jpg");
    		decoupe_38_over = newImage("images_V3/decoupe_38-over.jpg");
    		decoupe_41_over = newImage("images_V3/decoupe_41-over.jpg");
    		preloadFlag = true;
    }	}
    }
    
    // -->
    </script>
    <object id="video1" width=288 height=268 classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" 
    codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab" 
    standby="Loading Microsoft® Windows Media™ Player components..." 
    type="application/x-oleobject"> 
        <param name="Filename" value="http://www.bfmtv.fr/divers/player_bfmtv.asx">
        <param name="AudioStream" value="-1">
        <param name="AutoSize" value="0">
        <param name="AutoStart" value="-1">
        <param name="AnimationAtStart" value="0">
        <param name="AllowScan" value="-1">
        <param name="AllowChangeDisplaySize" value="-1">
        <param name="AutoRewind" value="0">
        <param name="Balance" value="0">
        <param name="BaseURL" value>
        <param name="BufferingTime" value="5">
        <param name="CaptioningID" value>
        <param name="ClickToPlay" value="0">
        <param name="CursorType" value="0">
        <param name="CurrentPosition" value="-1">
        <param name="CurrentMarker" value="0">
        <param name="DefaultFrame" value>
        <param name="DisplayBackColor" value="0">
        <param name="DisplayForeColor" value="16777215">
        <param name="DisplayMode" value="0">
        <param name="DisplaySize" value="4">
        <param name="Enabled" value="1">
        <param name="EnableContextMenu" value="0">
        <param name="EnablePositionControls" value="0">
        <param name="EnableFullScreenControls" value="0">
        <param name="EnableTracker" value="0">
        <param name="InvokeURLs" value="-1">
        <param name="Language" value="-1">
        <param name="Mute" value="0">
        <param name="PlayCount" value="1">
        <param name="PreviewMode" value="0">
        <param name="Rate" value="1">
        <param name="SAMILang" value>
        <param name="SAMIStyle" value>
        <param name="SAMIFileName" value>
        <param name="SelectionStart" value="-1">
        <param name="SelectionEnd" value="-1">
        <param name="SendOpenStateChangeEvents" value="-1">
        <param name="SendWarningEvents" value="-1">
        <param name="SendErrorEvents" value="-1">
        <param name="SendKeyboardEvents" value="0">
        <param name="SendMouseClickEvents" value="0">
        <param name="SendMouseMoveEvents" value="0">
        <param name="SendPlayStateChangeEvents" value="-1">
        <param name="ShowCaptioning" value="0">
        <param name="ShowControls" value="1">
        <param name="ShowAudioControls" value="1">
        <param name="ShowDisplay" value="0">
        <param name="ShowGotoBar" value="0">
        <param name="ShowPositionControls" value="0">
        <param name="ShowStatusBar" value="-1">
        <param name="ShowTracker" value="0">
        <param name="TransparentAtStart" value="-1">
        <param name="VideoBorderWidth" value="0">
        <param name="VideoBorderColor" value="0">
        <param name="VideoBorder3D" value="0">
        <param name="Volume" value="-1000">
        <param name="WindowlessVideo" value="-1">
        <EMBED TYPE="application/x-mplayer2" 
    		PLUGINSPAGE="http://www.microsoft.com/..."
    		SRC="http://www.bfmtv.fr/divers/player_bfmtv.asx"
    		NAME="NSPlay" width=288 height=268 AutoStart=false
    		WIDTH=200
    		HEIGHT=50
    		showstatusbar="1" showcontrols="1" showdisplay="0" showgotobar="0" autosize="0" showcaptioning="0" 
    		enabletracker="0" showtracker="0" enablecontextmenu="0" volume="0" showpositioncontrols="0" showaudiocontrols="0"> </EMBED> 
      </OBJECT>
    </script>
    </script>
    	</select>
    </form>
    </div>
    
    <script language="javascript" type="text/javascript">
    LoadMenus();
    </script>
    <script type="text/javascript">
    // ---------------------------------------------------
    // COMPATIBILITE
    // ---------------------------------------------------
    var IEWin = 1;
    if(navigator.appVersion.indexOf("Win")<0 || navigator.appName.indexOf("Explorer")<0) IEWin = 0;
    
    
    // ---------------------------------------------------
    // CONTROLE DU WINDOWS MEDIA PLAYER
    // ---------------------------------------------------
    var playing = true;
    function onPlay()
    {
    	if((NSPlay.ReadyState==4) && (NSPlay.PlayState==0)) { 
    		try {
    			NSPlay.Play();	
    		} catch (error) { window.setTimeout("NSPlay.Play();",1000); }	
    		updateEtat("connect");
    		
    		playing = true;
    		changeImages('decoupe_29', 'images_V3/decoupe_29-over.jpg');
    		
    		//MAJ popup fin d'?coute
    		//10/04/2003
    		window.clearTimeout(top.timerFinEcoute);
    		top.timerFinEcoute = top.setTimeout("OpenPopupFinEcoute()",top.tempsEcoute);
    		if(top.popupFinEcoute) top.popupFinEcoute.close();
    		
    		var framedata="";
    		var uniq = new Date();
    		uniq = "?"+uniq.getTime();
    		framedata="d_data.html"+uniq;
    		window.open( framedata, "data", "copyhistory=no" );
    	} /*else {
    		onStop();
    	}*/
    } 
    
    function onStop()
    { 
    	if((NSPlay.ReadyState==4) && (NSPlay.PlayState==2)) {
    		NSPlay.Stop();
    		updateEtat("stop");
    		
    		playing = false;
    		changeImages('decoupe_29', 'images_V3/decoupe_29.jpg');
    		
    		//MAJ popup fin d'?coute
    		//10/04/2003
    		window.clearTimeout(top.timerFinEcoute);
    	}
    } 
    
    function onPause()
    {
    	if((NSPlay.ReadyState==4) && (NSPlay.PlayState==2)) NSPlay.Pause();
    	updateEtat("pause");
    }*/
    //--------------------
    //Affichage de l'?tat du player
    //--------------------
    function updateEtat(etat)
    {
    		var text="";
    		switch (etat) {
    			case "onair":
    				text = "";
    				break;
    			case "stop":
    				text = "Arr&ecirc;t";
    				break;
    			case "pause":
    				text = "Pause";
    				break;
    			case "connect":
    				text = "Connexion...";
    				break;
    			case "chargement":
    				text = "Chargement...";
    				break;
    			case "heure":
    				text = top.datesPochettes[top.index];
    				break;
    			case "vide":
    				text = "&nbsp;";
    				break;
    			default:
    				text = "&nbsp;";
    				break;
    		}
    		
    		try{	
    			document.getElementById("timeLiveDiv").innerHTML = text;
    		} catch(error) {;}
    }
    
    // --------------------------------------------------------------------------------------------
    // Mise ? jour de l'index de consultation de l'historique des s
    // --------------------------------------------------------------------------------------------
    top.index = 0;
    
    // --------------------------------------------------------------------------------------------
    // Navigation dans les "lastfive". 
    // --------------------------------------------------------------------------------------------
    function pochettePrecedente()
    {
    	suniq = new Date();
    	suniq = "&uniq="+suniq.getTime();
    	if (top.variablesInitDone!=1) return;
    	if (top.idTitres[0] != -1 && top.index==0) top.index=1;
    	top.index = top.index + 1;
    	if (top.index > top.tailleHistoriquePochettes) top.index = 0;
    	displayElement(top.index);	
    }
    
    // --------------------------------------------------------------------------------------------
    // Mise ? jour des ?l?ments  + titre
    // --------------------------------------------------------------------------------------------
    function displayElement(pindex)
    {
    	if (top.variablesInitDone!=1) return;
    	
    	top.index = pindex;
    	updatePochette();
    	updateTitle();
    	updateTime();
    	
    	if(top.index == 0) {
    		showList();
    	}
    }
    
    // -----------------------------------------------------------------------------------------
    // MISE A JOUR  / TITRE / TIME
    // -----------------------------------------------------------------------------------------
    var srcProgramme='images_V3/spacer.gif';
    function updatePochette()
    {
    	if (document.images)
    	{
    		if (top.idTitres[0] == -1 && top.index==0)
    		{
    			document.getElementById('imagePochette').src = srcProgramme;
    			//document.getElementById("animateurDiv").style.visibility="visible";
    		}
    		else
    		{
    			//document.getElementById("animateurDiv").style.visibility="hidden";
    			document.getElementById('imagePochette').src = top.imagesPochettesSrc[top.index];
    		}
    	}
    }
    
    function updateTitle()
    {
    	var texte1,texte2,s_interprete,s_titre;
    
    	if (top.idTitres[top.index] == -1) // pas d'infos sur les s pub
    	{
    		try{
    			document.getElementById("titleLiveDiv").innerHTML = "";	
    			document.getElementById("artistLiveDiv").innerHTML = "";
    			
    			parent.document.title = 'L@ Cinq';
    		} catch(error) {;}	
    		return;
    	} 
    	s_interprete = top.interpretesPochettes[top.index].replace(/##/g," - ");
    	s_titre = top.titresPochettes[top.index];
    	
    	if(s_titre.length > 24) {
    		if(!IEWin) {
    			texte1 = s_titre.substr(0,21) + '...';
    		} else {
    			texte1 = "<marquee direction='left' scrolldelay='200'>" + s_titre + "</marquee>";
    		}
    	} else {
    		texte1 = s_titre;
    	}
    	
    	if(s_interprete.length > 24) {
    		if(!IEWin) {
    			texte2 = s_interprete.substr(0,21) + '...';
    		} else {
    			texte2 = "<marquee direction='left' scrolldelay='200'>" + s_interprete + "</marquee>";
    		}
    	} else {
    		texte2 = s_interprete;
    	}
    		 
    	try{		
    		document.getElementById("titleLiveDiv").innerHTML = texte1;
      		document.getElementById("artistLiveDiv").innerHTML = texte2;
      		
      		parent.document.title = s_titre + ' - ' + s_interprete;
      		
      		
    	} catch(error) {;}
    }
    function updateTime()
    {
    	var texte1;
    
    	if (top.index == 0) { 
    		updateEtat("onair");
    	} else {
    		updateEtat("heure");
    	}
    }
    
    // ------------------------------------------------------------------------------------
    // FONCTION APPELEE PAR LA BOUCLE PERPETUELLE
    // ------------------------------------------------------------------------------------
    function updateFromStream()
    {
    	displayElement(0);
    
    	// Gestion des risques conflictuels annonceur live & banner standard
    	if (top.idTitres[0] == -1 && top.idBanners[0] == -1) // && curbanstate!=1) // si pas de titre et pas de banner --> banners par defaut
    	{
    		curbanstate = 1;
    	}
    	else
    	if (top.idTitres[0] != -1 && top.idBanners[0] == -1 && curbanstate!=2) // si titre et pas de banner --> banners standards
    	{
    		curbanstate = 2;
    	}
    
    	if (top.idFichePassage!=-1)	// Gestion stats de PASSAGE
    	{
    		var idban = top.idBanners[0];
    		if (idban<0) idban = 0;
    		var statsurl = top.statsServer
    				+ "?sid=passage"
    				+ "&mid=" + top.idMedia
    				+ "&aid=1"
    				+ "&tid=1"
    				+ "&id=" + top.idFichePassage
    				+ "&uid=1"
    				+ "&baid=" + idban;
    		top.updateStats(statsurl);	
    	}
    	
    	//if (top.idTitres[0] == 1293294) { displayIdn1293294();}
    }
    
    // ---------------------------------------------------
    // ANALYSE DES EVENEMENTS DE SYNCHRONISATION
    // ---------------------------------------------------
    
    function parseScript(bstrScript)
    {
    	str = bstrScript;
    	lastidx = 0;
    	keep_going = 1;
    	while (keep_going)
    	{
    		// Recherche de l'URL
    		idx = str.indexOf('<BR>', lastidx);
    		if (idx>=0)
    		{
    			surl = str.substring(lastidx, idx);
    			lastidx = idx + 4;
    			// Recherche de la TARGET
    			idx = str.indexOf('<BR>', lastidx);
    			if (idx >= 0)
    			{
    				starget = str.substring(lastidx, idx);
    				lastidx = idx + 4;
    				
    				updateFrame(surl , starget )
    			}
    			else keep_going = 0;
    		}
    		else keep_going = 0;
    	}
    }
    
    function updateFrame(bstrURL, bstrTarget)
    {
    	top.variablesInitDone = 0;
    	window.open( bstrURL, bstrTarget, "copyhistory=no" );
    }
    
    </script>
    <script language="javascript" for="NSPlay" event="ScriptCommand(sType, sParam)">
    // ---------------------------------------------------
    // INTERCEPTION DES EVENEMENTS DE SYNCHRONISATION
    // ---------------------------------------------------
    if(IEWin) {
    	var event = sType.toUpperCase();
    	if ( event == "TEXT" ) {parseScript( sParam ); updateEtat("onair");}
    	else if ( event == "URL" ) {updateEtat("chargement"); alert( "Mise-à-jour Microsoft MediaPlayer en cours...");  }
    	else if ( event == "HOUR" )
    	{
    		curdate = new Date(sParam);
    		top.curyear = curdate.getFullYear();
    		top.curmonth = curdate.getMonth()+1;
    		top.curmonthday = curdate.getDate();
    		top.curweekday = curdate.getDay();
    		if (top.curweekday == 0) top.curweekday = 6 //dimanche
    		else top.curweekday = top.curweekday - 1;
    		top.curhour = curdate.getHours();
    		top.curminute = curdate.getMinutes();
    		top.curseconde = curdate.getSeconds();
    	}
    }
    </script>
    <script language="javascript" for="NSPlay" event="PlayStateChange(lOldState, lNewState)">
    // ---------------------------------------------------
    // GESTION des changements d'états de lecture
    // ---------------------------------------------------
    if ( lNewState == 0 ) // Stopped 
    {
    	updateEtat("stop");
    } 			
    else if ( lNewState == 1 ) // Paused	
    {
    	updateEtat("pause");
    } 			
    else if ( lNewState == 2 ) // Playing	
    {
    	updateEtat("onair");
    } 			
    else if ( lNewState == 3 ) // Waiting for stream to begin
    {
    	updateEtat("chargement");
    } 			
    </script>
    <script language="javascript" for="NSPlay" event="OpenStateChange(lOldState, lNewState)">
    	if ( lNewState == 0 ) {} 			// File is Closed
    	else if ( lNewState == 1 ) {updateEtat("connect");}		// Loading ASX File
    	else if ( lNewState == 2 ) {updateEtat("connect");}		// Loading NSC File
    	else if ( lNewState == 3 ) {updateEtat("connect");}	// Locating Server
    	else if ( lNewState == 4 ) {updateEtat("connect");}	// Connecting to the Server
    	else if ( lNewState == 5 ) {updateEtat("connect");}		// Opening or listening for the stream
    	else if ( lNewState == 6 ) {}		// File is open
    </script>
    <script language="javascript" for="NSPlay" event="Buffering(bStart)">
    		if (bStart) {updateEtat("chargement");}
    		else updateEtat("onair");
    </script>
    <SCRIPT type="text/javascript" SRC="cookie.js"><!--
    var src_loaded = false;
    //--></SCRIPT>
    <script type="text/javascript">
    // ---------------------------------------------------
    //  Initialisation
    // ---------------------------------------------------
    </script>
    			<a href="#" onClick="onStop();"
    				onmouseover="changeImages('decoupe_27', 'images_V3/decoupe_27-over.jpg'); return true;"
    				onmouseout="changeImages('decoupe_27', 'images_V3/decoupe_27.jpg'); return true;"
    				onmousedown="changeImages('decoupe_27', 'images_V3/decoupe_27-over.jpg'); return true;"
    				onmouseup="changeImages('decoupe_27', 'images_V3/decoupe_27-over.jpg'); return true;">
    				<img name="decoupe_27" src="images_V3/decoupe_27.jpg" width="37" height="41" border="0" alt="Stop" title="Stop"></a></td>
    		</td>
    		<td colspan="2">
    			<a href="#" onClick="onPlay();"
    				onmouseover="if(!playing) changeImages('decoupe_29', 'images_V3/decoupe_29-over.jpg'); return true;"
    				onmouseout="if(!playing) changeImages('decoupe_29', 'images_V3/decoupe_29.jpg'); return true;"
    				onmousedown="if(!playing) changeImages('decoupe_29', 'images_V3/decoupe_29-over.jpg'); return true;"
    				onmouseup="if(!playing) changeImages('decoupe_29', 'images_V3/decoupe_29-over.jpg'); return true;">
    				<img name="decoupe_29" src="images_V3/decoupe_29-over.jpg" width="37" height="41" border="0" alt="Lecture" title="Lecture"></a></td>
    		</td>
    		
    </td>
    	</tr>
    </table>
    <!-- End ImageReady Slices -->
    <SCRIPT LANGUAGE="javascript">
    top.liveInitDone = 1;
    top.menuInitDone = 1;
    top.radioInitDone = 1;
    
    //-------------------------------------------------------
    // COMPATIBILITE
    //-------------------------------------------------------
    
    var timerRefresh = null;
    var timerRefresh2 = null;
    
    function refreshPlayerNS() {
    	var curdate = new Date();
    	
    	parent.curyear = curdate.getFullYear();
    	parent.curmonth = curdate.getMonth()+1;
    	parent.curmonthday = curdate.getDate();
    	parent.curweekday = curdate.getDay();
    	if (parent.curweekday == 0) parent.curweekday = 6 //dimanche
    	else parent.curweekday = parent.curweekday - 1;
    	parent.curhour = curdate.getHours();
    	parent.curminute = curdate.getMinutes();
    	parent.curseconde = curdate.getSeconds();
    	
    	var uniqParam = new Date();
    	uniqParam = "?&uniq="+uniqParam.getTime();
    	window.open( "d_data.html"+uniqParam, "data", "copyhistory=no" );
    	window.clearTimeout(timerRefresh);
    	timerRefresh = window.setTimeout('refreshPlayerNS();',60000);
    }
    
    function refreshPochetteNS() {
    	window.clearTimeout(timerRefresh2);
    	timerRefresh2 = window.setTimeout('refreshPochetteNS();',30000);
    	
    	if(parent.variablesInitDone==1) {
    		updateFromStream();	
    	}
    	
    	parent.variablesInitDone = 0;	
    }
    
    if(IEWin) {
    	document.getElementById("nsplaydiv").style.visibility = "hidden";
    }
    
    if(!IEWin) {
    	timerRefresh = window.setTimeout('refreshPlayerNS();',60000);
    	timerRefresh2 = window.setTimeout('refreshPochetteNS();',70000);
    }
    
    </SCRIPT>
    <script type="text/javascript">
    xtnv = document;					//parent.document or top.document or document         
    xtsd = "http://logc146";
    xtsite = "361856";
    xtn2 = "18";						// level 2 site 
    xtpage = "maxi_player_lacinq";	//page name (with the use of :: to create chapters)
    xtdi = "";							//implication degree
    xtimod = "1";
    </script>
    <!-- script type="text/javascript" src="../framework/Xiti/xtclicks.js"></script-->
    <script type="text/javascript" src="../framework/Xiti/xtcore.js"></script>
    <script type="text/javascript">
    //XITI
    	if (xtclzone>0) {xtNodesload(xd);}  
    </script>
    


    Help
    -1