HTML5 offline video caching in mobile safari
Asked Answered
S

7

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.

Sprouse answered 2/6, 2010 at 10:45 Comment(0)
W
11

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

Woodruff answered 2/6, 2010 at 11:3 Comment(2)
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.Sprouse
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.Unexceptional
S
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.

Simulate answered 25/8, 2010 at 17:0 Comment(0)
P
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.

Pianist answered 11/9, 2010 at 13:52 Comment(1)
Have you tried this? Will Mobile Safari play the audio/video in this case?Unabridged
I
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.

Irra answered 20/7, 2010 at 2:42 Comment(0)
T
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.

Teakwood answered 17/3, 2011 at 20:50 Comment(1)
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.Teakwood
I
0

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

Informality answered 26/8, 2011 at 16:45 Comment(0)
U
-2

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

Unmoor answered 2/6, 2010 at 20:38 Comment(2)
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.Sprouse
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?Sprouse

© 2022 - 2024 — McMap. All rights reserved.