r/macosprogramming • • Sep 14 '26

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.

9 Upvotes

8 comments sorted by

1

u/SkullEnemyX-Z Sep 14 '26

Let me know if you support 8K super hdr content that can milk every iota of brightness photons from the mac screen with accurate colors unlike vlc which dulls it so much

1

u/Davidotto13 Sep 14 '26

SwiftPlayer renders through AVPlayer/AVFoundation, so it inherits macOS's native EDR-aware color pipeline rather than doing its own color management like VLC does . I haven't explicitly tested it against 8K HDR10/Dolby Vision content though, so I can't promise it "milks every photon" yet. If you've got a test file, I'd genuinely like to see how it holds up.

1

u/Yaveezz Sep 14 '26

The right-click and Open step in your README doesn't work on Sequoia or later. Apple removed the Control-click override in macOS 15, so for an app that isn't notarized it no longer gets past the warning. What works now is launching the app once, then System Settings, Privacy & Security, scroll down and click Open Anyway. I'd make that the first option, keep your xattr line as the fallback since it works on every version, and mention right-click only for people on 13 and 14. It's easy to miss from the developer side, because a build you run from Xcode or a zip you made on the same Mac never gets the quarantine flag, so Gatekeeper never checks it. I ran into that recording an install demo: the app opened with no prompt at all, which looked like a pass and proved nothing. Your M5 can't run anything older than Sequoia, so downloading your own release zip in a browser and opening it from Downloads will show you exactly what a new user hits.

1

u/Davidotto13 Sep 14 '26 edited Sep 14 '26

Thank you for noticing this ! I will fix this by tomorrow.

Edit : I fixed it , i just made a .dmg file real quick .

1

u/crmodi86 Oct 14 '26

Thanks brother for this release. Does this player support 4K HDR DV streams? I have mac mini m6.

1

u/Davidotto13 Oct 14 '26

It does , tested on Big Buck Bunny in 4K120FPS HDR. The development of the app is currently suspended , but the next big release will add tvOS support and a better UX. But on the technical side nothing new.

1

u/ZTfer Sep 15 '26

I'm using an iina player now. Let me try your player.