Craft Web Design + Development
Brendan McKeown

Hey there. I’m a front-end developer and web designer. I'm all about creating websites and web apps that look and perform flawlessly on any device using HTML, CSS, and Javascript. I enjoy utilizing libraries, frameworks and preprocessors that improve efficiency and reduce confusion.

Check out my resume.

HTML5 Video in iOS Safari with HTTP Authentication Won't Play

I ran into an iOS Safari bug recently where a HTML5 video would not play on a page with basic HTTP authentication enabled by Apache. If I removed the authentication, the video would play fine. However, with authentication turned on and after a successful login, the video would not play.

I found the webkit bug was reported here, but as of writing this post, it hasn't been resolved. Luckily, there is an easy patch that was noted in the comments of the bug report. However, be aware that by implementing this patch, you are effectively allowing all video files behind HTTP authentication to be public. For my case, since it was only a problem in a password-protected testing environment, this wasn't a concern. Anyway, here's the patch I used in my .htaccess file.

# add this to .htaccess
<FilesMatch  "\.(mp4|ogv|webm)$">
    Satisfy any
    order allow,deny
    allow from all
</FilesMatch>