I have tested the video, an mp4 file created using Handbreak, on Safari by opening the file directly. Yet when it runs through localhost the file just shows a play arrow with no content.

This is true for both desktop and mobile Safari, yet Firefox and Chrome appear to work fine.

Here's my code:

    <video muted poster="/images/post.jpg" playsinline>
        <source src="/video.mp4" type="video/mp4">
    </video>

1 Answers

0
Shane Hudson On

Answering my own question, it turns out that this is a shortcoming of python -m "SimpleHTTPServer" that I was using to run the localhost server. So it seems Safari requires functionality that SimpleHTTPServer does not provide.

Thankfully, I was able to successfully use Node's version http-server which does appear to have the functionality Safari required.