A simple UIView subclass that loops a video written in Swift, useful for videos on onboarding implementations. Start using with only two or three lines of code!
Carthage
github "liaujianjie/VideoLoopView" ~> 1.1
CocoaPods
pod 'VideoLoopView', '~> 1.1'
Swift
self.videoView.videoUrl = NSBundle.mainBundle().URLForResource("samplevideo.mov", withExtension: nil)
Objective-C
self.videoView.videoUrl = [[NSBundle mainBundle] URLForResource:@"samplevideo.mov" withExtension:nil];
Swift
let videoUrl = NSBundle.mainBundle().URLForResource("samplevideo.mov", withExtension: nil)
var videoView = VideoLoopView.init(videoUrl: videoUrl!)
Objective-C
NSURL *videoUrl = [[NSBundle mainBundle] URLForResource:@"samplevideo.mov" withExtension:nil];
VideoLoopView *videoView = [[VideoLoopView alloc] initWithVideoUrl:videoUrl];
muted
- mutes/unmutes the video, muted by default- For others, see VideoLoopView.swift
Written by Liau Jian Jie.