Swiftpack.co - jozsef-vesza/AVFoundation-Combine as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by jozsef-vesza.
jozsef-vesza/AVFoundation-Combine 0.0.3
Combine extensions for AVFoundation
⭐️ 29
🕓 2 years ago
iOS macOS tvOS
.package(url: "https://github.com/jozsef-vesza/AVFoundation-Combine.git", from: "0.0.3")

Combine wrappers for AVPlayer

AVFoundationCombine

Combine extensions for AVFoundation

Test SPM

This project aims at providing uniformity and reducing boilerplate by providing Publisher extensions for common tasks when working with the AVFoundation framework.

For a full technical rundown and detailed explanation on this motivation and useful technical details on implementing custom Publishers, please visit https://jozsef-vesza.dev/tags/combine/

You can also check out our talk on the topic:

Custom Publishers

Installation

Swift Package Manager

Once you have a Swift package set up, adding AVFoundationCombine as a dependency can be done by adding it to the dependencies value of your Package.swift.

dependencies: [
    .package(url: "https://github.com/jozsef-vesza/AVFoundation-Combine", .upToNextMajor(from: "0.0.0"))
]

Publishers

All publishers are designed to be lazy: they only start observing properties when subscribed to.

Publisher Source
AVPlayer
playheadProgressPublisher(interval:) addPeriodicTimeObserver(forInterval:queue:using:)
currentItemPublisher() currenItem
ratePublisher() rate
AVPlayerItem
statusPublisher() status
durationPublisher() duration
isPlaybackLikelyToKeepUpPublisher() isPlaybackLikelyToKeepUp
isPlaybackBufferEmptyPublisher() isPlaybackBufferEmpty
didPlayToEndTimePublisher(_:) .AVPlayerItemDidPlayToEndTime Notification
AVAsset
commonMetadataPublisher(key:) commonMetadata
commonMetadataValuePublisher(key:) commonMetadata
commonMetadataExtrasPublisher(key:) commonMetadata
commonMetadataValuePublisher(key:as:) commonMetadata
commonMetadataValuePublisher(stringValueKey:) commonMetadata
commonMetadataArtworkPublisher() commonMetadata

License

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

GitHub

link
Stars: 29
Last commit: 2 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

0.0.3
2 years ago

Adds Publisher extensions to reduce the amount of boilerplate required to retrieve common metadata properties.

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