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

 

posted @ 2012-01-02 15:44  cc_team  阅读(225)  评论(0编辑  收藏  举报