What Justin said in his reply is true, but there's more to this story:
Some browsers (notably Safari on both Mac and iOS)
require that the server support HTTP range requests in order to play back video files. (See
https://tools.ietf.org/html/rfc7233 for the gory details of how range requests work.)
Plug.Static does not currently support range requests, so video files (MP4, MOV, etc.) will not play correctly in Safari (known issue: written up as
https://github.com/elixir-lang/plug/issues/523). Note that this is a Plug issue, not Phoenix, but since Phoenix depends on Plug, it seems reasonable to discuss it here. I have a pull request pending against Plug that addresses this issue (
https://github.com/elixir-lang/plug/pull/526), but there is still work I need to do before it is ready to merge. I've had to set it aside for work on other projects, but hope to get back to it soon.
Two things you could do to help nudge this along:
- Review the PR (or recruit somebody with deep knowledge of Plug and RFC 7233 to do so)
- Test the PR in your local environment and let us know if it works, or if not, how it fails
As a quick-n-dirty alternative, you could also try
https://hex.pm/packages/plug_range, but please be aware that this module implements none of the content restrictions found in Plug.Static. It could easily be used to reveal files stored on your server that you might not want to make public. I would advise caution in using that module.
-Eric