Bonjour à tous
Voilà, je souhaite créer des boutons ('play','pause','stop',etc...) pour le player flash que j'ai trouvé.
Vous pouvez le trouver sur :
http://www.jeroenwijering.com/ qui propose d'ailleurs des exemples.
En effectuant un test dont voici le code :
<html>
<head>
<title>Flash Player buttons tests</title>
<script type="text/javascript" src="swfobject.js"></script> </script>
<script type="text/javascript">
function sendEvent(typ,prm) { thisMovie("playlist").sendEvent(typ,prm); };
function thisMovie(movieName) { if(navigator.appName.indexOf("Microsoft") != -1)
{ return window[movieName]; }
else
{ return document[movieName]; }
};
</script>
<style>
li { list-style-type:none; }
a { text-decoration:none; }
a:hover { color:red; }
a:active { color:darkorange;font-style:italic; }
</style>
</head>
<body>
<div id='contenu' style='width:520px;margin:auto;'>
<!-- ####################### ###
#### ### Flash mp3player ### ###
#### ####################### -->
<div id='lecteur' style='width:240px;border:1px dotted;border-right:none;float:left;height:210px;padding:5px;'>
<!-- Title of the bloc -->
<center><h2 style='color:blue;'>xml playlist</h2></center>
<!-- Warning conditionnal message -->
<p id='error'>
<a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.
</p>
<!-- mp3 player -->
<script type="text/javascript">
var s2 = new SWFObject("mp3player.swf", "playlist", "240", "135", "7");
s2.addVariable("file","playlist.xml");
s2.addVariable("backcolor","0x00000");
s2.addVariable("frontcolor","0xEECCDD");
s2.addVariable("lightcolor","0xCC0066");
s2.addVariable("displayheight","0");
s2.addVariable("autostart","true");
s2.addVariable("enablejs","true");
s2.addVariable("javascriptid","playlist");
s2.write("error");
</script>
</div>
<!-- ####################### ###
#### ### Control buttons ### ###
#### ####################### -->
<div id='liste' style='width:220px;border:1px blue dotted;border-left:none;float:left;height:220px;'>
<ul>
<li><a href="javascript:sendEvent('playpause')" >.:: Play / Pause </a></li>
<li><a href="javascript:sendEvent('prev')" >.:: Play the previous item
</a></li>
<li><a href="javascript:sendEvent('next')" >.:: Play the next item
</a></li>
<li><a href="javascript:sendEvent('scrub',currentPosition + 5)" >.:: Scrub forward
</a></li>
<li><a href="javascript:sendEvent('scrub',currentPosition - 5)" >.:: Scrub backward
</a></li>
<li><a href="javascript:sendEvent('volume',currentVolume + 10)" >.:: Volume +10%
</a></li>
<li><a href="javascript:sendEvent('volume',currentVolume - 10)" >.:: Volume -10%
</a></li>
<li><a href="javascript:sendEvent('playitem',1)" >.:: Play the 2nd item
</a></li>
<li><a href="javascript:sendEvent('stop')" >.:: Stop load and play
</a></li>
</ul>
</div>
</div>
</body>
</html>
Je me retrouve avec des boutons qui ne fonctionnent pas et une erreur dans la console qui est la suivante :
thisMove("playlist").sendEvent is not a function...
Je n'arrive pas à trouver d'où cela peut venir, quelqu'un saurait-il m'expliquer?