LemonDeer 1.0.3

LemonDeer 1.0.3

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Jun 2017
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by hippo_san.




LemonDeer 1.0.3

Make m3u8 parse and video download as white magic.


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

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.