这是一个简单的、简化的 HTML5 视频播放列表。令我惊讶的是,它似乎在 mozzila/chrome/opera 中工作得很好,就像我的意思一样 - 仅在脚本中指定了 ogv。
问题 - 我也必须指定 mp4 和 webm 吗?
如果是这样 - 在这种特殊情况下如何?
IE 呢?
问候
编码:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>HTML5_video</title>
<script>
var videoPlayer;
var video_count = 1;
window.onload = function (){
videoPlayer = document.getElementById("homevideo");
videoPlayer.addEventListener("ended", function (){
video_count++;
if (video_count == 4) video_count = 1;
var nextVideo = video_count+".ogv";
videoPlayer.src = nextVideo;
}, false);
}
</script>
</head>
<body>
<video id="homevideo" width="640" height="360" autoplay autobuffer src="1.ogv"></video>
</body>
</html>