uiwebview

uiwebview Video cannot be played in IOS 12.2

荒凉一梦 提交于 2020-01-02 05:25:07
问题 iOS 12.2 real machine can not play the video in html5 loaded by UIWebView, link url http://community.cqliving.com/h5/info/detail/512.html?cid=512&isOpenApp=&f=10, other versions can play video Rendering 回答1: Is it embedded using UIWebView or WKWebView or similar? Try setting mediaPlaybackRequiresUserAction to YES for the webview. I'm seeing the same issue ( UIWebView and WKWebView both) in iOS 12.2. Works fine in iOS 12.1 and earlier. When debugging, you see this error in safari console:

using a webview to play videos from youtube in iphone app

Deadly 提交于 2020-01-02 05:07:07
问题 I am trying to watch videos in my iphone app using the following code: -(void) viewDidLoad{ [super viewDidLoad]; UIWebView *webView = [[UIWebView alloc]initWithFrame:self.view.frame]; NSString *youTubeVideoHTML = @"<html><head>\ <body style=\"margin:0\">\ <embed id=\"yt\" src=\"%@\" type=\"application/x-shockwave-flash\" \ width=\"%0.0f\" height=\"%0.0f\"></embed>\ </body></html>"; // Populate HTML with the URL and requested frame size NSString *html = [NSString stringWithFormat

Detect and Customize UIWebView's “Unable to Read Document” error

最后都变了- 提交于 2020-01-02 04:12:08
问题 I'm testing a UIWebview with a number of different document types - .xlsx, .jpg, etc. - and it opens most of them just fine. From time to time, I open a local file and this message appears right in the web view: Unable to Read Document An error occurred while reading the document I'm not concerned with "why" this error occurs - it happens, for instance, when I feed the UIWebView a garbage file (intentionally). The problem is that I can't figure out how to detect "when" this happens. It doesn

UIWebView delay in loading local content

久未见 提交于 2020-01-02 04:02:15
问题 I'm displayed a small amount of local content in a UIWebView, roughly 3 paragraphs of text and one 100x100px image. When the UIWebView is pushed onto to the nav controller, it takes about half a second before the content is displayed. This occurs on the device, not in the simulator. Obviously the UIWebView needs to do some work before displaying the content, but is there some way I can do this before the pushed view appears? I have not had any luck doing this myself. Here is where I'm

How to set background color for UIWebView in iPhone sdk

Deadly 提交于 2020-01-02 03:30:11
问题 I have added the back ground color as an image to uiwebview but it is coming to the back side of web view not to the web view. The web view is always in white colored view, I can't change it. myView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]; myView.autoresizingMask=YES; webView = [[UIWebView alloc] init]; webView.backgroundColor=[UIColor colorWithPatternImage:[UIImage imageNamed:@"BG_Doctor.png"]]; webView.delegate = self; [myView addSubview:webView]; self.view

Change textcolor of UIWebView

别等时光非礼了梦想. 提交于 2020-01-02 02:24:07
问题 I am making an epub reader, into which I am loading HTML pages in my webview : [_webview loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:_pagesPath]]]; Now I want to change background color and and text color of my the HTML pages. I changed background color of my webview using, self._webview.backgroundColor = [UIColor blackColor]; self._webview.opaque = NO; That's working, but I also want to change the text color of my webview. How do I do this? 回答1: In this this code color:

how to add a image from the photo storage to a UIWebview

不羁的心 提交于 2020-01-01 20:01:06
问题 Is there anyway to display a image in a UIWebview from the iphone photo storage 回答1: May be this is the suitable code in the upload image, - (BOOL)webView:(UIWebView*)webViewRef shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType { //we are listening out for links being click if (navigationType == UIWebViewNavigationTypeLinkClicked) { NSURL *URL = [request URL]; //Get the URL if ( [[URL scheme] isEqualToString:@"objc"] ) { webView =

WKWebView LayoutConstraints issue

China☆狼群 提交于 2020-01-01 19:31:48
问题 I have created a simple webview app. But there is a small problem and I can not fix it. It loads the first page without issue. When I click to the first input, the program crashes and the error code is below: 2017-10-28 23:50:54.289690+0400 BFI Schools[68425:3885613] [LayoutConstraints] Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't

Why does UIWebView shrink images?

爷,独闯天下 提交于 2020-01-01 18:16:12
问题 I'm using a UIWebView to display images in base64 (http://www.abluestar.com/utilities/encode_base64/index.php). The UIWebView is set to "Scales Page To Fit" and Mode is "Left". The image might be 400px wide but once rendered in the UiWebView, it takes up not even half of the screen. I need to do something like style="width:800px;..." before it begins to take up most of the screen and is readable (because it isn't so small). Is this the right way? Why does the image shrink in the UIWebView and

Why does UIWebView shrink images?

牧云@^-^@ 提交于 2020-01-01 18:15:06
问题 I'm using a UIWebView to display images in base64 (http://www.abluestar.com/utilities/encode_base64/index.php). The UIWebView is set to "Scales Page To Fit" and Mode is "Left". The image might be 400px wide but once rendered in the UiWebView, it takes up not even half of the screen. I need to do something like style="width:800px;..." before it begins to take up most of the screen and is readable (because it isn't so small). Is this the right way? Why does the image shrink in the UIWebView and