<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hi,<br>
      <br>
      I'm assuming you are using X-SendFile to send the file? <br>
      <br>
      If so, you should be able to install the h264 module on
      Nginx/Apache and the web server should take care of the pseudo
      streaming<br>
      <br>
      Also, this kind of streaming works better when the file is
      properly encoded[2]<br>
      <br>
      Cheers,<br>
      <br>
      j<br>
      <br>
      [1] <a href="http://h264.code-shop.com/trac/wiki">http://h264.code-shop.com/trac/wiki</a><br>
      [2] <a href="https://sixohthree.com/streaming-mp4-with-nginx">https://sixohthree.com/streaming-mp4-with-nginx</a><br>
      <br>
      On 05/08/15 14:12, Tom Armitage wrote:<br>
    </div>
    <blockquote
cite="mid:CAJVg935nYNK5pv0VbmM-_uNdUCt3KfC7=XU4KoNENKu6j79SUA@mail.gmail.com"
      type="cite">
      <div dir="ltr">I'm working on a project that displays HTML5 video
        in the browser, and access to those videos is controlled.
        <div><br>
        </div>
        <div>Previously, I was using an expiring S3 URL; now I'm hosting
          the video myself, attached via Paperclip. The uploads
          directory is outside the /public directory of the Rails app;
          there's a URL for the video that, when a user hits it, checks
          if they're authorised to view it, and if so, uses send_file to
          send it to them.</div>
        <div><br>
        </div>
        <div>This no longer works very well now that I'm using send_file
          - I <i>think</i> this comes down to the fact the browser
          requests video with Range headers, getting it in chunks, and
          my poor back-end clearly isn't doing something sophisticiated
          enough.</div>
        <div><br>
        </div>
        <div>My initial thoughts were:</div>
        <div><br>
        </div>
        <div>* something like [<a moz-do-not-send="true"
href="http://stackoverflow.com/questions/6759426/rails-media-file-stream-accept-byte-range-request-through-send-data-or-send-file">http://stackoverflow.com/questions/6759426/rails-media-file-stream-accept-byte-range-request-through-send-data-or-send-file</a>],
          which odes the chunking manually but is beginning to make me
          feel stupid, and also feels fragile</div>
        <div>* is Puma the issue, and would a better web server for
          development work?</div>
        <div><br>
        </div>
        <div>I'm asking because whilst I think I've found the right
          track, some of you might have had experience of this before.</div>
        <div><br>
        </div>
        <div>t.<br clear="all">
          <div><br>
          </div>
          -- <br>
          <div class="gmail_signature">Tom Armitage<br>
            <a moz-do-not-send="true" href="http://infovore.org"
              target="_blank">http://infovore.org</a><br>
            07813 060578</div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Chat mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a>
Archives: <a class="moz-txt-link-freetext" href="http://lists.lrug.org/pipermail/chat-lrug.org">http://lists.lrug.org/pipermail/chat-lrug.org</a>
Manage your subscription: <a class="moz-txt-link-freetext" href="http://lists.lrug.org/options.cgi/chat-lrug.org">http://lists.lrug.org/options.cgi/chat-lrug.org</a>
List info: <a class="moz-txt-link-freetext" href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a>
</pre>
    </blockquote>
    <br>
    <br>
    <div class="moz-signature">-- <br>
      <p>javier ramírez</p>
      <p> <a href="http://javier-ramirez.com" title="javier ramirez">javier
          ramirez's home page (http://javier-ramirez.com)</a><br>
        <a href="http://formatinternet.com" title="format internet :
          ruby on rails blog by javier ramirez">javier ramirez's blog
          (http://formatinternet.com)</a><br>
      </p>
    </div>
  </body>
</html>