Pillarbox

2.0.0

A next-generation reactive media playback ecosystem for Apple platforms.
SRGSSR/pillarbox-apple

What's New

Improved metadata support

2024-05-16T07:51:52Z

This release improves support for metadata. This includes features for displaying content information and artworks in custom layouts, but also features that can enhance the user experience during playback.

Metadata

  • Player provides metadata updates through a new metadata published property. Use this metadata to easily display information about the content being played in custom user interfaces.
  • Chapters can be associated with content being played. Those provide markers into the content, which can be used for display purposes or to offer alternative ways to navigate the content.
  • Images are now retrieved by the player directly and do not need to be loaded by a PlayerItem custom publisher anymore (though they still can if this approach is more appropriate). The main artwork for a content as well as images associated with chapters must be provided as ImageSources. URL-based sources are automatically fetched by the player when actually needed, avoiding unnecessary fetches when not used.

Blocked time ranges

  • Optionally associate blocked time ranges with content being played. These time ranges are automatically skipped during playback. Seeking into them is prevented as well.
  • Blocked time ranges are displayed as interstitials in the tvOS system playback user interface.

Opening and end credits

  • Define time ranges associated with opening and closing credits. These time ranges can be used in custom user interfaces, e.g. to display a skip button during credits.

User interface

  • Add support for contextual actions to SystemVideoView.
  • Use LazyImage in SwiftUI layouts to display images lazily loaded from an ImageSource. Use LazyUIImage where a UIImage is required instead.

SRG SSR content support improvements

  • Prevent playback of time ranges blocked by SRG SSR editors, instead of preventing playback of the whole content.
  • Extract chapters from SRG SSR content.
  • Display season / episode information in the tvOS system playback user interface.
  • Increase artwork image quality for SRG SSR content.

Miscellaneous

  • Update translations.
  • Add Player.seek(to:completion:) method to seek to a chapter.
  • Add PlayerConfiguration.default to obtain default player configuration settings.
  • Add `Publisher.delayIfNeeded(for:tolerance:scheduler:options:).
  • Make subscript(safeIndex:) available for all Arrays.

Breaking changes

  • Improve CMTime and CMTimeRange consistency in ProgressTracker, returning .invalid instead of nil when values are not available. Please update your code to check if a time or range isValid rather than testing for nullability.
  • PlayerItem configuration now happens with a dedicated PlayerItemConfiguration parameter, not with a closure anymore.

Fixes

  • Avoid undesired automatic Control Center integration on iOS when using the system playback user interface.
  • Fix Control Center integration on tvOS.
  • Fix incorrect times returned by a ProgressTracker when playing a DVR livestream at the live edge.

Demo improvements

  • Display chapters in the custom player user interface on iOS.
  • Display audio artworks in the custom player user interface on iOS.
  • Make satellite radio streams available (Radio Swiss Pop, Radio Swiss Jazz and Radio Swiss Classic).
  • Add examples for integration of a skip button during credits.
  • Display blocked time ranges in the custom player slider on iOS.
  • Improve the playlist example on tvOS.

Demo fixes

  • Improve interactions with the demo custom slider.
  • Fix custom player interface animation glitches.
  • Prevent the custom player user interface from being toggled while scrubbing.
  • Fix player settings not applied until the application is restarted.

What's changed

  • Deliver player metadata by @waliid in #808
  • Remove superfluous icon by @defagos in #811
  • Fix unreliable test by @defagos in #812
  • Introducing a user-friendly API for AVMetadataItem construction by @waliid in #809
  • Polish implementation and documentation by @defagos in #814
  • Add a TestFlight badge by @waliid in #821
  • Improve metadata delivery by @waliid in #827
  • Update translations from Crowdin by @defagos in #828
  • Fix tvOS Control Center by @waliid in #829
  • Update examples by @defagos in #830
  • Display metadata in the iOS custom player by @waliid in #831
  • Display chapters in iOS demo by @waliid in #832
  • Rename ChapterMetadata to Chapter by @waliid in #833
  • Improve chapter cell appearance by @defagos in #834
  • Document metadata integration by @defagos in #835
  • Enable advanced Picture in Picture and Control Center integration for the chapter-supporting player by @defagos in #836
  • Remove chapters with non-matching media type by @defagos in #838
  • Add test for mixed chapter filtering by @defagos in #841
  • Never return chapters for audio content by @defagos in #842
  • Return invalid times and ranges consistently with other player APIs by @defagos in #847
  • Fix assertion raised when formatting invalid times by @defagos in #848
  • Support opening and end credits by @waliid in #850
  • Handle blocked time ranges by @waliid in #853
  • Enable chapter support in the main custom player layout by @defagos in #855
  • Improved tvOS playlist experience by @defagos in #856
  • Add demo privacy manifest by @defagos in #857
  • Fix documentation link by @defagos in #858
  • Manage image retrieval at the player level by @defagos in #860
  • Fix undesired seek in overlapping time ranges by @defagos in #863
  • Display time ranges on custom slider by @waliid in #864
  • Add blocked time range URN example by @defagos in #865
  • Display artwork image for audio by @defagos in #866
  • Add a test for nested time range by @waliid in #868
  • Use new API for localization by @waliid in #869
  • Add journalistic blocking reason by @defagos in #871
  • Add HLS documentation links by @defagos in #870
  • Apply current demo settings to player instances by @defagos in #872
  • Prevent controls from being toggled while interacting by @defagos in #874
  • Disable automatic now playing info updates on iOS by @defagos in #875
  • Fix Control Center integration documentation on tvOS by @defagos in #877
  • Load chapters and artwork images lazily by @waliid in #879
  • Fix capped times delivered by a progress tracker at the live edge by @defagos in #880
  • Document metadata integration by @defagos in #882
  • Fix undesired animation by @waliid in #881
  • Avoid settings menu being closed when controls disappear by @defagos in #883
  • Align the loading indicator to the right when the UI is hidden by @waliid in #886

Full Changelog: 1.0.1...2.0.0

Pillarbox logo

Overview

Releases Platforms SPM compatible GitHub license TestFlight

Pillarbox is the iOS and tvOS modern reactive SRG SSR player ecosystem implemented on top of AVFoundation and AVKit. Pillarbox has been designed with robustness, efficiency and flexibilty in mind, with full customization of:

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

Its robust player provides all 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 to create the stunning playback user experience that your application deserves.
  • Integration with the standard system playback user experience, both on iOS and tvOS.
  • Playlist management including bidirectional navigation.
  • 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.

In addition Pillarbox provides the ability to play all SRG SSR content through a dedicated package.

Showcase

Here are a few examples of layouts which can be achieved using Pillarbox and SwiftUI, directly borrowed from our demo project:

Showcase

From left to right:

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.

Compatibility

The library is suitable for applications running on iOS 16, tvOS 16 and above. The project is meant to be compiled with the latest versions of Xcode and of the Swift compiler.

Contributing

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

Integration

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

If you want your application to run on Silicon Macs as an iPad application you must add -weak_framework MediaPlayer to your target Other Linker Flags setting.

Plugins

The package provides a single plugin which 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.

Getting started

To learn more about integration of Pillarbox into your project please have a look at our generated Xcode documentation.

Documentation

Documentation is available as a DocC documentation catalog. This catalog must be built by opening the project with Xcode and selecting Product > Build Documentation. You can then access it right from within the Xcode documentation window.

Further documentation is also available by following the links below:

License

See the LICENSE file for more information.

Description

  • Swift Tools 5.9.0
View More Packages from this Author

Dependencies

Last updated: Sat Jun 15 2024 02:41:35 GMT-0900 (Hawaii-Aleutian Daylight Time)