实际上,我有一个带有 JavaScript 功能的 HTML5 页面,它允许我播放 wmv 视频文件。我需要在视频播放时(有暂停或没有暂停)拍摄快照并以任何图像格式 JPG 或 BMP 保存。任何帮助将不胜感激。谢谢你。
<!DOCTYPE HTML>
<html>
<head>
<title>HTML5 video</title>
<script type="text/javascript">
function checkPlay() {
var myVideo = document.getElementById("myVid");
var ytStr = '<iframe width="500" height="500" src="C:\XA0002.wmv" frameborder="0" allowfullscreen></iframe>';
try {
var canPlay = document.getElementsByTagName('video')[0].canPlayType("video/wmv");
if ((canPlay == "no") || (canPlay == "")) {
myVideo.innerHTML = ytStr;
}
new MediaElement(v, { success: function (media) { media.play(); } });
} catch (err) {
myVideo.innerHTML = ytStr;
}
}
</script>
</head>
<body onload="checkPlay()">
<div id="myVid"/>
</body>
</html>