3

I have a simple HTML5 video player in a hide-able <div> for use on iOS devices for watching MP4 videos. If the user "closes" the player (or, in reality, hides it), I really want to kill the video entirely, preserving the user's bandwidth. The only method for halting video that I know if is videoElement.pause(), which does stop the video from playing, but from watching network stats it looks like the video continues to load until the entire file is complete. I've also tried videoElement.currentTime = videoElement.duration, but that also seems to have no impact on the buffering video.

Is there a way to kill the download? Or is this just a straight HTTP file transfer that JavaScript has no control over?

Andrew
  • 14,204
  • 15
  • 60
  • 104
  • Here's a similar question with an answer http://stackoverflow.com/questions/4071872/html5-video-force-abort-of-buffering – Guy Jun 13 '14 at 21:30

1 Answers1

0

Have you tried emptying the src?

videoElement.pause(); videoElement.src = "";

reader
  • 23
  • 1
  • 4