最近使用したいのでオンラインで見つけましたが、まだ試していません
コードコピーは次のとおりです。
<!doctype html public " - // w3c // dtd xhtml 1.0 transitional // en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns = "http://www.w3.org/1999/xhtml">
<head>
<Meta http-equiv = "content-type" content = "text /html; charset = gb2312" />
<title> un unt ittitled document </title>
</head>
<body>
<p>
<object id = "player" style = "display:none" classid = "clsid:6bf52a52-394a-11d3-b153-00c04f79faa6">
<param name = "invokeurls" value = "-1">
<param name = "autostart" value = "-1">
<param name = "currentposition" value = "0">
<param name = 'uimode' value = 'mini'>
<param name = "url" value = "test.mpg">
</object>
</p>
<input name = "submit" type = "submit" onclick = "getInfo()">
<p>
<スクリプト言語= "javascript">
var time;
関数getInfo(){
var pl = document.getElementById( "player");
time = pl.CurrentMedia.DurationString;
アラート(parseint(pl.currentmedia.durationstring.substring(0,2)*60));
//alert(ParseInt(pl.currentmedia.durationstring.substring(3,5)));
アラート(parseint(pl.currentmedia.durationstring.substring(0,2)*60)+parseint(pl.currentmedia.durationstring.substring(3,5)));
}
</script>
</p>
</body>
</html>