uiwebview

Get notifications when a Dailymotion video is played into a UIWebView

蓝咒 提交于 2019-12-08 03:41:26
I'm currently showing a dailymotion url directly into a UIWebview. When tapping on the thumbnail image, the video starts playing in fullscreen mode. The problem is: when the video stops playing or the user tapps the "done" button, the original thumbnail has disapeared from the UIWebview, making it impossible to launch the video again. I would like to control when the video has finished playing or the user has tapped the done button to reload the UIWebView. I've been looking around and playing with the Notification center but I couldn't get any response, can you tell me what code I should use ?

self.viewController.webView stringByEvaluatingJavaScriptFromString does not work

丶灬走出姿态 提交于 2019-12-08 02:43:27
问题 NSString* jsString = [NSString stringWithFormat:@"alert('ok');"];[self.viewController.webView stringByEvaluatingJavaScriptFromString:jsString]; I wrote it in cordova appdelegate.m! 回答1: On cordova-ios@3.x you should be able to do: [self.webView stringByEvaluatingJavaScriptFromString:jsString]; On cordova-ios@4+ you will need to cast the Webview class as it also supports WKWebView: if ([self.webView isKindOfClass:[UIWebView class]]) { [(UIWebView*)self.webView

Can I handle alert inside UIWebViewDelegate?

不打扰是莪最后的温柔 提交于 2019-12-08 02:39:50
问题 <script language="javascript"> alert("Hell! UIWebView!"); </script> I can see the alert message inside my UIWebView but can I handle this situation? Update: I'm loading a web-page into my UIWebView: - (void)login { NSString *requestText = [[NSString alloc] initWithFormat: @"%@?user=%@&password=%@", DEFAULT_URL, user.name, user.password]; // YES, I'm using GET request to send password :) NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:requestText]]; [webView

Embedding fonts in iPad

别说谁变了你拦得住时间么 提交于 2019-12-08 02:39:36
问题 I am trying to embed Google fonts in a WebView in iPad. If I put this in the head all works fine: <link href='http://fonts.googleapis.com/css?family=Monofett' rel='stylesheet' type='text/css'> The html is local then I need to copy the CSS and the fonts in my iPad. When I do this changes the fonts doesn't work: html: <link href='fonts/fonts.css' rel='stylesheet' type='text/css'> fonts/fonst.css: @font-face { font-family: 'Monofett'; font-style: normal; font-weight: normal; src: local('Monofett

iPhone SDK- Launch youtube application from within my application

两盒软妹~` 提交于 2019-12-08 02:14:52
问题 I am developing an app that use UIWebView to display a list of videos from youtube. For playing the videos I use the youtube embed feature and it open the youtube application when the user clicks the video thumbnail - works great. I want the same functionality to be executed when I click a "Watch Now" button that will be located near the youtube thumbnail on my web view but when I try to use "href" to the youtube video it opens the "youtube play page" and not the youtube iPhone application

Displaying HTML in iPhone app

你说的曾经没有我的故事 提交于 2019-12-08 02:11:08
问题 How to open url in textview iphone?? Is it possible to show data with links , photos and all html entities ??? 回答1: It's not possible with UITextView control. Use UIWebView or make your own custom control. 回答2: You can use UIWebView to load a static contain from files; html, photo, css, javascript. NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path]; NSString *filePath = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html"]; NSString

ASIHTTPRequest UIWebView load documents

假如想象 提交于 2019-12-08 02:04:27
问题 What is the best way to view documents (pdf,doc,xls) using AsiHttpRequest and UIWebView??? I tried the following, but the UIWebView is displaying the html: NSString * baseURL = @"http://xxxxxx/open-api/v1/"; NSString * itemRef = @"item/133/attachment/test.pdf"; NSString *urlString = [NSString stringWithFormat:@"%@%@", baseURL, itemRef]; NSURL *url = [NSURL URLWithString:urlString]; ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; [request setUsername:@"xx"]; [request setPassword

How to find the responder that is returning YES to canPerformAction:withSender:

…衆ロ難τιáo~ 提交于 2019-12-08 02:01:45
问题 I need to disable the Define menu item from the edit menu on a UIWebView. This is supposed to be done by implementing canPerformAction:withSender: and returning NO for the items to disable. Even though these are private items it seems like I should be able to return YES for the items I want to keep and NO for everything else (as in this question). However this is not working. The documentation says that If no responder in the responder chain returns YES, the menu command is disabled. Note

How to save browsing history of UIwebview

安稳与你 提交于 2019-12-08 01:31:56
问题 I am developing an app where there is a requirement under which there is show wikipedia link in Web view.and also there is showing history of pages open via web view in a table view.I have find it on goo gle but can't find any solution.How can I solve it? 回答1: Following code for the backward and forward into UIWebViewController - (IBAction)backButtonClicked:(id)sender { [webView goBack]; } - (IBAction)backButtonClicked:(id)sender { [webView goForward]; } 回答2: UIWebView has goBack and

UIWebView YouTube Embed video not loading

被刻印的时光 ゝ 提交于 2019-12-08 01:22:11
问题 I am having some trouble getting videos that I am embedding through a UIWebView in an iOS app that I am making. The iframe player loads up completely fine, but when I hit the play button the white spinner appears for a second then disappears, leaving just a black box If I touch on the black box I get the title and the 'i' button, but the video will never start. The only way I have found to get the video to play is by hitting the 'i' button in the top right to see the info then pressing it