14

I can't seem to get Safari on the iPhone or iPad to offline cache videos. Everything else gets cached just fine when I go offline. The video file is obviously in the manifest, but I just get the broken arrow. Works fine in Safari desktop. Any clues? I've tried both object embed and the video tags.

Trott
  • 66,479
  • 23
  • 173
  • 212
jj.
  • 343
  • 1
  • 7
  • 20

7 Answers7

11

Sadly there’s a ~5 MB limit on offline cache in Mobile Safari. Not much you can do about it.

Community
  • 1
  • 1
Mathias Bynens
  • 144,855
  • 52
  • 216
  • 248
  • 1
    But that's the funny thing, I had read that post, and tested with just a 3gp video at 960k and a simple page (total of 1mb), and it still doesn't play offline. There has got to be something else going on here. – jj. Jun 02 '10 at 16:44
  • 3
    I've done a couple of other posts on SO about it this weekend. Turns out Safari on iPhone / iPad just doesn't cache video or wav files, even if in the manifest - and won't seem to play data URI's either. It seems you just can't use them in offline mode (however if the app has online access it will attempt to fetch them...). It works fine on Safari on the desktop - but obviously that's not very useful. This is true even for very small (~5-10k) sound files. – Iain Collins Jun 14 '10 at 10:45
2

See these two articles for mobile browser cache limits (note that the second one adds vital information):

http://www.yuiblog.com/blog/2010/06/28/mobile-browser-cache-limits/

http://www.yuiblog.com/blog/2010/07/12/mobile-browser-cache-limits-revisited/

It only generically covers html and "external resources", but they didn't explicitly test video files, so maybe these are never cached by Mobile Safari.

Alexander Klimetschek
  • 3,585
  • 31
  • 36
2

Audio & video are not cached by iPhone since they are played by external applications. It seems the only workaround is to store them as base64 in local database or have them cached in application manifest as php(or similar) file but with base64 encoded audio and video content.

Ganesh Krishnan
  • 369
  • 3
  • 6
0

Use the manifest to cache the html pages containing the video tag, then tell your web server to expire the video in 30 years. That way the video will be in the browser cache not the manifest cache.

Steve
  • 241
  • 2
  • 2
0

Update for iOS 4.3 on iPad:

I just tried adding a movie to a manifest file in iOS 4.3.

Safari asked me to allow extending the offline storage and then downloaded the movie.

matejk
  • 798
  • 1
  • 14
  • 27
  • Hmmm. iPad downloaded the movie (also seen in the log of the web server), however it seems that it doesn't store it, because it doesn't play it when iPad is in airplane mode. – matejk Apr 12 '11 at 13:24
0

Perhaps something like this would work: http://www.nihilogic.dk/labs/jsvideo/test2.php

Luke Stanley
  • 1,274
  • 1
  • 16
  • 32
-2

i have read it needs an html5 manifest setup to cache files

user356866
  • 103
  • 1
  • The manifest is correctly defined and works since everything else caches properly, it is just these darn videos. Is offline video caching not in the spec? Couldn't find it anywhere. – jj. Jun 02 '10 at 21:07
  • I'm starting to think that HTML5 does not support offline video caching, but then I hear of other sites doing something like it (Youtube?). Anyone know how they are doing it? – jj. Jun 03 '10 at 02:40