0

Here's my nginx configuration within the server block:

location /mp4/ {
    mp4;
    mp4_buffer_size     6M;
    mp4_max_buffer_size 20M;
    limit_rate 260k;
    limit_rate_after 3m;
}

I also have the following in the http block:

http {
    sendfile        on;
    tcp_nopush      on;
    tcp_nodelay     on;
    sendfile_max_chunk 512k;
}

I loaded the 1.2GB test file http://example.com/mp4/sample.mp4 directly in Chrome browser.

A default built-in player is shown and I can playback with seek and scrub without problem.

But when the video is paused, the rest of the clip is still being downloaded.

I noticed this by monitoring my bandwidth usage on the server side.

I read that the mp4_max_buffer_size and mp4_buffer_size are meant to be setting memory usage on the server side.

How do I prevent the client side from continuously downloading the video in the background when video is paused, so that it won't waste the client's and my server's bandwidth?

KDX
  • 611
  • 2
  • 10
  • 22

1 Answers1

0

The server just fulfills requests. Its up the the browser how much data it requests.

szatmary
  • 29,969
  • 8
  • 44
  • 57
  • It doesn't seem to me it's browser dependent. I'm using the same Chrome browser to playback a YouTube video of 1hr duration, and when I clicked pause, the network activity stops. Is it somehow related to the in-browser player that's being used? Or it can be configure on the server-side for this kind of playback behavior? – KDX Sep 13 '16 at 08:14
  • It's the browser/player. Not the server. The server doesn't know anything about video or streaming or pause buttons. It just sends the data that it is asked for. Dont look at the network activity, look at the network requests in the browser dev tools. – szatmary Sep 13 '16 at 14:06