iOS视频拍摄和播放工具SKVideoManager
2016-05-10 20:23
459 查看
SKVideoManager
自定义的一个以AVFoundation框架类为基础的iOS视频拍摄和播放管理者 – github地址包含一个拍摄和一个播放的工具,工具只提供API处理视频的各类事件,不提供UI,使用者可以自由的定制UI。此工具提供了Block回调,一次性提供所有需要的时机,只需要在Block中处理逻辑即可。
A video manager with SKVideoCapture and SKVideoPlayer.
The 2 tools just support APIs, UI is not supported.
Demo Screen shoot
Demo截图SKVideoCapture
摄录工具默认抓去960x540尺寸的视频,相当于拍摄的视频宽度不变,高度以16:9的比例截取中间部分得到的视频。capture a video with default size 960x540.
USE 使用
#import "SKVideoCapture.h" capture = [SKVideoCapture videoCaptureWithPreviewLayerView:recordView videoGravity:AVLayerVideoGravityResizeAspect]; [capture videoCaptureDidStartRecording:^{ NSLog(@"——————startRecording"); } finishRecording:^{ NSLog(@"——————endRecording"); } recordingFailed:^{ NSLog(@"——————recordingFailed"); }]; // destory [capture destroy]; capture = nil;
更多细节请查看.m文件,APIs请查看.h了解
more details check SKVideoCapture.h/.m file
SKVideoPlayer
视频播放工具a video player
USE
#import "SKVideoPlayer.h" player = [SKVideoPlayer videoPlayerWithView:recordView videoURL:outputURL]; [player videoPlayerDidReadyToPlay:^(BOOL loadVideoSucceed, float duration, NSString *durationFormatStr) { NSLog(@"----loadVideoSucceed:%d----duration:%.2f---Str:%@", loadVideoSucceed, duration, durationFormatStr); } play:^{ NSLog(@"----play----"); } pause:^{ NSLog(@"----pause----"); } playbackBufferEmpty:^{ NSLog(@"----playbackBufferEmpty----"); } playbackLikelyToKeepUp:^{ NSLog(@"----playbackLikelyToKeepUp----"); } bufferingProgress:^(float totoalBuffer) { NSLog(@"----bufferingProgress----totalBuffer:%.2f", totoalBuffer); } playProgress:^(float currentTime, float duration) { NSLog(@"----playProgress----currentTime:%.2f----duration:%.2f", currentTime, duration); } playDidEnd:^{ NSLog(@"----playDidEnd----"); }]; // destory [player destroy]; player = nil;
更多细节请查看.m文件,APIs请查看.h了解
more details check SKVideoCapture.h/.m file
issue
如发现BUG或者有新需求,请告知我,谢谢!Any bugs please issue me !
3KS !
相关文章推荐
- iOS 开启文件共享权限
- iOS中都有什么设计模式?各个设计模式的作用?
- iOS中不同形式的图文混排技术的实现总结
- iOS开发中页面跳转的方法
- iOS获取屏幕尺寸的方法
- IOS开发中响应者链
- 在IOS 8 iOS 9 中使用CoreLocation 获取地理位置
- IOS数据存储之NSUserDefaults
- iOS quartzCore第八章—— CATextLayer的运用
- IOS layoutSubviews总结
- iOS获取所有照片
- iOS状态栏颜色
- iOS-OC-把JSON字符串转化为字典
- 《招聘一个靠谱的 iOS》—参考答案
- iOS9横屏竖屏设置
- ios开发应用内实现多语言自由切换
- iOS登录及token的业务逻辑
- ios基础整理
- iOS 第三方之流媒体
- iOS编程的独特之处