Latest 1.0.1
Homepage https://github.com/FactorialComplexity/FYCachedURLAsset
License MIT
Platforms ios 8.0
Frameworks Foundation, UIKit, AVFoundation
Authors ,

Version
License
Platform

It’s enhanced AVURLAsset with seamless cache layer. It handles the playing of an audio/video file while streaming and simultaneuosly saving downloaded data to a local URL. FYCachedURLAsset was designed to prevent download the same bytes twice.

Installation

Manual:

Add to your project source files from FYCachedURLAsset folder

CocoaPods:

FYCachedURLAsset is available through CocoaPods. To install
it, add the following line to your Podfile:

pod 'FYCachedURLAsset'

How to use

FYCachedURLAsset is a replacement for [AVURLAsset URLAssetWithURL:URL options:nil], but with additional local file path argument

NSString *cacheFilePath = [documentsPath stringByAppendingPathComponent:[URL lastPathComponent]];

FYCachedURLAsset *asset = [FYCachedURLAsset cachedURLAssetWithURL:URL cacheFilePath:cacheFilePath];

Features

  • supports streaming of media file, so it can be playbacked as soon as first data is available
  • simultaneously saves all downloaded data to a file during streaming
  • gracefully handles interruptions and resumes download only from place where was stopped
  • supports ETag header attribute to skip file download if no changes were made on the remote file from the last time
  • allows to seek stream to any place, but with limited cache support

License

FYCachedURLAsset is available under the MIT license. See the LICENSE file for more info.

Example

To run the example project, clone the repo, and run pod install from the Example directory, open workspace file and run.

screenshot screenshot

Latest podspec

{
    "name": "FYCachedURLAsset",
    "version": "1.0.1",
    "summary": "Provides local cache layer for remote audio and video stream  files",
    "description": "It's enhanced AVURLAsset with seamless cache layer. It handles the playing of an audio/video file while streaming and simultaneuosly saving downloaded data to a local URL. FYCachedURLAsset was designed to prevent download the same bytes twice.",
    "homepage": "https://github.com/FactorialComplexity/FYCachedURLAsset",
    "screenshots": [
        "https://raw.githubusercontent.com/factorialcomplexity/FYCachedURLAsset/master/Screenshots/media.png",
        "https://raw.githubusercontent.com/factorialcomplexity/FYCachedURLAsset/master/Screenshots/player.png"
    ],
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Vitaliy Ivanov": "[email protected]",
        "Viktor Naryshkin": "[email protected]"
    },
    "source": {
        "git": "https://github.com/FactorialComplexity/FYCachedURLAsset.git",
        "tag": "1.0.1"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "FYCachedURLAsset/*",
    "public_header_files": "FYCachedURLAsset/*.h",
    "frameworks": [
        "Foundation",
        "UIKit",
        "AVFoundation"
    ]
}

Pin It on Pinterest

Share This