当我尝试在 Chrome 5.0.375.86 中设置 HTML5 Video 元素的 currentTime 时,例如:
video.currentTime = 1.0;
我收到以下 javascript 异常:
Uncaught Error: INDEX_SIZE_ERR: DOM Exception 1
它在 Safari 中运行良好。有没有人经历过这个??
当我尝试在 Chrome 5.0.375.86 中设置 HTML5 Video 元素的 currentTime 时,例如:
video.currentTime = 1.0;
我收到以下 javascript 异常:
Uncaught Error: INDEX_SIZE_ERR: DOM Exception 1
它在 Safari 中运行良好。有没有人经历过这个??
尝试这样的事情(JS):
function loadStart(event)
{
video.currentTime = 1.0;
}
function init()
{
video.addEventListener('loadedmetadata', loadStart, false);
}
document.addEventListener("DOMContentLoaded", init, false);
这对我有用
video = document.getElementById('video');
begin_play = 50;
play_video_frist = true; //if you want to run only frist time
video.addEventListener("play", capture, false);
function capture(event)
{
if (event.type == "play"){
if(play_video_frist){
play_video_frist = false;
video.currentTime = begin_play;
}
}
}
据我了解,iPad 上不可能有自动解决方案,因为根据 Apple 的文档,用户必须点击海报或电影。
问题(至少关于 Chrome)可能出在服务器端。把Header set Accept-Ranges bytes
你的.htaccess
(这个这个答案)
$video.on 'loadedmetadata', ->
$video[0].currentTime = parseInt(options.history)
使用咖啡脚本和 jQuery