uiwebview

video content on iPhone Safari/UIWebView

旧巷老猫 提交于 2020-01-15 12:06:08
问题 In my application I have a UIWebView that is able to play Youtube videos normally, but I'd like to play some videos from a website other than Youtube. If i try to play those videos in the iPhone Safari browser it opens in the same way that YouTube videos (fullscreen mode, showing the player), but that doesn't happen in the UIWebView inside my application. As an example, consider the following URL: http://m.video.globo.com/#video.php?id=1174097 (don't forget to open it in the simulator) I didn

iOS - Check if webView is loaded with PDF content on non-'pdf' file extension

Deadly 提交于 2020-01-15 10:58:07
问题 I would like to Check (boolean value) if PDF content is loaded in the UIWebView. This question already exists, but not this case. It's not as simple as just checking the path extension of the webView Url because this PDF content is generated via ASPX. The extension will return 'aspx'. Also not just looking in the url, the string 'pdf' will always be found in the url since I requesting a PDF file. I need to check if the server really returns a PDF file as it should. Ok, The webView is loaded

Overriding NSURLCache's cachedResponseForRequest to cache UIWebView assets with Three20

纵饮孤独 提交于 2020-01-15 09:08:23
问题 I need to cache a web-sourced image (i.e. not bundle sourced) that is going into a webview. Normally I'd just request the image and convert it into base-64 and stick it in the HTML, but if I have 100 images in line I can't quite do that. So I searched around a bit and found a way to grab the image request by subclassing NSURLCache and overriding cachedResponseForRequest . My code is below. I'm able to do the request just fine, I can get the data back and print it out, I made a UIImage from

Problem embedding an youtube video on iphone

喜欢而已 提交于 2020-01-15 05:17:08
问题 I am trying to embed a video with the following code to avoid launching the youtube app and stay in my app: -(void)embedYouTube:(NSString*)url frame:(CGRect)frame { NSString* embedHTML = @"<iframe type=\"text/html\" width=\"64\" height=\"39\" src=\"http://www.youtube.com/embed/j8Bc7eRTdWY\" frameborder=\"0\"></iframe>"; if(videoView == nil) { videoView = [[UIWebView alloc] initWithFrame:frame]; [movieDescView addSubview:videoView]; } [videoView loadHTMLString:embedHTML baseURL:nil]; } The

Unexpected Title Appears in WebView VC Swift

自闭症网瘾萝莉.ら 提交于 2020-01-15 03:18:06
问题 in my app I have a UIWebview for present a videos in it. when click on the video, the webview embedded dynamically to full screen. my problem is with its title, it have strange title !! like this : my code is : cell.vedioWebPage.backgroundColor = UIColor.blackColor() let vedioUrlEncodeStr = videosURLArray[indexPath.item].URL.stringByAddingPercentEscapesUsingEncoding(NSUTF8StringEncoding)! let requestURL : NSURL = NSURL(string: vedioUrlEncodeStr)! let request = NSURLRequest(URL: requestURL)

how to load pdf file in UIWebview center

瘦欲@ 提交于 2020-01-14 15:01:28
问题 I am new in ios developement.I am trying to display a pdf in a UIWebview center.i have a pdf in mainbundle.Here is what my PDF looks like now when loaded in a UIWebView: (I put in a brown gradient as the UIWebView's background so you can see what I mean better). - (void)viewDidLoad { UIWebView *theWebView = [[UIWebView alloc] initWithFrame:[self.view bounds]]; [theWebView setContentMode:UIViewContentModeScaleAspectFit]; [theWebView setAutoresizingMask:UIViewAutoresizingFlexibleHeight |

how to load pdf file in UIWebview center

删除回忆录丶 提交于 2020-01-14 15:01:20
问题 I am new in ios developement.I am trying to display a pdf in a UIWebview center.i have a pdf in mainbundle.Here is what my PDF looks like now when loaded in a UIWebView: (I put in a brown gradient as the UIWebView's background so you can see what I mean better). - (void)viewDidLoad { UIWebView *theWebView = [[UIWebView alloc] initWithFrame:[self.view bounds]]; [theWebView setContentMode:UIViewContentModeScaleAspectFit]; [theWebView setAutoresizingMask:UIViewAutoresizingFlexibleHeight |

How to copy selected data from a PDF displayed in a UIWebView

好久不见. 提交于 2020-01-14 06:21:04
问题 I am working on a project that displays a PDF in a UIWebView. I have added another UIMenuItem to the UIMenuController in order to do various things with the text in the UIWebView that has been selected. The problem is that I am not able to access the selected text in my newly created selector method. If I use the copy command on selected text first, then I can get that previously copied text from the pasteboard, but a command like [myWebView copy:sender]; called from my new selector does

Background audio playback in UIWebView

▼魔方 西西 提交于 2020-01-14 04:34:08
问题 My app allows users to access a service that plays audio books via the web. I am using a UIWebView to handle this. When the app is exited or the device is put to sleep, the audio stops playing. Since I am just displaying the web view not playing the audio file directly, I cannot use those methods to play the audio in the background. However, if you access the same link via the Safari app, the audio keeps playing after the phone is put to sleep. How can I achieve the same effect in my app? 回答1

iPad - find the true height of a UIWebView

浪子不回头ぞ 提交于 2020-01-14 04:17:05
问题 I work for a media company, and in our iPad application we're upgrading our content so it looks better. Previously, we used a UILabel to display the contents of our posts. I used this to get the actual height of my UILabel: CGSize expectedSize = [label.text sizeWithFont:label.font constrainedToSize:maximumLabelSize lineBreakMode:label.lineBreakMode]; However, we changed our posts' content to HTML, so I'm using a UIWebView. Is there a way to find the true height of the UIWebView, like I do