uiwebview

YouTube Autoplay Possibilities In IOS

血红的双手。 提交于 2020-01-01 17:10:37
问题 I have created a webView: videoView.delegate = self; videoView.userInteractionEnabled = true; [videoView loadRequest:[[NSURLRequest alloc]initWithURL:[[NSURL alloc] initWithString:@"website"]]]; I have html/javascript to handle the video's loading as well as the autoplay and next video. This all works, but my problem is that IOS autoloads the quicktime - like player, which is also a good thing, but I do not know how to control that, nor do I know how to get the video to play once that has

How do i insert UIImage on UIWebView

时间秒杀一切 提交于 2020-01-01 15:35:17
问题 I'm trying to display an Animated-GIF image in a UIImageView. Because this way only the first frame is shown i wanted to try a different approach. UIWebView. How can i get an Animated-GIF that is in memory (NSData) to display on a UIWebView with all frames..? 回答1: Thanks Thomas for you response, i don't know if it works because i managed to do it myself now.. Been decoding the GIFs for more then a week now and still with no succes so i went from UIImageView to UIWebView and the following code

Allowing location access inside UIWebView

こ雲淡風輕ζ 提交于 2020-01-01 09:30:32
问题 I have a webview based application and when I access http://maps.google.com, my webview is not passing the location as Safari does. I know CLLocationManager is needed, but do I get a callback when a webpage (maps.google.com) wants access to my device location? How do I respond back with the coordinates to the webpage from my WebView? 回答1: The webview will start monitoring the location automatically, however since iOS 8 location access requires the NSLocationWhenInUseUsageDescription

iPhone UIWebview video playback 4.0

南楼画角 提交于 2020-01-01 07:35:12
问题 Now that 4.0 is public, I can edit this question and ask it again. This code works in 3.2 and any prior versions, but in 4.0 I get an alertView saying "This movie could not be played". ivar webView //in viewDidLoad self.webView = [[UIWebView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]; webView.scalesPageToFit = YES; webView.delegate = self; // in tableView didSelectRowAtIndexPath // url contains a video from web NSURL *url = [NSURL URLWithString:@"http://www.somevalid.td

UIWebView inside a UITableViewCell

六月ゝ 毕业季﹏ 提交于 2020-01-01 07:12:49
问题 Has anyone tried it? The hardest part for me is to get the height of the UITableViewCell to be the same as that of the UIWebView. By debugging into the code, I noticed that the delegate for UITableViewCell (heightForRowAtIndexPath for getting the height of the cell) is called before the one (webViewDidFinishLoad) for UIWebView is called. Any solution to work around that? Super thanks! 回答1: I saw this scenario demonstrated once on the iTunesU Stanford iPhone Application Development course. It

iOS Google Drive SDK load file into UIWebView using key “webContentLink”

本小妞迷上赌 提交于 2020-01-01 06:40:48
问题 I have implemented remote connection to Google Drive in my iOS app using the Google Drive SDK. I can successfully access file/folder lists and metadata using GTLServiceDrive class and download content using the GTMHTTPFetcher class. When I download content using the GTMHTTPFetcher class, I use the GTLServiceDrive key downloadUrl , and I use a line of code to authorise the download - per the second line of code following... GTMHTTPFetcher *fetcher = [googleDriveService.fetcherService

Loading text file by AJAX call in UIWebView using custom NSURLProtocol fails

こ雲淡風輕ζ 提交于 2020-01-01 05:53:33
问题 I want to display a website on an iOS app using a UiWebView . Some components of the site (namely the webservice results loaded using AJAX calls) should be replaced by local data. Consider the following example: text.txt: foo page1.html: <html><head> <title>test</title> <script type="text/javascript" src="jquery.js"></script> </head> <body> <div id="target"></div> <script type="text/javascript"> function init(){ $.get("text.txt",function(text){ $("#target").text(text); }); } $(init); </script

Loading text file by AJAX call in UIWebView using custom NSURLProtocol fails

浪尽此生 提交于 2020-01-01 05:52:20
问题 I want to display a website on an iOS app using a UiWebView . Some components of the site (namely the webservice results loaded using AJAX calls) should be replaced by local data. Consider the following example: text.txt: foo page1.html: <html><head> <title>test</title> <script type="text/javascript" src="jquery.js"></script> </head> <body> <div id="target"></div> <script type="text/javascript"> function init(){ $.get("text.txt",function(text){ $("#target").text(text); }); } $(init); </script

iOS 7: UIWebView crashes because of range exception

落爺英雄遲暮 提交于 2020-01-01 05:50:22
问题 I'm currently building an App that uses the krpano viewer, which is a Panorama Viewer built with JavaScript. I'm loading this Panorama viewer in a UIWebView with local images that are saved on the iPad. But after using the Panorama viewer for a while, I get this error and the app crashes: Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[WebCoreSharedBufferData getBytes:range:]: range {0, 4000} exceeds data length 0' *** First throw call stack: (0x2e213f53

Deferring viewWillAppear until webViewDidFinishLoad

喜夏-厌秋 提交于 2020-01-01 05:07:20
问题 I have an application that uses UIWebViews in several view controllers. The UIWebViews are used to render locally generated html, no slow network access required. To save memory I only load these on demand as prompted by the viewcontroller viewWillAppear callback. (And unload offscreen instances in response to didReceiveMemoryWarning messages.) The problem is that the user gets to see the html being rendered, sometimes accompanied by flashes of styling and other assorted unpleasant artifacts.