一:assetslibrary
读取photo 和video
1:add AssetsLibrary
2:#import <AssetsLibrary/AssetsLibrary.h>
3:
-(IBAction) getStats {
__block int numberOfGroups = 0;
__block int numberOfAssets = 0;
// Create the object to represent the library
ALAssetsLibrary *assetsLibrary = [[ALAssetsLibrary alloc] init];
// What kind of groups are you interested in?
NSUInteger groupTypes = ALAssetsGroupAll;
// Create the block to enumerate through the groups
ALAssetsLibraryGroupsEnumerationResultsBlock listGroupBlock =
^(ALAssetsGroup *group, BOOL *stop) {
// this block will be called for every group, and ONCE MORE!
// so first, test if there's a real group being passed in:
if (group) {
// add to the totals
numberOfGroups++;
numberOfAssets += group.numberOfAssets;
// output some info about the group
NSLog(@"The name of the group is, %@",
[group valueForProperty:ALAssetsGroupPropertyName]);
} else {
// the group object is nil, must mean we're done enumerating!
// create an output message.
NSString *message = [NSString
stringWithFormat:@"There are %d groups with %d total assets.",
numberOfGroups,numberOfAssets];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Asset Stats!"
message:message
delegate:nil
cancelButtonTitle:@"Okay"
otherButtonTitles:nil];
[alert show];
[alert release];
}
};
// create the failure block
ALAssetsLibraryAccessFailureBlock failBlock = ^(NSError *error) {
NSLog(@"Error:%@", [error localizedDescription]);
};
// now enumerate through the groups, using the created blocks
[assetsLibrary enumerateGroupsWithTypes:groupTypes
usingBlock:listGroupBlock
failureBlock:failBlock];
[assetsLibrary release];
}
二:在你的app 中播放视频
1:add MediaPlayer
2:#import <MediaPlayer/MediaPlayer.h>
3:
-(IBAction) buttonTapped: (id) sender {
NSString *path = [[NSBundle mainBundle]
pathForResource:@"water" ofType:@"m4v"];
player = [[MPMoviePlayerViewController alloc]
initWithContentURL:[NSURL fileURLWithPath:path]];
[[NSNotificationCenter defaultCenter]
addObserver:self selector:@selector(movieFinishedPlaying:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:[player moviePlayer]];
[self presentMoviePlayerViewControllerAnimated:player];
}
-(void) movieFinishedPlaying: (NSNotification *) note {
[[NSNotificationCenter defaultCenter]
removeObserver:self
name:MPMoviePlayerPlaybackDidFinishNotification
object:[player moviePlayer]];
[player release];
}
分享到:
相关推荐
《iOS 15.0定位服务详解:location-cleaned驱动技术解析》 在移动设备操作系统领域,苹果的iOS一直以其安全性和用户体验著称。随着iOS 15.0的发布,开发者和用户对于系统的更新尤为关注,特别是其中的定位服务。...
ios-webkit-debug-proxy-1.9.0-win64-bin
2008年推出 CISCO2950较新IOS映像:c2950-i6k2l2q4-mz.121-22.EA12
WII用的资源IOS57.IOS57-64-v5918.wad
UnitySetup-iOS-Support-for-Editor-5.5.6f1
高通vuforia-unity-mobile-android-ios-4-0-5-beta
IOS56-64-v4890.wad
2010年推出: CISCO2950最新IOS映像:c2950-i6k2l2q4-mz.121-22.EA14
思科 cisco ios 镜像 C3640-JK.BIN 文件由多位CCIE水平人员测试使用后拷贝,dy下可用
3、安装好后,下载ffmpeg4ios-1.0-lib.zip这个文件,不要解压。上传到手机里播放器的默认目录下。 4、Iphone重启,打开播放器,再次播放那些没声音的高清视频,这时就会有声音了。 5、把Iphone的时间设置改为当前...
2.一款App在首次安装后打开时,会有3-5页的介绍界面引导新用户使用或者给用户更新提示。 根据引导页的目的、出发点不同,可以将其分为功能介绍类、使用说明类、推广类、问题解决类,一般引导页不会超过5页。 功能...
"FFmpeg-iOS-build-script-master.zip" 提供的正是一个专为iOS平台定制的FFmpeg编译脚本。 这个压缩包中的核心是“FFmpeg-iOS-build-script-master”文件夹,里面包含了编译FFmpeg到iOS平台所需的全部配置和脚本。...
Test Driven IOS Development Swift4 - 3rd [pdf] Test Driven IOS Development Swift4 - 3rd [pdf] Test Driven IOS Development Swift4 - 3rd [pdf] Test Driven IOS Development Swift4 - 3rd [pdf] Test Driven ...
思科 cisco ios 镜像 C3640-IK.BIN 文件由多位CCIE水平人员测试使用后拷贝,dy下可用.
iOS语音开发libopencore-amrwb和libopencore-amrnb最新适用库,该版本支持x86_64、i386、armv7、armv7s、arm64cpu架构 使用方法:拖入项目 方便自己下载,想用各位老铁也下吧
vuforia-sdk-ios-6-5-25.zip vuforia sdk for iOS Use the Vuforia SDK to build Android, iOS, and UWP(win10+) applications for mobile devices and digital eyewear. Apps can be built with Android Studio, ...
Cisco 思科 1921 路由器 IOS c1900-universalk9-mz.SPA.158-3.M4.rar 官网下载
网易airtest for mac必备agent, iOS-Tagent 其实就是 WebDriverAgent 仔细看,会发现iOS-Tagent会比WebDriverAgent简略得多。 iOS-Tagent其实就是WDA的优化版本。 git clone ...
c3640-ik9o3s-mz-124-13b
之前遇到的需求,ios上没有类似的实现。搞了好久在网上搜了很多资料都不能解决最后找到了一个c/c++的底层源码,才实现了最后整理了下上传了。是个ios的demo很详细你定能看懂的。运行在xcode环境下,关键算法的文件是...