Giter VIP home page Giter VIP logo

Comments (6)

yale8848 avatar yale8848 commented on May 17, 2024

你使用最新版本测试的吗?ren.yale.android:cachewebviewlib:1.2.7
mp4文件不会缓存的,目前CacheWebView不支持多媒体缓存的

from cachewebview.

lijijordan avatar lijijordan commented on May 17, 2024

我改了一下,想用来缓存mp4文件,但是缓存成功了一部分,感觉没有把完整的流都保存下来。
if (extension.toLowerCase().equals("js") || extension.toLowerCase().equals("css") || extension.toLowerCase().equals("mp4")) { return true; }

这个encode是用来干啥呢?
if (mStaticRes.isCanGetEncoding(extension)&&TextUtils.isEmpty(encoding)){ InputStreamUtils inputStreamUtils = new InputStreamUtils(resourseInputStream.getInnerInputStream()); inputStreamUtils.setEncodeBufferSize(CacheConfig.getInstance().getEncodeBufferSize()); long start = System.currentTimeMillis(); InputStream copyInputStream = inputStreamUtils.copy(mEncodingDetect); if (copyInputStream == null){ return null; } resourseInputStream.setInnerInputStream(copyInputStream); encode = inputStreamUtils.getEncoding(); CacheWebViewLog.d(encode+" "+"get encoding timecost: "+(System.currentTimeMillis()-start)+ "ms "+url); }

from cachewebview.

yale8848 avatar yale8848 commented on May 17, 2024

encode是判断html,js,css文件编码的,我当初设计的时候就没有给多媒体文件设计缓存,如果你给视频添加缓存的话是会失败的

from cachewebview.

lijijordan avatar lijijordan commented on May 17, 2024

如果加载流媒体文件应该怎么设计缓存呢?能提示下么?

from cachewebview.

yale8848 avatar yale8848 commented on May 17, 2024

流媒体的一般通过设置代理实现缓存,你可以 参考参考这个库 https://github.com/danikula/AndroidVideoCache

from cachewebview.

lijijordan avatar lijijordan commented on May 17, 2024

OK 谢啦!

from cachewebview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.