The SRG Media Player library provides a simple way to add universal audio / video playback support to any application. It provides:
AVPlayerViewController
.The library is suitable for applications running on iOS 12, tvOS 12 and above. The project is meant to be compiled with the latest Xcode version.
If you want to contribute to the project, have a look at our contributing guide.
The library must 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.
When you want to use classes or functions provided by the library in your code, you must import it from your source files first. In Objective-C:
@import SRGMediaPlayer;
or in Swift:
import SRGMediaPlayer
To learn about how the library can be used, have a look at the getting started guide.
The library internally uses the SRG Logger library for logging, within the ch.srgssr.mediaplayer
subsystem. This logger either automatically integrates with your own logger, or can be easily integrated with it. Refer to the SRG Logger documentation for more information.
Interface Builder can render custom controls dropped onto a storyboard or a xib. If you want to enable this feature for SRG Media Player controls, copy the SRGMediaPlayerDesignables.m
file available from the Swift Package Manager checkout to your project and add it to your target.
When dropping a media player control (e.g. SRGPictureInPictureButton
) onto a storyboard or xib, Xcode will now build your project in the background and render the view when it is done.
Since the SRGMediaPlayerDesignables.m
must be copied to your project, you should update this file when updating the SRG Media Player library.
To test what the library is capable of, run the associated demo.
See the LICENSE file for more information.