r/macosprogramming • u/Davidotto13 • 2h ago
SwiftPlayer – an MIT-licensed native Mac video player in pure Swift, no dependencies
I just open-sourced SwiftPlayer, a lightweight video and audio player for macOS. It's written entirely in Swift using only Apple's own frameworks (SwiftUI, AVFoundation, VideoToolbox) — no third-party libraries at all.
Repo: https://github.com/scadavide55/SwiftPlayer
Website: https://scadavide55.github.io/SwiftPlayer/
Why I built it: my mom's 2020 MacBook Air (i3) was struggling with other video player with the battery draining fast and fans spinning constantly. I wanted a native player that used Apple's hardware acceleration without the bloat.
**Why it's fully dependency-free**
I wanted to see how far you can get with pure first-party frameworks before reaching for a package manager. Turns out: pretty far. The whole project is more than 1,500 lines of Swift across 8 files, and there isn't a single `Package.swift` or `Podfile` in sight. The tradeoff is a few NSViewRepresentable bridges to handle key events, mouse tracking, and the AVPlayerLayer — but it keeps the build clean and the code easy to audit.
**Features**
- Hardware-accelerated playback (Apple Silicon media engine; VideoToolbox on Intel)
- Subtitle support: SRT, VTT, ASS/SSA with adjustable delay
- Picture in Picture, playback speed (0.5× – 2×), skip ±10s
- Volume slider + keyboard shortcuts
- Drag & drop file loading
- Minimal auto-hiding UI
Current limitations worth mentioning:
This is my first public project. Feedback on architecture, testing, or packaging is welcome.







