Hacker News new | ask | show | jobs
by codetrotter 1666 days ago
I’m on iOS too. From experience it’s usually because the video container, codec, or options, you are using for the video is not supported by iOS.

In your case I see you are using a webm container. iOS prior to version 15 does not support webm natively. Then earlier this year they started adding support for parts of webm in iOS 15. https://9to5mac.com/2021/08/10/apple-adding-webm-audio-codec...

I recommend converting the video using ffmpeg.

The following should give you a video file that will be playable on most mobile devices, even quite old ones.

    ffmpeg -i preview.webm \
      -c:v libx264 -crf 23 -profile:v baseline -level 3.0 -pix_fmt yuv420p \
      -c:a aac -ac 2 -b:a 128k \
      -movflags faststart \
      preview.mp4
The HTML5 video tag supports having multiple video sources so you can still keep the webm as one alternative and browsers will pick either the webm or mp4 depending on support.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/so... for details on multiple sources in the video element. I.e. what changes you need to make to your html.

2 comments

I’m on the latest version of iOS (15.1.1) and it doesn’t load for me either. Perhaps the server hosting the video file is overloaded?
My comment originally only said that webm was not supported prior to iOS 15. But webm videos are not fully supported in iOS 15 either afaik, so I updated the comment to specify that they started adding support for parts of it. You may have seen an earlier version of my comment without that qualifier, in which case I apologize for any confusion.
Ah, thank you very much!