Combine extensions for AVFoundation
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 Publisher
s, please visit https://jozsef-vesza.dev/tags/combine/
You can also check out our talk on the topic:
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"))
]
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 |
AVFoundationCombine is available under the MIT license. See the LICENSE file for more info.