0
我正在製作一個應用程序,可以在ios模擬器上顯示預加載的文件。儘管顯示屏顯示在模擬器上,但我看不到視頻也聽不到聲音。視頻輸出不可見
這是我的代碼。
#import "BIDViewController.h"
@implementation BIDViewController
@synthesize moviePlayer;
-(IBAction)playMovie:(id)sender
{
NSString *url = [[NSBundle mainBundle]
pathForResource:@"SwimGood" ofType:@"m4v"];
MPMoviePlayerController *player = [[MPMoviePlayerController alloc]
initWithContentURL:[NSURL fileURLWithPath:url]];
//Play partial screen.
player.view.frame = CGRectMake(64, 100, 200, 150);
[self.view addSubview: player.view];
[self.moviePlayer prepareToPlay];
[player play];
}
您使用ARC嗎? – Till
是的,我非常感謝你@sarafarazBabi – DanKiiing
乾杯!我已經做到了..再次感謝您的幫助 – DanKiiing