1

im jumping through different chapters of a movie by setting "currentTime" to xxx seconds. Therefore i have a screen where you can click on so-called "pads" - one per chapter.

If you click on the pad the pad-screen fades out, the movie fades in and start right where it should (see code below). This is perfectly working on any browser. But its NOT working on mobile devices like iPad/iPod/iPhone. I found out that the problem is this

$('video').get(0).currentTime = 

And here is the code:

    $('.chapter_pad a').each( function(index) {
    $(this).click( function() {
        currentVid = index;
        endTime = videos[index]["end"];
        $("#startscreen").fadeOut(0, function() {
            $("#vids").fadeIn(0, function() {
                $('#video').get(0).currentTime = videos[index]["start"];
                $('#video').get(0).play();

            });
        });
    });
});

Explanation: ["start"] and ["end"] are elements from an assoziative array that i created before. This assoziative array holds the chapternames, start- and end-times etc.

Any ideas to solve this are appreciated!

Thanks in advance! Fab

Fab Ulous
  • 79
  • 8
  • Do you see an error in your debugger? – Mike Robinson Oct 25 '12 at 15:49
  • honestly here i just have an iPod - not sure how to debug on that. – Fab Ulous Oct 25 '12 at 15:56
  • If you go into device settings you can enable the developer bar for Safari – Mike Robinson Oct 25 '12 at 17:26
  • ok - it shows up the followin error: Javascript-Error in line 135 http://localhost/~me/app/js/script.js INVALID_SATE_ERR: DOM Exception 11: An attempt was made to use an object that is not, or no longer usable. Maybe thats cause the browser always open up the native controls when playing a video in browser? Any hints? Ohh - and the line 135 is exactly the one with "$('#video').get(0).currentTime = videos[index]["start"];" – Fab Ulous Oct 26 '12 at 09:07
  • 1
    Looks like someone else had the same problem - I did a google search on your exception and eventually found this: http://stackoverflow.com/questions/11252062/playing-html5-video-on-ipad-and-seeking/11252343 – Mike Robinson Oct 26 '12 at 14:02
  • thank you - the problem was that i tried to jump somewhere even the video wasnt there. So i used the css translate(-3000px) to push the video out of the window. I could set the currentTime then ;) But: The problem is, that the iPad jumps to 6.5999999948 even i set 7. – Fab Ulous Nov 04 '12 at 19:12

0 Answers0