一个简单的 UIView 子类,用于在 Swift 中循环播放视频,适用于引导视频,只需用两三行代码即可开始使用!
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
- 静音/取消静音视频,默认为静音由 Liau Jian Jie 编写。