5

When I try to set the currentTime of the HTML5 Video element in Chrome 5.0.375.86 like:

video.currentTime = 1.0;

I am getting the following javascript exception:

Uncaught Error: INDEX_SIZE_ERR: DOM Exception 1

It works fine in Safari. Has anybody experienced this??

ThiefMaster
  • 310,957
  • 84
  • 592
  • 636
Hamish
  • 796
  • 2
  • 14
  • 25

5 Answers5

5

Try something like this (JS):

function loadStart(event)
{
    video.currentTime = 1.0;
}

function init()
{
    video.addEventListener('loadedmetadata', loadStart, false);
}
document.addEventListener("DOMContentLoaded", init, false);
sibvic
  • 1,622
  • 2
  • 12
  • 19
0

this is work for me

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;
          }
     }
}
Ruthe
  • 363
  • 4
  • 9
0

The problem (at least regarding Chrome) is probably on the server side. Put Header set Accept-Ranges bytes in your .htaccess (this this answer)

Community
  • 1
  • 1
yPhil
  • 8,049
  • 4
  • 57
  • 83
0

As far as I understood an automatic solution is not possible on the iPad, since the user has to click either the poster or the movie according to Apple's documentation.

Nightfirecat
  • 11,432
  • 6
  • 35
  • 51
dirkk0
  • 2,460
  • 28
  • 34
-2
$video.on 'loadedmetadata', ->
            $video[0].currentTime = parseInt(options.history)

with coffeescript & jQuery

veggie
  • 1
  • 1