VideoBackground
public class VideoBackground
Class that plays a video on a UIView.
-
Initializes a VideoBackground instance.
Declaration
Swift
public init()
-
Plays a video on a given UIView.
Declaration
Swift
public func play(view: UIView, videoName: String, videoType: String, isMuted: Bool = true, alpha: CGFloat = 0, willLoopVideo: Bool = true)
Parameters
view
UIView that the video will be played on.
videoName
String name of video that you have added to your project.
videoType
String type of the video. e.g.
mp4
isMuted
Bool indicating whether video is muted. Defaults to true.
aplha
CGFloat between 0 and 1. The higher the value, the darker the video. Defaults to 0.
willLoopVideo
Bool indicating whether video should restart when finished. Defaults to true.