xxxxxxxxxx
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML 音频/视频 currentSrc 属性使用-基础教程(div.cn)</title>
</head>
<body>
<button onclick="getVid()" type="button">获得当前视频的 URL:</button>
<br>
<video id="video1" controls="controls">
<source src="movie.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
您的浏览器不支持 HTML5 video 标签。
</video>
<script>
myVid=document.getElementById("video1");
function getVid()
{
alert(myVid.currentSrc);
}
</script>
</body>
</html>