Skip to content
プロジェクト

SRGSSR/pillarbox-apple

GitHubで見る

概要

A next-generation reactive media playback ecosystem for Apple platforms.

デザイン・メディア

この数値の測り方

できること

  • Audio and video (standard / monoscopic 360°) playback.
  • Support for on-demand and live streams (with or without DVR).
  • First-class integration with SwiftUI.
  • Integration with the standard system playback user experience, both on iOS and tvOS.

計測したスター増加

24時間
0
7日間
0
15日間
0
1か月
0

期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。

Pillarbox logo

Overview

Releases Platforms SPM compatible GitHub license TestFlight

Pillarbox is SRG SSR's modern, reactive player ecosystem for iOS and tvOS, built on top of AVFoundation and AVKit. It has been designed with robustness, efficiency, and flexibility in mind, and offers full customization of:

  • Metadata and asset URL retrieval.
  • Asset resource loading, including support for FairPlay.
  • Analytics and monitoring integration.
  • User interface layout in SwiftUI.

[!IMPORTANT] Even though Pillarbox offers features that are specific to our company, its player is fully generic and can be used to play any kind of content.

Features

The Pillarbox player provides all the essential playback features you might expect:

  • Audio and video (standard / monoscopic 360°) playback.
  • Support for on-demand and live streams (with or without DVR).
  • First-class integration with SwiftUI.
  • Integration with the standard system playback user experience, both on iOS and tvOS.
  • Playlist management.
  • Support for alternative audio tracks, Audio Description, subtitles, CC and SDH, all tightly integrated with standard system accessibility features.
  • Metadata and chapter support.
  • AirPlay compatibility.
  • Control Center integration.
  • Multiple instance support.
  • Best-in-class Picture in Picture support.
  • The smoothest possible seek experience on Apple devices, with blazing-fast content navigation in streams enabled for trick play.
  • Playback speed controls.
  • Looping playback.
  • Offline playback with content downloads (iOS only).
  • Monitoring with the Pillarbox Quality of Experience (QoE) and Quality of Service (QoS) platform.

In addition, Pillarbox can play all SRG SSR content through a dedicated package.

Showcase

Here are a few examples of layouts that can be achieved with Pillarbox and SwiftUI, taken directly from our demo project:

Showcase

From left to right:

Compatibility

The library is suitable for applications running on iOS 16 and tvOS 16 or later.

Integration

The library can be integrated using Swift Package Manager directly within Xcode. You can also declare it as a dependency of another package in its Package.swift manifest.

If you want your application to run on Apple silicon Macs as an iPad application, add -weak_framework MediaPlayer to the Other Linker Flags setting of your target.

Documentation

Pillarbox documentation includes articles, tutorials and an API reference to help you learn more about available features and how to integrate them into your application.

[!TIP] If you discover errors in the documentation or if some documentation is missing, please file a dedicated issue. You can also directly submit documentation improvements via pull requests.

DocC documentation

Documentation is available as a DocC documentation catalog. Build it by opening the project in Xcode and selecting Product > Build Documentation. You can then access it directly from the Xcode documentation window.

Online documentation

Documentation for each major product provided by Pillarbox can also be found online on Swift Package Index:

  • Player: Create engaging audio and video playback experiences.
  • StandardConnector: Connect to a standard metadata source.
  • CoreBusiness: Play SRG SSR content with the Player framework.
  • Monitoring: Monitor playback activity.
  • Analytics: Measure app usage according to SRG SSR requirements.

Documentation is also available for companion products:

  • Core: Essential tools used when implementing Pillarbox.
  • Circumspect: A Nimble-based framework for testing Combine publishers.

[!TIP] The links above open the documentation for the latest tag. Use the Swift Package Index navigation bar to switch to another tag or to main.

Miscellaneous documentation

Further documentation is available from the following links:

Plugins

The package provides a single plugin that automatically inserts correct versioning information into binaries. This plugin must be trusted interactively when a project integrating Pillarbox is built using Xcode for the first time.

On a continuous integration server, you must trust plugins automatically by setting an appropriate default:

defaults write com.apple.dt.Xcode IDESkipPackagePluginFingerprintValidatation -bool YES

If you are using Xcode Cloud, this can be achieved with a custom build script.

If your project is built with xcodebuild directly, the same effect can be achieved by passing the -skipPackagePluginValidation option.

[!IMPORTANT] Build services such as GitHub Actions, Bitrise, CircleCI, and Travis CI often provide caching mechanisms to accelerate CI/CD pipelines, including caching Swift package sources. Pillarbox leverages Git tags from its package repository to automatically determine the correct version. However, this process depends on having up-to-date local tags, which may not be guaranteed when a package cache is used.

To ensure accuracy and reliability, we recommend performing clean builds when delivering your application through a delivery pipeline. Caches can still be used for routine continuous integration tasks to save time during development.

Code example

With Pillarbox, creating a custom video player user interface has never been easier. Simply instantiate a Player and start building your user interface in SwiftUI right away:

import PillarboxPlayer
import SwiftUI

struct PlayerView: View {
    @StateObject private var player = Player(
        item: .simple(url: URL(string: "https://devstreaming-cdn.apple.com/videos/streaming/examples/img_bipbop_adv_example_ts/master.m3u8")!)
    )

    var body: some View {
        ZStack {
            VideoView(player: player)
            Button(action: player.togglePlayPause) {
                Image(systemName: player.shouldPlay ? "pause.circle.fill" : "play.circle.fill")
                    .resizable()
                    .frame(width: 80, height: 80)
            }
        }
        .onAppear(perform: player.play)
    }
}

With the expressiveness of SwiftUI, our rich playback API, and the set of components at your disposal, you will have a full-fledged player user interface in no time.

Contributing

If you want to contribute to the project, have a look at our contributing guide.

License

See the LICENSE file for more information.

関連プロジェクトを探す

読み込み中…