Appearance
iOS SDK
Current version: v1.0.0
Native iOS player built with SwiftUI and AVPlayer.
Requirements
- Xcode 15 or later
- iOS 15.0 minimum deployment target
- Swift 5.9+
- An active xStreams stream ID and token endpoint
Installation
Option A: Swift Package Manager (recommended)
- In Xcode, go to File → Add Package Dependencies.
- Enter the URL:
https://github.com/xStreams-io/xstreams-player-ios.git - Select version
1.0.0and add to your target.
Option B: Manual download
- Download the ZIP from CDN:
https://cdn.xstreams.io/sdk/ios/XStreamsPlayer-1.0.0.zip - Unzip and drag the
XStreamsPlayerfolder into your Xcode project. - Make sure "Copy items if needed" is checked.
Usage
swift
import XStreamsPlayer
struct LiveView: View {
let config = XStreamsPlayerConfig(
streamId: "YOUR_STREAM_ID",
tokenEndpoint: "https://api.yoursite.com/api/v1/ssai/YOUR_STREAM_ID/token/",
streamKey: "sk_abc123..."
)
@StateObject private var player = XStreamsPlayer(config: config)
var body: some View {
XStreamsPlayerView(player: player)
.aspectRatio(16/9, contentMode: .fit)
.onAppear { player.play() }
.onDisappear { player.destroy() }
}
}Features
- HLS live playback via AVPlayer
- Ad break detection
- Picture-in-Picture
- AirPlay support
- Quality selection
- Silent token refresh
- SwiftUI and UIKit support
See also
- Android SDK — native Android player
- Flutter SDK — cross-platform
- CDN & Versioning — download links