iphone-common-codes-ccteam源代码 CCPlayer.m

//
// CCPlayer.m
// CCFC
//
// Created by xichen on 11-12-16.
// Copyright 2011年 ccteam. All rights reserved.
//


#import "CCPlayer.h"




@implementation CCPlayer




// 调用系统播放器播放资源界面
+ (MPMediaPickerController *)showIpodPlayResourceView:(id)delegate
mediaType:(MPMediaType)mediaType
prompt:(NSString *)prompt
isAllowMultiSelected:(BOOL)isAllowMultiSelected
animated:(BOOL)animated
{
MPMediaPickerController *playlistView =
[[MPMediaPickerController alloc] initWithMediaTypes:mediaType];
if(!playlistView)
{
return nil;
}

playlistView.delegate = delegate;
playlistView.prompt = (NSString *)prompt;
playlistView.allowsPickingMultipleItems = isAllowMultiSelected;

[delegate presentModalViewController:playlistView animated:animated];
[playlistView release];
return playlistView;
}


// not known
// 调用系统ipod视频播放借口
+ (MPMoviePlayerViewController *)showMovieView:(id)delegate
urlStr:(NSString *)urlStr
style:(MPMovieControlStyle)style
animated:(BOOL)animated
{
MPMoviePlayerViewController *moviePlayerController =
[[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL URLWithString:urlStr]];
if(!moviePlayerController)
{
return nil;
}



[delegate presentMoviePlayerViewControllerAnimated:moviePlayerController];
moviePlayerController.moviePlayer.movieSourceType = MPMovieSourceTypeFile;
[moviePlayerController.moviePlayer play];

return [moviePlayerController autorelease];
}


@end

 

可能有更新:

 googlecode链接地址:http://code.google.com/p/iphone-common-codes-ccteam/source/browse/trunk/CCFC/files/CCPlayer.m

 github地址: https://github.com/cxsjabc/iphone-common-codes-ccteam/tree/master/CCFC/files/CCPlayer.m

 

你可能感兴趣的:(iPhone)