Stop HTML5 video from buffering in Safari

I have a simple HTML5 video player in hidden <div>for use on iOS devices to watch MP4 videos. If the user "closes" the player (or, in fact, hides it), I really want to completely kill the video, while maintaining the user's bandwidth. The only method of stopping the video that I know is that it videoElement.pause()does not allow the video to play, but, watching the network statistics, it looks like the video continues to load until the entire file is completed. I also tried videoElement.currentTime = videoElement.duration, but this also does not affect the video buffering.

Is there a way to kill the download? Or is it just a direct transfer of HTTP files with which JavaScript does not control?

+3
source share
1 answer

Have you tried to clear src?

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

0
source

Source: https://habr.com/ru/post/1789484/


All Articles