alexlerikos/Projector
A template AVFoundation based video player for UIKit that allows branding and UI to be changed as desired
Example Setup
- Import the Projector framework and add it to your View or View Controller
import Projector
class ViewController: UIViewController {
@IBOutlet weak var projectorView: ProjectorView!
// or
var projector = ProjectorView()
...
}- Set the player to use your app's color scheme and water-mark
- Load the URL of your video into the ProjectorView's API
override func viewDidLoad() {
super.viewDidLoad()
let videoURL = URL(fileURLWithPath: Bundle.main.path(forResource: kVideoName, ofType: kVideoType)!)
// or
// let videoURL = URL(string: "https://devstreaming-cdn.apple.com/videos/streaming/examples/bipbop_16x9/bipbop_16x9_variant.m3u8")!
self.projectorView.setWaterMarkImage(UIImage(named: "water-mark")!)
self.projectorView.setLoggingEnabled(true)
self.projectorView.setProgressSliderTintColor(sliderColor)
self.projectorView.setControlsButtonTint(sliderColor)
self.projectorView.loadURLAsset(videoURL)
}- You can also change the player's thumb slider, play, pause and restart image using the following APIs
public func setProgressSliderThumbSelectedImage(_ image: UIImage)
public func setProgressSliderThumbUnselectedImage(_ image: UIImage)
public func setControlsButtonImageForPlaying(_ image:UIImage)
public func setControlsButtonImageForPaused(_ image:UIImage)
public func setControlsButtonImageForRestart(_ image:UIImage)Debug
- You can turn on Debug logging with the following API
public func setLoggingEnabled(_ enabled:Bool)To-do's
- Add public API to change Loading Animation
- Add current play time and time remaining labels
3a. Add public API to modify the aformentioned labels font and color
Open Source Credits
License
Projector is distributed under the MIT License. See the LICENSE file for details
Package Metadata
Repository: alexlerikos/Projector
Stars: 2
Forks: 1
Open issues: 0
Default branch: main
Primary language: swift
License: MIT
Topics: avfoundation, framework, spm, swift, swift-package, uikit, uikit-framework, video-player
README: README.md