gpt4 book ai didi

iphone - ipad相机和webview youtube视频播放问题

转载 作者:行者123 更新时间:2023-12-03 18:23:39 25 4
gpt4 key购买 nike

Rootviewcontroller有一个播放youtube视频的webview它有一个拍照按钮。 用户可以单击相机按钮并录制视频。到目前为止,它工作正常

当我关闭相机 Controller 并尝试在 WebView 中播放视频时,即使我尝试删除并再次添加到 View 中,其框架也会受到干扰。

当我关闭相机 Controller 而不录制视频时,它工作正常......这是图像 enter image description here播放视频的代码

 GDataEntryBase *entry2 = [[AppDelegate.feed entries] objectAtIndex:[tag intValue]];
NSArray *contents = [[(GDataEntryYouTubeVideo *)entry2 mediaGroup] mediaContents];
NSString *urlString=[NSURL URLWithString:[[contents objectAtIndex:0] URLString]];

NSString *embedHTML = @"\
<html><head>\
<style type=\"text/css\">\
body {\
background-color: black;\
color: black;\
}\
</style>\
</head><body style=\"margin:0\"><div>\
<embed id=\"yt\" src=\"%@\" type=\"application/x-shockwave-flash\" \
width=\"736\" height=\"571\"></embed></div>\
</body></html>";
NSString *html = [NSString stringWithFormat:embedHTML, urlString, webplay.frame.size .width, webplay.frame.size.height];
NSLog(@"html=%@",html);
[webplay loadHTMLString:html baseURL:nil];

最佳答案

-(void)imagePickerControllerDidCancel:(UIImagePickerController *)picker
{
[self dismissModalViewControllerAnimated:YES];


[self viewDidLoad];
// or if u write code in your viewdidapper method than

[self viewDidAppear:NO];

}

您可以在单击取消按钮时再次加载整个 View 。

关于iphone - ipad相机和webview youtube视频播放问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7466663/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com