Swiftpack.co -  Package - jozsef-vesza/AVFoundation-Combine
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
jozsef-vesza/AVFoundation-Combine
Combine extensions for AVFoundation
.package(url: "https://github.com/jozsef-vesza/AVFoundation-Combine.git", from: "0.0.1")

Combine wrappers for AVPlayer

AVFoundationCombine

Combine extensions for AVFoundation

The purpose of this project is to add Combine wrappers around AVFoundation (specifically AVPlayer and AVPlayerItem) APIs. For a full technical rundown and detailed explanation 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

GitHub

link
Stars: 10
Last commit: 4 days ago

Release Notes

Initial release
6 days ago

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