Skip to content

HAJWelcomeVideo is a modular video cover which allows you to easily add a video as your ViewController's background. This feature can be used for Welcome-Screens, Set-Up Videos, etc.

License

Notifications You must be signed in to change notification settings

hichamoaj/HAJWelcomeVideo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

HAJWelcomeVideo

HAJWelcomeVideo is a modular video cover which allows you to easily add a video as your ViewController's background. This feature can be used for Welcome-Screens, Set-Up Videos, etc. Inspired by [bichenkk/VideoCover-iOS][] [bichenkk/VideoCover-iOS]: https://github.com/bichenkk/VideoCover-iOS

alt tag

Installation

To use the HAJWelcomeVideo object. import HAJWelcomeVideo to your Swift ViewController.

Create var welcomeVideoObject = HAJWelcomeVideo() in your Swift file.

In viewDidLoad():

self.welcomeVideoObject.welcomeWithVideo("videoNameHere", type: "typeHere(mp4)", startTime: CMTimeMake(startTimeInt, 1), endTime: CMTimeMake(endTimeInt, 1), gradientArray: NSArray(objects: UIColor.blackColor().CGColor, UIColor.clearColor().CGColor, etc.. ), view: self.view)
self.view.addSubview(self.welcomeVideoObject.movieView)
self.view.addSubview(self.welcomeVideoObject.gradientView)

Then in viewWillDisappear():

self.welcomeVideoObject.avPLayer.pause()

And in viewDidAppear()

self.welcomeVideoObject.avPLayer.play()

Version 1.1

Added videoType, StartTime, EndTime, and gradients.

About

HAJWelcomeVideo is a modular video cover which allows you to easily add a video as your ViewController's background. This feature can be used for Welcome-Screens, Set-Up Videos, etc.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages