问题描述
我正在为iPad 2创建一个包含视频内容的离线网络应用程序。首次加载页面时,视频显示正常。但是当我重新加载页面时,视频的播放按钮就会被破坏。
I am creating an offline webapp for the iPad 2, which includes video content. When the page first loads, the video displays fine. But when I reload the page, the video's play button becomes broken.
我已经进入设置> Safari>高级>网站数据了,果然,视频是在缓存...所以问题似乎是它没有从缓存中检索。
I've gone into Settings > Safari > Advanced > Website Data and, sure enough, the video is in the cache... So the problem seems to be that it is not being retrieved from the cache.
我的HTML代码片段:
My HTML code snippet:
<html manifest="cache.manifest">
...
<video width="320" height="240" controls="controls">
<source src="videos/movie.mp4" type="video/mp4" />
</video>
我的cache.manifest片段:
My cache.manifest snippet:
CACHE MANIFEST
# Updated 2012-08-22 19:49:00
index.php
...
videos/movie.mp4
为了更好的衡量,我的.htaccess片段:
For good measure, my .htaccess snippet:
AddType text/cache-manifest .manifest
AddType video/mp4 .mp4
有没有人有任何想法?
推荐答案
这不幸的是不是答案但是现在之后20小时连续搜索和测试,以解决完全相同的问题,我可以告诉你我现在在哪里。
This unfortunately isn't an answer but after now 20 hours continuous searching and testing to resolve the exact same problem i can tell you where i am now.
这似乎是一个ipad iOS特定的问题,无论大小视频/声音文件是不会在缓存的文件上绘制,虽然它们显然是缓存的,并且在第一次加载时它会播放文件OK。
This appears to be an ipad iOS specific problem where no matter what size the video / sound file is it will not draw on the cached files although they clearly are cached and on first load it plays the file OK.
我试过制作最小的文件视频可能。
我已经看过包装在本机应用程序中,但这不是出于交付原因的选项。
我尝试使用javascript强制在页面加载时重新加载视频.src。
我已尝试过清单文件的所有可能变体。
看看我能忍受的所有Apple开发者文档。
I have tried making the smallest video possible.I have looked at wrapping in a native app but that's not an option for delivery reasons.I have tried forcing a reload of the video .src on page load using javascript.I have tried all possible variations of the manifest file.Looked at all the Apple developer docs i can stomach.
在阅读了数百篇从未真正完成的帖子后,我认为除了让客户购买Android平板电脑之外,答案是使用本地数据库存储应用程序需要时检索二进制形式的视频。不幸的是,我仍然在寻找这方面的例子,但仍然无法找到任何细节。本地保存文本/数字数据不是问题。我只是不知道它是否可以存储原始文件数据并在本地数据库中检索它。
After reading hundreds of posts, that never actually complete, i think the answer, other than getting the client to buy Android tablets, is to use the local database to store the video in binary form to be retrieved when needed by the app. Unfortunately i am still searching for examples of this and as yet cant find any with any detail. Local saving of text / numerical data isn't a problem. I just dont know if its possible to store the raw file data and retrieve it in a local database.
对不起它不是你所追求的但希望它有助于你指出更少方向。
Sorry its not what you were after but hope it helps point you in less directions.
更新但进展不大。我决定使用base64 ecoded mp4并将文本粘贴到一个简单的xml文件中。我的应用程序将读取此xml视频数据并使用视频标记SRC。这大约是一个4MB的字符串。
An update but not much progress. I decided to use base64 ecoded mp4 and paste the text in a simple xml file. My app would read this xml video data and by using in the video tag SRC. This was about a 4MB string.
这在Chrome中运行良好。当我在Ipad上使用它时,好处是我没有把播放按钮划掉并试图播放然后闪现一条消息它无法完成此操作。
This worked fine in Chrome. When i used it on the Ipad the good points are that i didnt ever get the play button crossed out and it tried to play then flashed a message it could not complete this operation.
这篇关于嵌入式HTML 5视频存储在缓存中,但不会显示在iPad 2上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!