頁面裡嵌入播放器,並獲取當前視訊的播放總時間
阿新 • • 發佈:2019-02-19
<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><
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>