Forums

html5 video support for iphone

The problem: Videos do not load while using safari(or google chrome) on my iPhone. The videos load perfectly on desktop browsers.

Upon googling I found that I may need to have byte range enabled on the server. I found this post on the these forums although there was no answer or relevant discussion. https://www.pythonanywhere.com/forums/topic/1321/

I found this stack overflow article: http://stackoverflow.com/questions/3397241/does-iphone-ipad-safari-require-accept-ranges-header-for-video

Doing the curl command to the mp4 on pythonanywhere looks like it doesn't get only 100 bytes. Doing the curl command to the other server where I copied the mp4 file shows it working correctly. enter image description here

I appreciate any ideas or help on how to get these videos to load properly on mobile devices!

Repo can be found here: https://github.com/massover/lifts

If iOS requires byte range, I don't think there's anything we can do in the short-term. I have raised a ticket to enable byte ranges. We'll have to see how enabling byte ranges will affect other configuration. It may be possible to implement byte ranges yourself depending on your web framework.

My solution (and the correct long term solution) is to not save videos on my Python anywhere server. Instead from my app, I save videos to Amazon s3, and point the html at the videos on s3.

For my case use case, the plan is to save user submitted video, which would could hav caused me to run out space on my Python anywhere server.

Having said that:

  • if you only had static video content
  • and if you refuse to host your static videos elsewhere
  • and byte range support is still not supported on Python anywhere
  • and you are using flask!

Then this blog entry may help you handle the requests in flask: http://blog.asgaard.co.uk/2012/08/03/http-206-partial-content-for-flask-python

cool- thanks for the info!

Hello, I have stumbled upon a similar issue where my videos can't be skipped or rewinded (on Chrome) and on Safari it doesn't even load them. I believe this is an issue with the byte range. My question is have you found a solution for doing all the streaming from Pythonanywhere, instead of relying on AWS?

(I am using Bottle and my static files are set up correctly).

We have not implemented byte range requests yet.