Giter Club home page Giter Club logo

ktvhttpcache's Introduction

KTVHTTPCache

KTVHTTPCache is a smart media cache framework. It can cache HTTP request, very suitable for media resources.

Flow Chart

KTVHTTPCache Flow Chart

Features

  • Thread safety.
  • Logging system, Support for console and file output.
  • Accurate view caching information.
  • Provide different levels of interface.
  • Adjust the download configuration.

Installation

Installation with CocoaPods

To integrate KTVHTTPCache into your Xcode project using CocoaPods, specify it in your Podfile:

pod 'KTVHTTPCache', '~> 1.1.7'

Run pod install

Installation with Carthage

To integrate KTVHTTPCache into your Xcode project using Carthage, specify it in your Cartfile:

github "ChangbaDevs/KTVHTTPCache" ~> 1.1.7

Run carthage update to build the framework and drag the built KTVHTTPCache.framework and KTVCocoaHTTPServer.framework into your Xcode project.

Usage

  • Start proxy.
[KTVHTTPCache proxyStart:&error];
  • Generated proxy URL.
NSURL * proxyURL = [KTVHTTPCache proxyURLWithOriginalURL:originalURL];
AVPlayer * player = [AVPlayer playerWithURL:proxyURL];
  • Get the complete cache file URL if existed.
NSURL * completeCacheFileURL= [KTVHTTPCache cacheCompleteFileURLIfExistedWithURL:originalURL];
  • Set the URL filter processing mapping relationship.
[KTVHTTPCache tokenSetURLFilter:^NSURL *(NSURL *URL) {
    return URL;
}];
  • Download Configuration
// Timeout interval.
[KTVHTTPCache downloadSetTimeoutInterval:30];

// Accept Content-Type.
[KTVHTTPCache downloadSetAcceptContentTypes:contentTypes];

// Set unsupport Content-Type filter.
[KTVHTTPCache downloadSetUnsupportContentTypeFilter:^BOOL(NSURL * URL, NSString * contentType) {
    return NO;
}];

// Additional headers.
[KTVHTTPCache downloadSetAdditionalHeaders:headers];

// Whitelist headers.
[KTVHTTPCache downloadSetWhitelistHeaderKeys:headers];
  • Log.
// Console.
[KTVHTTPCache logSetConsoleLogEnable:YES];

// File.
[KTVHTTPCache logSetRecordLogEnable:YES];
NSString * logFilePath = [KTVHTTPCache logRecordLogFilePath];

License

KTVHTTPCache is released under the MIT license.

Feedback

Developed by Single

  • SGPlayer - A powerful media player framework for iOS, macOS, and tvOS.
  • KTVVideoProcess - A High-Performance video effects processing framework.

ktvhttpcache's People

Contributors

keyofvv avatar libobjc avatar poholo avatar wanhmr avatar

Watchers

 avatar  avatar

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.