<html>
<head>
<title>title>
head>
<body>
<video id="videoPlayerNew" src="http://172.16.16.120:9999/test2.mp4" controls="controls">
your browser does not support the video tag
video>
body>
<script type="text/javascript">
var vid = document.getElementById("videoPlayerNew");
vid.onloadedmetadata = function() {
console.log('metadata loaded!');
console.log(vid.duration); //打印时长
};
script>
html>