开发者

Preview JPG for a windows media player

开发者 https://www.devze.com 2023-01-05 18:30 出处:网络
I\'d like to have a JPG preview for my simple .wmv player.Any ideas?Here it is... <div id=\"embed\">

I'd like to have a JPG preview for my simple .wmv player. Any ideas? Here it is...

<div id="embed">
<OBJECT id='mediaPlayer1' width="360" height="240" 
                  classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' 
                  codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'
                  standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject'>
                  <param name='fileName' value="images/video.wmv">
                  <param name='animationatStart' value='true'>
                  <param name='transparentatStart' value='true'>
                  <param name='autoStart' value="false">
                  <param name='showControls' value="true">
                  <param name ="ShowAudi开发者_开发百科oControls"value="true">
                  <param name="ShowStatusBar" value="true">
                  <param name='loop' value="false">
                  <EMBED type='application/x-mplayer2'
                  pluginspage='http://microsoft.com/windows/mediaplayer/en/download/'
                  id='mediaPlayer' name='mediaPlayer' displaysize='4' autosize='-1' 
                  bgcolor='darkblue' showcontrols="true" showtracker='-1' 
                  showdisplay='0' showstatusbar='-1' videoborder3d='-1' width="360" height="240"
                  src="images/video.wmv" autostart="false" designtimesp='5311' loop="false">
                  </EMBED>
                </OBJECT>
                  <br />
</div>


Could you put an image over it and when the image gets clicked, hide it and tell WMP to start playing? Something like this:

<script>
  function handleStartClick() {
    document.getElementById("playbackPreview").style.display = "none";
    //not sure about the next line, mybe you have to remove "controls." or so
    document.getElementById("mediaPlayer1").controls.play();
  }
</script>
<div id="embed" style="position: relative;">
  <OBJECT id='mediaPlayer1' width="360" height="240"[...]</OBJECT>
  <img id='playbackPreview' style="z-index: 100; position: absolute; top: 0px; left: 0px" src="previewimage.jpg" onclick="handleStartClick()" />
</div>
0

精彩评论

暂无评论...
验证码 换一张
取 消