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
  • 298,938
  • 77
  • 579
  • 623
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,512
  • 2
  • 11
  • 17
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
  • 343
  • 3
  • 8
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
  • 7,507
  • 3
  • 52
  • 78
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,114
  • 6
  • 33
  • 50
dirkk0
  • 2,290
  • 26
  • 33
-2
$video.on 'loadedmetadata', ->
            $video[0].currentTime = parseInt(options.history)

with coffeescript & jQuery

veggie
  • 1
  • 1