Giter Site home page Giter Site logo

Comments (8)

libobjc avatar libobjc commented on May 13, 2024
  1. 读 Player 的缓存进度就行。
  2. 要看 Player 触发什么行为,不同 Player 现象不同。

from ktvhttpcache.

iTofu avatar iTofu commented on May 13, 2024
  1. 可能是我没表述清楚,缓存进度指的是全部的进度。使用 Demo 试了下监听 loadedTimeRanges 并不满足需求,如果打开播放页后进度条直接拖动到比如 2/3 的位置,待该处到视频结尾处 cached 完成,CMTimeRangeGetEnd(timeRange) 就等于视频的 duration 了,而实际上从大概视频开始处到 2/3 左右的位置并没有缓存。
    因为要拿 AVAsset 做生成 gif 功能,如果没有全部缓存完就去生成,代码就 gg 了:
    AVURLAsset *asset = [AVURLAsset assetWithURL:[NSURL URLWithString:[KTVHTTPCache proxyURLStringWithOriginalURLString:originalUrl]]];
    // generate images with offset and time interval...
  2. AVPlayer 的 -seekToTime: 方法。

from ktvhttpcache.

libobjc avatar libobjc commented on May 13, 2024
  1. 建议不要依赖 KTVHTTPCache 来完成该 Feature,先不使用缓存把 Feature 完成,再无缝接入。
  2. 受调用时机、具体用法影响,现象也会有差异,我无法给你明确结论。建议去掉缓存抓包看下。

from ktvhttpcache.

iTofu avatar iTofu commented on May 13, 2024

嗯,目前是再 Download 一遍来实现,就是有点浪费用户流量……

from ktvhttpcache.

libobjc avatar libobjc commented on May 13, 2024

你可以在 Download 时给 Proxy URL,这样会和 Player 共用缓存。你也无需改实现逻辑。

from ktvhttpcache.

iTofu avatar iTofu commented on May 13, 2024

好主意,我试试,谢谢~

from ktvhttpcache.

iTofu avatar iTofu commented on May 13, 2024

12月24的版本,-cacheFetchCacheItemWithURLString: 返回的 KTVHCDataCacheItemcacheLength > totalLength ……

from ktvhttpcache.

libobjc avatar libobjc commented on May 13, 2024

在并发缓存时就是可能出现局部重合,文件名最后一位就是用于处理这种情况。出现频率取决于对同一 URL 并发加载量,例如反复 Seek。

from ktvhttpcache.

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.