Giter Site home page Giter Site logo

mbruegmann / pillarbox-apple Goto Github PK

View Code? Open in Web Editor NEW

This project forked from srgssr/pillarbox-apple

0.0 0.0 0.0 15.63 MB

A modern reactive media playback ecosystem for Apple platforms

License: MIT License

Shell 1.32% Ruby 0.89% Swift 97.10% Makefile 0.70%

pillarbox-apple's Introduction

Pillarbox logo

Overview

Releases Platforms SPM compatible GitHub license

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.
  • 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 Player
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")!)
    )

    private var buttonImage: String {
        switch player.playbackState {
        case .playing:
            return "pause.circle.fill"
        default:
            return "play.circle.fill"
        }
    }

    var body: some View {
        ZStack {
            VideoView(player: player)
            Button(action: player.togglePlayPause) {
                Image(systemName: buttonImage)
                    .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.

A few remarks:

  • When building a project integrating Pillarbox for the first time, Xcode might ask you to trust our plugins. You should accept.
  • 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.

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.

pillarbox-apple's People

Contributors

defagos avatar mbruegmann avatar waliid avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.