TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Jun 2017 |
SwiftSwift Version | 3.0 |
SPMSupports SPM | ✓ |
Maintained by hippo_san.
Make m3u8 parse and video download as white magic.
Features |
---|
Parse and download m3u8 files |
Customize downloading progress |
Pure Swift |
To run the example project, clone the repo, and run pod install
from the Example directory first.
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.
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:
lemonDeer.downloader.pauseDownloadSegment()
lemonDeer.downloader.resumeDownloadSegment()
lemonDeer.downloader.cancelDownloadSegment()
Delete downloaded contents
lemonDeer.downloader.deleteDownloadedContents(with: ("DirectoryNameYouWantToDelete")
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)
}
github "hipposan/LemonDeer"
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)
]
)
Contact me at Twitter.
LemonDeer is available under the MIT license. See the LICENSE file for more info.