0

I have a native video playing in Safari on iPad and I can't move the scrubber (video position selector). This is the code for the video.

  <video id="video-area" controls>
      <source src="videos/person.mp4" type="video/mp4">
  </video>

There's a lot of code within the project, but I've narrowed down the code that interferes with the seeking to the code I use to prevent overscrolling (bouncing) on Safari is preventing me from seeking.

document.ontouchmove = function(event){
   event.preventDefault();
}

Is there a way I can stop that code from interfering with the video, and keeping my screen from over-scrolling?

joeyfb
  • 3,044
  • 3
  • 19
  • 25
  • Possible duplicate of [Disable elastic scrolling in Safari](http://stackoverflow.com/questions/8150191/disable-elastic-scrolling-in-safari) – Alexander O'Mara Sep 30 '16 at 02:02
  • Also, [ipad safari: disable scrolling, and bounce effect?](https://stackoverflow.com/questions/7768269/ipad-safari-disable-scrolling-and-bounce-effect) – Alexander O'Mara Sep 30 '16 at 02:03
  • Nope, I've tried the CSS fixes and it doesn't prevent the window bouncing in my situation. This issue is the javascript code I am using interfering with the video. If you find a reference to the video player issue in any other tickets I'd love to see a solution. – joeyfb Sep 30 '16 at 02:04
  • Your question does not mention any of that. At the moment, it's really just asking the same thing. Are you looking to address why the CSS solution does not work? – Alexander O'Mara Sep 30 '16 at 02:05
  • CSS just wont work in my given situation, and isn't relevant to specifically what I'm asking for, which is a workaround or solution for the JS implementation causing errors with the seeker. – joeyfb Sep 30 '16 at 02:08

1 Answers1

1

This is the general problem that comes with this particular hack. It's not a way to prevent elastic scrolling, so much as it kills all touchmove related actions.

If using this hack, you will need to filter out all the elements you want to be able to receive these events.

document.ontouchmove = function(event){
   if (event.target.tagName === 'VIDEO') {
       return;
   }
   event.preventDefault();
}
Alexander O'Mara
  • 58,688
  • 18
  • 163
  • 171