为Windows媒体播放器预览JPG

时间:2010-07-02 16:56:50

标签: windows jpeg embedding preview windows-media-player

我想为我的简单.wmv播放器制作JPG预览版。有任何想法吗?这是......

<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 ="ShowAudioControls"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>

1 个答案:

答案 0 :(得分:1)

你可以在它上面放一个图像,当点击图像时,隐藏它并告诉WMP开始播放吗?像这样:

<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>