Swiftpack.co - Package - toddkramer/HLSThumbnailGenerator

HLSThumbnailGenerator

CocoaPods Version Swift Platform Swift Package Manager compatible Carthage compatible

Overview

HLSThumbnailGenerator is a substitute for AVAssetImageGenerator when generating thumbnails from streaming video.

Features

  • iOS 9.0+, macOS 10.10+, tvOS 9.0+
  • Can pass in an array of times (in seconds) to request thumbnails

Usage

let urlString = "<hls-url>"
guard let url = URL(string: urlString) else { return }
let asset = AVAsset(url: url)
generator = ThumbnailGenerator(asset: asset)
generator.delegate = self
generator.generateThumbnails(atTimesInSeconds: [16.1, 33.2, 55.2])

Installation

CocoaPods

CocoaPods is a centralized dependency manager for Cocoa projects. To install HLSThumbnailGenerator with CocoaPods:

  1. Make sure the latest version of CocoaPods is installed.

  2. Add HLSThumbnailGenerator to your Podfile:

use_frameworks!

pod 'HLSThumbnailGenerator', '~> 0.5.0'
  1. Run pod install.

Swift Package Manager

Swift Package Manager is Apple's official package manager for Swift frameworks. To install with Swift Package Manager:

  1. Add HLSThumbnailGenerator to your Package.swift file:
import PackageDescription

let package = Package(
    name: "MyAppTarget",
    dependencies: [
        .Package(url: "https://github.com/toddkramer/HLSThumbnailGenerator", majorVersion: 0, minor: 5)
    ]
)
  1. Run swift build.

  2. Generate Xcode project:

swift package generate-xcodeproj

Carthage

Carthage is a decentralized dependency manager for Cocoa projects. To install HLSThumbnailGenerator with Carthage:

  1. Make sure Carthage is installed.

  2. Add HLSThumbnailGenerator to your Cartfile:

github "toddkramer/HLSThumbnailGenerator" ~> 0.5.0
  1. Run carthage update and add the appropriate framework.

Github

link
Stars: 1
Help us keep the lights on

Dependencies

Used By

Total: 0