views:

1238

answers:

9

Sorry if this gets posted twice, but Safari crashed while posting the first version, and I don't see it in my profile.

Anyway 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.

+6  A: 

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

Mathias Bynens
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
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
A: 

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

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
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
A: 

was there any more info on whether mobile safari will cache video using cache manifest, or possible workarounds?

ipadder83
A: 

I have got the same problem (with Safari on iPad). Is there any way to circumvent this annoying issue ?

Thanx,

Andy C.

Andy C.
As Iain mentions above, there just doesn't seem to be any built-in way to do this. I thought about trying to write the raw data to the local sqlite db and reading it back, but didn't want to expend the effort.
jj
Well, I am trying to convert short videos (max 10 secs) to animated GIFs (of course there is the 256-color limitation of GIF format).So far it's the only trick I could think of...Andy C.
Andy C.
Yeah, too bad we have to resort to this. You could also use jpeg sequencing with a little Javascript, if you wanted higher-res. Good luck.
jj
A: 

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
A: 

does anyone know if steve's response works?

"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."

Paul
A: 

Has anyone found any developments on this issue? I have the same problem, but have been unable to find a solution. I need both video and audio to work offline in my web app and I can't believe there's no way to make this work.

JGDev
+1  A: 

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
A: 

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