KSPlayer for Apple Media Playback
A video player for iOS、macOS、tvOS、visionOS , based on AVPlayer and FFmpeg, support HLG、HDR10、 HDR10+、Dolby Vision、Dolby Atmos、Text/Image subtitle.
At a glance
- What is it?
- KSPlayer is a Swift media-player framework for iOS, macCatalyst, macOS, tvOS, xrOS, and visionOS. It combines AVPlayer and FFmpeg with explicit licensing, platform, and distribution constraints.
- Who is it for?
- Apple-platform developers needing a configurable player with advanced media and subtitle support should evaluate KSPlayer, while closed-source teams that cannot meet GPL obligations should first confirm the available LGPL or separately negotiated license. Verify the selected module, platform deployment target, binary or source delivery, and paid-feature dependencies before adoption.
- Can I use it commercially?
- Yes, with conditions. GPL-3.0 is a copyleft licence: if you distribute software that includes it, you must release that software's source code under the same licence. Running it internally without distributing it does not trigger that obligation.
- Is it still maintained?
- Yes. The repository last received commits 4 days ago.
- What is it written in?
- Mainly Swift, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.
Editorial analysis
KSPlayer's Apple media-playback scope
KSPlayer addresses the need for a media-player framework across several Apple platforms while allowing applications to choose between AVPlayer and FFmpeg-related playback components. Its stated targets are iOS 13 and later, macCatalyst 14 and later, macOS 10.15 and later, tvOS 13 and later, and xrOS 1 and later. The README also names visionOS, while the requirements line uses xrOS. This makes it relevant to Swift developers building video applications for phones, desktops, televisions, and spatial-computing targets rather than developers seeking a cross-platform player for Android or Linux.
The feature set is unusually broad for a player framework. The documentation lists HLG, HDR10, HDR10+, Dolby Vision, Dolby Atmos, text and image subtitles, Picture in Picture, 360-degree video, multichannel and spatial audio, custom URL protocols, and adaptive selection among multiple bitrates. It also records deinterlacing, video clipping, downloading, format conversion, and subtitle translation as free features. Some capabilities are tied to native hardware decoding or platform output, so the README's list should be treated as a capability inventory rather than proof that every feature behaves identically on every listed operating system.
The intended users are application teams that need more control over playback, presentation, subtitle rendering, and stream selection than a minimal system-player wrapper usually exposes. Commercial teams also need to examine the license before integration because KSPlayer defaults to GPL-3.0 and the README says that requires open-sourcing the application's own project code.
AVPlayer, FFmpeg, and KSPlayerUI separation
The documented architecture has two technical foundations: AVPlayer and FFmpeg. KSPlayer supplies the playback framework, while KSPlayerUI supplies the user-interface module. The quick start imports both packages and creates an `IOSVideoPlayerView`. It also assigns `KSOptions.secondPlayerType = KSMEPlayer.self`, indicating that playback can involve more than one configured player type.
For a regular video, the framework accepts either a URL directly through `playerView.set(url:)` or a `KSPlayerResource` containing a URL, name, cover image, and optional subtitle URL. Multi-definition playback is represented with `KSPlayerResourceDefinition` entries. This model leaves resource selection and grouping in application code instead of forcing every URL into a single implicit player configuration.
The feature list assigns broader demuxing and decoding coverage to KSMEPlayer, which the README describes as supporting all demuxing and decoding formats. The repository layout includes `Sources/`, the `Demo/` workspace, `Tests/`, and a Swift package manifest, but the README does not document the internal render graph, decoder handoff, caching policy, or exact route by which AVPlayer hands media to FFmpeg. A team evaluating low-level behavior would need to inspect those source files directly.
Adding KSPlayer and opening its demo
The documented Swift Package Manager integration declares the repository as a package dependency on the `main` branch. The README does not identify a tagged release, and the repository has no GitHub releases. That distinction matters because following this example tracks the branch rather than selecting a documented release version.
The dependency declaration is reproduced exactly as documented:
dependencies: [
.package(url: "https://github.com/kingslay/KSPlayer.git", .branch("main"))
]For a local first look, the README instructs developers to open `Demo/Demo.xcworkspace` in Xcode. It does not provide a command-line build or test instruction, so there is no justified `xcodebuild` invocation to add here. The workspace contains SwiftUI material, and the repository also has a `Tests/` directory, but no test execution procedure is documented.
After adding the package and opening the workspace, the useful first implementation check is the UI-backed setup shown in the README. It creates an `IOSVideoPlayerView`, adds it to the host view, and activates constraints that fill the parent view. This confirms package imports, UI module linkage, and basic view construction before media URLs or resource metadata are involved.
Creating and constraining IOSVideoPlayerView
The following initialization example comes directly from the README. It configures a second player type, constructs `IOSVideoPlayerView`, inserts it into the current view, disables the autoresizing mask, and activates four `NSLayoutConstraint` objects. Readers using the documented setup should see the player view fill the host view's readable-content top edge and the remaining parent edges.
import KSPlayer
import KSPlayerUI
KSOptions.secondPlayerType = KSMEPlayer.self
playerView = IOSVideoPlayerView()
view.addSubview(playerView)
playerView.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
playerView.topAnchor.constraint(equalTo: view.readableContentGuide.topAnchor),
playerView.leftAnchor.constraint(equalTo: view.leftAnchor),
playerView.rightAnchor.constraint(equalTo: view.rightAnchor),
playerView.bottomAnchor.constraint(equalTo: view.bottomAnchor),
])
playerView.backBlock = { [unowned self] in
if UIApplication.shared.statusBarOrientation.isLandscape {
self.playerView.updateUI(isLandscape: false)
} else {
self.navigationController?.popViewController(animated: true)
}
}The `backBlock` also defines an application-specific interaction. In the example, it asks the player UI to leave landscape mode when the device is already landscape; otherwise, it pops the navigation controller. The snippet assumes an iOS-style view hierarchy and an existing navigation controller. It is therefore a tutorial example rather than a complete setup for every platform KSPlayer targets.
Loading a URL and a resource-backed video
KSPlayer documents two entry points for a regular video. The direct form calls `set(url:)` with a `URL`. The resource form calls `set(resource:)` and carries additional presentation data through `KSPlayerResource`, including a display name, cover URL, and subtitle URL.
import KSPlayer
import KSPlayerUI
playerView.set(url:URL(string: "http://baobab.wdjcdn.com/14525705791193.mp4")!)
playerView.set(resource: KSPlayerResource(url: url, name: name!, cover: URL(string: "http://img.wdjimg.com/image/video/447f973848167ee5e44b67c8d4df9839_0_0.jpeg"), subtitleURL: URL(string: "http://example.ksplay.subtitle")))These calls demonstrate source and metadata handling, not transport security or production URL policy. Both examples use HTTP URLs, and the resource example force-unwraps `URL` construction. Application code would still need valid input handling and its own policy for remote media, although the README does not specify KSPlayer's redirect, certificate, cache, or authentication behavior.
For multiple definitions, the README starts constructing separate `KSPlayerResourceDefinition` values with a URL and a `definition` label. The example is truncated before showing how those definitions are assembled, so it does not confirm the complete grouping API. That missing portion matters for adaptive or user-directed quality selection.
KSPlayer versus an AVPlayer-only integration
A direct Apple-platform implementation using AVPlayer is the clearest alternative. Its approach is to build controls, resource presentation, subtitle handling, and application lifecycle behavior around Apple's playback engine. KSPlayer instead packages that work and adds an FFmpeg-related path through modules such as KSMEPlayer.
The practical difference is the range of media concerns exposed by the framework. AVPlayer supplies the native playback foundation on supported Apple platforms. KSPlayer documents format coverage through KSMEPlayer, extensive subtitle rendering, custom protocols such as NFS and SMB, image subtitles, ASS effects through libass, hardware-deinterlace support, adaptive bitrate selection, and features associated with HDR and Dolby media. This is more surface area for an application team to configure and maintain, but it also addresses media cases that a thin AVPlayer wrapper may leave to the application.
The choice is not simply software decoder versus hardware decoder. The README lists hardware decoding, hardware acceleration, AV1 support, Annex-B asynchronous hardware decoding, and native Dolby features, while still identifying both AVPlayer and FFmpeg as foundations. It does not document backend-selection rules, fallback timing, memory ceilings, or exact codec support by deployment target. Teams with ordinary AVPlayer requirements may prefer a smaller integration, while teams needing KSPlayer's documented format and presentation options have a more specific reason to accept its licensing and module trade-offs.
GPL delivery, paid modules, and maintenance limits
The default license is GPL-3.0. The README states that this requires open-sourcing the application's own project code and also describes a paid LGPL version. It points to issue 731 for licensing options and says commercial users can contact the maintainer for more flexible licensing. The module table creates an additional delivery constraint: the GPL `KSPlayer` module is listed as a dynamic binary for macOS, iSimulator, and tvOS, while `KSPlayerUI` and `MPVPlayer` are listed as source across all Apple platforms. Under the LGPL version, all three modules are listed as source for all Apple platforms.
The boundary between free and one-time paid features affects upgrade planning. Paid items include video upscaling, hard-drive precaching, external-display output, zero-delay video switching, Wi-Fi audio passthrough, rewindable live streams, offline real-time subtitle generation, separate audio and video URLs, Blu-ray playback, PiP video, MKV through AVPlayer, native Dolby Atmos, and native Dolby Vision dynamic metadata for P5 and P8. The App Store application and Test Flight link are presented as ways to experience paid features, but the README does not state which SDK APIs require payment or how upgrades are delivered.
The repository is not archived, and its last push was on 2026-10-10. It has no GitHub releases, so there is no release cadence or migration-note series to assess from the repository. Following the documented `main` branch dependency also means dependency resolution is tied to a moving branch rather than a documented stable tag.
Editorial conclusion
Apple-platform developers needing a configurable player with advanced media and subtitle support should evaluate KSPlayer, while closed-source teams that cannot meet GPL obligations should first confirm the available LGPL or separately negotiated license. Verify the selected module, platform deployment target, binary or source delivery, and paid-feature dependencies before adoption.
Frequently asked questions
Which Apple platforms does KSPlayer support?
The README lists iOS 13+, macCatalyst 14+, macOS 10.15+, tvOS 13+, xrOS 1+, and visionOS. Minimum versions are listed for xrOS but are not separately stated for visionOS in the requirements.
How do I add KSPlayer through Swift Package Manager?
The README declares a package dependency on the `main` branch. It does not provide a release-version selector, and the repository has no GitHub releases.
Can KSPlayer be used in a closed-source commercial app?
The default license is GPL-3.0, which the README says requires open-sourcing the application's own project code. It also lists a paid LGPL version and says more flexible licensing can be discussed directly.
Does KSPlayer support subtitles and custom media sources?
The documented features include text subtitles, image subtitles, closed captions, ASS effects rendered with libass, and custom protocols such as NFS and SMB. Subtitle translation and word-by-word subtitles are also listed.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/kingslay-ksplayer)Was this useful?