2
我想在點擊按鈕的相同視圖上播放視頻。我們可以添加mpmovieplayerviewcontroller作爲子視圖嗎?
NSURL *movieUrl = @"Some Url";
CGRect frame;
frame =CGRectMake(10,10,100,100);
MPMoviePlayerViewController *player = [[MPMoviePlayerViewController alloc] initWithContentURL:movieUrl];
[self.view addSubview:player.view];
player.view.frame = frame;
[player release];
當我運行這個,它顯示一個黑色的背景幀,但不播放視頻。我沒有使用YouTube視頻。
感謝的reply.When我寫[Player中]應用crashes.give我solution.Please – 2011-06-18 05:37:54
我發現這裏的答案http://stackoverflow.com/questions/2218158/using-mpmovieplayerviewcontroller-in -sdk-3-2換的ipad – 2011-06-18 06:17:18