私は明らかに基本的な質問があります。私はその中にビデオを含むマルチメディアセクションを持つアプリケーションを持っています(YoutubeまたはTed)。Youtubeとモーダルビュー
動画(TableView)を選択すると、私は小さな説明付きのモーダルビューを開き、Youtubeビデオの場合はクリックしてビデオを開く必要があるウェブビューを開きます。それ以外の場合は、MPMovieControllerを使用します。
私が持っている問題は、YouTubeのビデオにあります。プレーヤーを閉じるとモーダルビューも閉じられ、モーダルビューを使用するアプリケーションの残りの部分は機能しません(モーダルビューは開きません)。
ここで説明ビューのコード:
- (void)viewDidLoad{
[super viewDidLoad];
NSRange range = [sendVideo rangeOfString:@"youtube"];
if(range.length>0){
NSString *htmlString =[NSString stringWithFormat:@"<html><head>"
"<meta name = \"viewport\" content = \"initial-scale = 1.0, user-scalable = no, width = 212\"/></head>"
"<body style=\"background:#F00;margin-top:0px;margin-left:0px\">"
"<div><object width=\"212\" height=\"172\">"
"<param name=\"movie\" value=\"%@\"></param>"
"<param name=\"wmode\" value=\"transparent\"></param>"
"<embed src=\"%@\""
"type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"212\" height=\"172\"></embed>"
"</object></div></body></html>",sendVideo,sendVideo];
[youtube loadHTMLString:htmlString baseURL:nil];
}
else
{...
ここでは、私がテーブルビューで映像を選択するために使用するコードです:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if(videosContenido ==YES){
VerDetalles *vd = [[[VerDetalles alloc]initWithNibName:@"VerDetalles"
bundle:nil]autorelease];
vd.sendTitle = [aux2 objectAtIndex:[indexPath row]];
vd.sendDesc = [aux6 objectAtIndex:[indexPath row]];
vd.sendVideo = [aux4 objectAtIndex:[indexPath row]];
UINavigationController *navController= [[[UINavigationController alloc]
initWithRootViewController:vd]autorelease];
if(navController){
navController.modalPresentationStyle = UIModalPresentationFormSheet;
navController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
}else {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
[self presentModalViewController:navController animated:YES];
}
どのようにモーダルビューコントローラを解除するのですか?... – iDroid
私は[self.navigationController dismissModalViewControllerAnimated:YES]と呼ばれるボタンがあります。 Tedの動画はOKですがYoutubeの動画は...モーダル表示を解除しますが、モーダル表示で他のセクションに移動しようとすると表示されません。 –
行選択中にナビゲーションコントローラを作成していますが、メンバー変数self.navcontrollerのようにアクセスしようとしましたか?.......... – iDroid