Hamish
Hamish

Reputation: 806

HTML5 Video - Chrome - Error settings currentTime

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??

Upvotes: 5

Views: 11179

Answers (5)

yPhil
yPhil

Reputation: 8357

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

Upvotes: 0

Ruthe
Ruthe

Reputation: 363

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;
          }
     }
}

Upvotes: 0

veggie
veggie

Reputation: 1

$video.on 'loadedmetadata', ->
            $video[0].currentTime = parseInt(options.history)

with coffeescript & jQuery

Upvotes: -2

dirkk0
dirkk0

Reputation: 2570

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.

Upvotes: 0

sibvic
sibvic

Reputation: 1662

Try something like this (JS):

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

function init()
{
    video.addEventListener('loadedmetadata', loadStart, false);
}
document.addEventListener("DOMContentLoaded", init, false);

Upvotes: 5

Related Questions