Projector

main

A template AVFoundation based video player for UIKit that allows branding and UI to be changed as desired
alexlerikos/Projector

Projector by Alex Lerikos

Projector

An AVFoundation based video player that allows the color scheme and UI to be easily changed to your product's branding specifications

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

  1. Add public API to change Loading Animation
  2. Add current play time and time remaining labels 3a. Add public API to modify the aformentioned labels font and color

Author

Alex Lerikos (alerikos@gmail.com)

Open Source Credits

Stateful

License

Projector is distributed under the MIT License. See the LICENSE file for details

Description

  • Swift Tools 6.0.0
View More Packages from this Author

Dependencies

  • None
Last updated: Sun Nov 16 2025 14:04:49 GMT-1000 (Hawaii-Aleutian Standard Time)