0
이 제발 도와주세요 ios6.1 오른쪽 하단에있는 두 개의 작은 화살표 비디오가 작은 창에서 재생되는 동안 화살표를 클릭하자마자 비디오가 멈추고 화면에로드가 표시됩니다.비디오 난 당신이 클릭 할 때 의미</p> <p>비디오는 전체 모드에서 정지 새로운 개발자에게 나처럼
비디오가 풀 모드 및 가로 모드로 재생되지 않는 이유는 무엇입니까? 나뿐만 아니라
//
// Mynewpage.h
//
#import <UIKit/UIKit.h>
#import <MediaPlayer/MediaPlayer.h>
@interface Mynewpage : UIViewController
{
NSString *urlname;
MPMoviePlayerController *player;
}
@property(nonatomic,retain)NSString *urlname;
@end
다음
//
// Mynewpage.m
#import "Mynewpage.h"
#import <MediaPlayer/MediaPlayer.h>
@implementation Mynewpage
@synthesize urlname;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)didReceiveMemoryWarning
{
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
#pragma mark - View lifecycle
- (void)viewDidLoad
{
NSString *url = [[NSBundle mainBundle]
pathForResource:urlname
ofType:@"mp4"];
player =
[[MPMoviePlayerController alloc]
initWithContentURL:[NSURL fileURLWithPath:url]];
player.view.frame = CGRectMake(0,85, 320, 255);
[self.view addSubview:player.view];
[player play];
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
}
-(void)viewDidDisappear:(BOOL)animated{
NSLog(@"hi");
[player stop];
}
- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown);
}
@end
==================
//
// Newpage.h
#import <UIKit/UIKit.h>
#import "Custom_cell.h"
@interface Newpage : UIViewController{
NSMutableArray *mydata;
NSMutableArray *myaudio;
// IBOutlet Custom_cell *owncell
}
@end
는 M & 시간의 파일을 게시
다음
//
// Newpage.m
#import "Newpage.h"
#import "Custom_cell.h"
#import "Mynewpage.h"
@implementation Newpage
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)didReceiveMemoryWarning
{
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
#pragma mark - View lifecycle
- (void)viewDidLoad
{
mydata = [[NSMutableArray alloc]initWithObjects:@"1-রাসূলুল্লাহ সাল্লাল্লাহু আলাইহি ওয়াসাল্লামের সালাত আদায় পদ্ধতি",@"2-রাসূলুল্লাহ সাল্লাল্লাহু আলাইহি ওয়াসাল্লামের সালাত আদায় পদ্ধতি",nil];
myaudio = [[NSMutableArray alloc]initWithObjects:@"1",@"2",nil];
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [mydata count];
}
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Custom_cell";
Custom_cell *cell = (Custom_cell *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (indexPath.section == 0) {
}
if (cell == nil) {
NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"Custom_cell" owner:self options:nil];
//cell = [[[Custom_cell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
for (id currentObject in topLevelObjects)
{
if ([currentObject isKindOfClass:[UITableViewCell class]])
{
cell = (Custom_cell *) currentObject;
// cell.backgroundView.backgroundColor = [UIColor clearColor];
break;
}
}
}
cell.lbl.text = [mydata objectAtIndex:indexPath.row];
return cell;
// [myString release];
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
Mynewpage *page = [[Mynewpage alloc]init];
page.urlname = [myaudio objectAtIndex:indexPath.row];
[self.navigationController pushViewController:page animated:YES];
}
- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
@end