页面里嵌入播放器,并获取当前视频的播放总时间

来源:互联网 发布:java append 换行 编辑:程序博客网 时间:2024/05/17 07:59

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312">
<title>电子表单设计师(e-form Designer)使用手册</title>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
</head>

<body>
<object id="mPlayer1" width=300 height=300 classid="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6">
<param name="URL" value="D://测试材料//what hurts me the most.mp3">
       
<param name="rate" value="1">
       
<param name="balance" value="0">
       
<param name="currentPosition" value="0">
       
<param name="defaultFrame" value>
       
<param name="playCount" value="100">
       
<param name="autoStart" value="1">
       
<param name="currentMarker" value="0">
       
<param name="invokeURLs" value="1">
       
<param name="baseURL" value>
       
<param name="volume" value="100">
       
<param name="mute" value="0">
       
<param name="uiMode" value="full">
       
<param name="stretchToFit" value="0">
       
<param name="windowlessVideo" value="0">
       
<param name="enabled" value="1">
       
<param name="enableContextMenu" value="1">
       
<param name="fullScreen" value="0">
       
<param name="SAMIStyle" value>
       
<param name="SAMILang" value>
       
<param name="SAMIFilename" value>
       
<param name="captioningID" value>
       
<param name="enableErrorDialogs" value="0">
       
<param name="_cx" value="7779">
       
<param name="_cy" value="1693">
     
</object>

</p>
<input name="submit" type="submit" onclick="getInfo()">
<p>

<script language="javascript">
var time;
 
function getInfo(){
 
var pl=document.getElementById("mPlayer1");
   time
=pl.currentMedia.durationString;  获取时间
   alert(parseInt(pl.currentMedia.durationString.substring(
0,2)*60)); 时间格式设置
  
//alert(parseInt(pl.currentMedia.durationString.substring(3,5)));
  alert(parseInt(pl.currentMedia.durationString.substring(0,2)*60)+parseInt(pl.currentMedia.durationString.substring(3,5)));
}
</script>
</p>




</body>

</html>