Swiftpack.co -  DouKing/STMURLAsset as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
DouKing/STMURLAsset
A subclass of AVURLAsset that can cache data downloaded by AVPlayer.
.package(url: "https://github.com/DouKing/STMURLAsset.git", from: "0.1.0")

STMURLAsset

STMURLAsset is a subclass of AVURLAsset that can cache data downloaded by AVPlayer.

Usage

Just use it like AVURLAsset

let url = URL(string: "http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4")!
let asset = STMURLAsset(url: url)
asset.preloadAsynchronously()
let playerItem = AVPlayerItem(asset: asset)
let player = AVPlayer(playerItem: playerItem)
let playerView = PlayerView()
playerView.playerLayer.player = player

Installation

Swift Package Manager
  • File > Swift Packages > Add Package Dependency
  • Add https://github.com/douking/STMURLAsset
  • Select "Up to Next Major" with "0.1.0"
Cocoapods

Add the following line to your Podfile:

pod 'STMURLAsset'

License

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

GitHub

link
Stars: 1
Last commit: 5 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Dependencies

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API