Latest 1.0.1
Homepage https://github.com/hipposan/LemonDeer
License MIT
Platforms ios 9.0
Authors


Pods Version


Platforms


Carthage


Swift Package Manager


Swift Version


License


Twitter


Features
Parse and download m3u8 files
Customize downloading progress
Pure Swift

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  • Xcode 8.0+
  • iOS 9.0+
  • Swift 3.0+

Note:

  • Your m3u8 file should include #EXFINT information to make parsing pass.
  • Your local server’s port should be 8080 to make local video play.

Usage

Define dowloading directory name:

let directoryName = "Name"
let lemonDeer = LemonDeer(directoryName: directoryName)

Parse and begin downloading m3u8 with URL:

let lemonDeer = LemonDeer(directoryName: "Demo")
let url = "https://urlstring.m3u8"
lemonDeer.parse(m3u8URL: url)

Manipulate downloading process:

  • Pause
lemonDeer.downloader.pauseDownloadSegment()
  • Resume
lemonDeer.downloader.resumeDownloadSegment()
  • Cancel
lemonDeer.downloader.cancelDownloadSegment()

Delete downloaded contents

  • Delete a specific directory
lemonDeer.downloader.deleteDownloadedContents(with: ("DirectoryNameYouWantToDelete")
  • Delete all downloaded contents
lemonDeer.downloader.deleteAllDownloadedContents()

Define your own after download succeeded

class YourClass: LemonDeerDelegate {
  func videoDownloadSucceeded()
}

Define your own after download failed

class YourClass: LemonDeerDelegate {
  func videoDownloadFailed()
}

Customize downloading progress

class YourClass: LemonDeerDelegate {
  func updateProgressLabel(by percentage: String)
}

Installation

Installation with CocoaPods

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

pod "LemonDeer"

Installation with Carthage

Carthage is a lightweight dependency manager for Swift and Objective-C. It leverages CocoaTouch modules and is less invasive than CocoaPods.

To install with carthage, follow the instruction on Carthage

Cartfile

github "hipposan/LemonDeer"

Installation with Swift Package Manager

The Swift Package Manager is a tool for managing the distribution of Swift code. Just add the url of this repo to your Package.swift file as a dependency:

import PackageDescription

let package = Package(
    name: "YourPackage",
    dependencies: [
        .Package(url: "https://github.com/hipposan/LemonDeer.git", majorVersion: 1.0.0)
    ]
)

Author

Contact me at Twitter.

License

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

Latest podspec

{
    "name": "LemonDeer",
    "version": "1.0.1",
    "summary": "Make m3u8 parse and download as a breeze.",
    "description": "LemonDeer is an iOS framewrok that parses m3u8 file and downloads videos easy as breeze. It is written purely in Swift, along with several useful customizable methods.",
    "homepage": "https://github.com/hipposan/LemonDeer",
    "screenshots": "https://raw.githubusercontent.com/hipposan/LemonDeer/master/Resources/LemonDeer-logo.png",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "hippo_san": "[email protected]"
    },
    "source": {
        "git": "https://github.com/hipposan/LemonDeer.git",
        "tag": "1.0.1"
    },
    "social_media_url": "https://github.com/hipposan",
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "LemonDeer/Classes/**/*",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This