Skip to content

Offline Playback

Latest

Choose a tag to compare

@defagos defagos released this 30 Oct 13:17
· 8 commits to main since this release
20.0.0
8cda81c

This release makes downloads and offline playback publicly available on iOS, and revisits URL-based and standard connector item creation to support them.

Note

Pillarbox now requires Xcode 27 (Swift 6.4). Downloads require iOS 17 or above and are not available on tvOS. Downloading FairPlay-protected content is not supported yet.

Improvements

  • Added public support for downloads and offline playback with URLDownloader (URL-based content), StandardDownloader (Pillarbox standard metadata) and URNDownloader (SRG SSR content). Custom stores can be used with Downloader and AssetDownloadStore. See the new "Downloads and Offline Playback" article.
  • Added DownloadConfiguration to choose the quality (preferredPeakBitRate, preferredMaximumResolution) and the audio and subtitle languages (DownloadMediaSelectionPreference) of downloaded content.
  • Added Download.size to show how large a download is and how much of it has completed.
  • Added support for downloading and playing AES-128 protected content offline.
  • Made PlayerConfiguration, PlaybackConfiguration and PlayerLimits properties mutable.
  • Made PlayerData properties public so they can be used in custom asset providers.
  • Added AssetLoader.downloadableAssetPublisher(from:metadata:) to provide a different asset for downloading, if needed. A default implementation is provided.
  • Requests for SRG SSR metadata now include platform information, so the resource best suited for Apple platforms is selected by the server.
  • Added useful SRG SSR metadata response headers to events sent to Pillarbox monitoring (MetricsTracker.Metadata(metadataUrl:metadataHeaders:assetUrl:)).
  • Added scrolling for long chapter titles in the Info panel on tvOS 26.
  • Updated for Xcode, iOS and tvOS 27.

Fixes

  • Fixed Player.resume(_:in:) when resuming an item other than the current one.
  • Made Player.resume(_:in:) ignore invalid positions.
  • Fixed a potential infinite recursion that could occur when a seek failed, most notably near the end of a stream.

Breaking Changes

  • PlayerMetadata is now a type alias for AssetMetadata<EmptyCustomData>. AssetMetadata now exposes metadata fields (title, subtitle, imageSource, chapters, etc.) directly and no longer has a playerMetadata property. Create it with AssetMetadata(identifier:title:…:customData:).
  • Moved EmptyCustomData from PillarboxStandardConnector to PillarboxPlayer. It is now Codable.
  • Removed PlayerItem.init(asset:metadata:trackerAdapters:), PlayerItem.custom(url:delegate:metadata:trackerAdapters:configuration:) and PlayerItem.encrypted(url:delegate:metadata:trackerAdapters:configuration:), as well as the configuration parameter of PlayerItem.simple(url:metadata:trackerAdapters:). To create custom or encrypted items, or to provide a custom configuration, implement a URLAssetLoaderProvider and use PlayerItem.custom(assetProviderType:url:metadata:trackerAdapters:).
  • Replaced PlayerItem.standard(request:type:decoder:trackerAdapters:assetProvider:) and PlayerItem.standard(request:decoder:trackerAdapters:assetProvider:) with PlayerItem.standard(assetProviderType:input:trackerAdapters:). Implement a StandardAssetLoaderProvider to supply the request, decoder and asset.
  • Moved Source to PlayerData.Source.
  • Removed MediaComposition.Chapter.recommendedResource and MediaComposition.StreamingMethod.supportedMethods. The server now returns resources suited for Apple platforms first.

Demo Improvements

  • Added settings to choose the quality and the audio and subtitle languages of downloads.
  • Moved URL-based downloads to the new URLDownloader API.
  • Added AES-128 protected content examples.
  • Added a sign language toggle example to the showcase.
  • Displayed artwork for audio content on tvOS.
  • Removed multi-window support.

Demo Fixes

  • Fixed the TestFlight button frame on tvOS.
  • Fixed or removed non-working examples.

What's Changed

Full Changelog: 19.0.0...20.0.0