SRGSSR / pillarbox-apple

A next-generation reactive media playback ecosystem for Apple platforms.
https://testflight.apple.com/join/TS6ngLqf
MIT License
47 stars 7 forks source link

Documentation Request - Chapter / Segmented Videos #905

Open mutaben opened 1 month ago

mutaben commented 1 month ago

Use case description

I would like to have more information on integrating chapters and segmented videos aspects with a Pillarbox player please.

Thank you in advance.

Acceptance criteria

No response

Proposed solution

No response

Alternatives considered

No response

Is there an existing similar feature request?

defagos commented 1 month ago

Thanks for the suggestion. We could namely add a few words about chapter support in Pillarbox documentation. Let me just briefly provide you with pointers until we have more documentation available.

Terminology

A few words about terminology first, as we moved from an SRG SSR internal terminology with Letterbox (chapters and segments) to a more standard one (chapters only) with Pillarbox:

Metadata

A Pillarbox Player is loaded with PlayerItems, whose main purpose is to implement Asset delivery. An asset ultimately provides the URL of the content being played, alongside metadata. Standard metadata is exposed by Player through its metadata property. This property is automatically published by a Player, which means SwiftUI views can directly respond to metadata retrieval and adjust their layout accordingly.

Metadata is provided as PlayerMetadata. It most notably contains title, description and artworks for the content itself, and possibly a chapter list if available.

Our Core Business package provides PlayerItems suitable for playing our content. If chapters are available they are automatically loaded and provided in updates published by a Player instance.

Displaying chapters

Displaying chapters is therefore extremely easy in a custom iOS layout:

The rest is entirely up to you. You can decide to display a chapter list horizontally or vertically, as a lateral or bottom pane, with or without images. Your creativity is the limit. See our ChapterList demo implementation for an example of integration.

A final remark. As said above the tvOS system UI has native support for chapters. On this platform no additional work is required, provided metadata associated with an asset contains chapters of course.