Warning
This repository is no longer maintained. It has been superseded by SwiftVLC, a modern Swift 6 wrapper that binds libVLC 4.0 directly to Swift, with no Objective-C bridge in between.
This repository was a thin Swift Package wrapper around VLCKit, which is itself an Objective-C wrapper around libVLC 3.x. The original goal was simply to make VLCKit installable via SPM.
SwiftVLC replaces that approach entirely:
- Built on libVLC 4.0 instead of 3.x
- Direct C → Swift bindings, no Objective-C layer in between
- Modern Swift 6 API:
@Observable @MainActor Player,throws(VLCError),AsyncStream<PlayerEvent>, andVideoView(player)for SwiftUI - Strict concurrency end-to-end, every public type
Sendable - 13 conceptual DocC guides plus the full API reference, hosted on Swift Package Index
- Showcase app with 40 numbered case studies plus full VideoPlayer and MusicPlayer demo apps
- Comprehensive test suite running against the real libVLC binary
The two packages are not drop-in compatible. SwiftVLC binds to a different version of libVLC and exposes a different API surface.
| This repo (VLCKit) | SwiftVLC |
|---|---|
import VLC |
import SwiftVLC |
VLCMediaPlayer (Objective-C, KVO, NSNotificationCenter) |
Player (@Observable @MainActor, AsyncStream<PlayerEvent>) |
VLCMedia |
Media (Sendable, async parsing) |
Manual UIView setup |
VideoView(player) |
NSError codes |
throws(VLCError) |
| libVLC 3.x | libVLC 4.0 |
The Comparison with VLCKit guide walks through the differences in detail.
This repository will remain published so existing dependents continue to resolve, but it will receive no further updates. New issues and pull requests will not be accepted. For new work, please use SwiftVLC.
The original README is preserved below for historical reference.
VLC is a repository that provides VLC binaries for use in iOS, tvOS, and macOS projects. This repository allows you to easily include VLC's powerful media playback capabilities in your projects via Swift Package Manager.
To add VLC to your project using Swift Package Manager, follow these steps:
- In Xcode, select
File > Swift Packages > Add Package Dependency.... - Enter the repository URL:
https://github.com/omaralbeik/VLC. - Choose the version or branch you want to use.
To manually add VLC as a dependency in your Package.swift file, include the following:
import PackageDescription
let package = Package(
name: "YourProjectName",
platforms: [/* */],
dependencies: [
.package(url: "https://github.com/omaralbeik/VLC")
],
targets: [
.target(
name: "YourTargetName",
dependencies: [
"VLC"
]
),
]
)Once you’ve added the VLC package to your project, you can import and use it in your code:
import VLC
class MediaPlayer {
func playMedia(from url: URL) {
let player = VLCMediaPlayer()
player.media = VLCMedia(url: url)
player.play()
}
}This repository is licensed under the MIT license. See the LICENSE file for more information.
This repository provides binaries and headers for VLC, a free and open-source media player and streaming media server developed by the VideoLAN project.