Similar question have been posted here, but I've none of the solutions presented there help me. I have a site: http://cherryfieldmaine.us/
When I test the site with Firefox Responsive Design View, or other online responsive testing tool, the site looks fine - just as it should. However, when I view it on a real iPhone, the site fills up less than 1/2 of the screen.
I've never encountered this before and I'm at a loss for how to fix it. Suggestions?
This is my code
NSString *urlString = #"http://cherryfieldmaine.us/";
NSURL *url = [NSURL URLWithString:urlString];
NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url];
[self.webView loadRequest:urlRequest];
Related
I'm trying to embed a vimeo video into my app using UIWebView.
Currently my code looks like this and it plays the video fine if you press play, but I would like it to play when the UIWebView loads and I'm not sure how to make that happen.
NSURL *videoURL = [NSURL URLWithString:#"http://player.vimeo.com/video/123456?autoplay=1"];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:videoURL];
UIWebView * SignUpVideo = [[UIWebView alloc] init];
MyVideo.frame = CGRectMake(0,125,781,481);
[self.view addSubview:SignUpVideo];
[MyVideo loadRequest:requestObj];
This is placed under -(void)viewDidLoad
The autoplay URL parameter doesn't work in Mobile Safari either. I'm thinking you may be out of luck unless you can get a URL for a direct stream. But in that case you could use the AVPlayer instead of a web view and have all of the flexibility you need.
Here is an interesting discussion about the vimeo direct link URLs: How can I find download links for vimeo videos? . However, according to that, vimeo doesn't allow that technique so you might want to take a look a the developer APIs here: https://developer.vimeo.com
Best regards.
I'm creating a web app and have a problem. My images is shown in my Safari browser and in the Iphone simulator, but they are not shown on my Iphone.
Any ideas?
If HTML files and images are stored locally on device, you have to keep in mid that iOS filesystem is case sensitive. so iPhone.jpg and iphone.jpg can be two different files... make sure that all your tags and corresponding files have correct case...
Also when loading uiwebview and resources for it are in bundle folder you have to make sure that you set baseURL so that webkit can find relative linked files:
NSString *path = [[NSBundle mainBundle] bundlePath];
NSURL *baseURL = [NSURL fileURLWithPath:path];
[webView loadHTMLString:htmlString baseURL:baseURL];
this enables you to link relative to bundle:
<img src=iPhone.jpg">
I have an iphone app which requires the videos to be played from the URL.
I dont want to download the whole videos just as it eventually slows down my app.
I want to play the videos in a way that it buffers in between and then plays.
How to play videos from a URL into an iphone app with buffering?
Try Like this....
NSString *url = #"www.youtube.com/xyz";
NSString *htmlString =[NSString stringWithFormat:#"<object width='212' height='172'><param name='movie' value='%#'></param><param name='wmode' value='transparent'></param><embed src='%#'type='application/x-shockwave-flash' wmode='transparent' width='980' height='965'></embed></object>",url,url];
[myWebview loadHTMLString:htmlString baseURL:nil];
do you have own server for streaming?
then,
NSURL *url = [NSURL URLWithString: #"http://STREAMING URL"];
[myMPMoviePlayerController setContentURL: url];
[myMPMoviePlayerController play];
I have a UIWebView in an iPhone application I am building. It's job is to load up a URL. The code I use is:
NSURL *url = [NSURL URLWithString:providedURL];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[webView loadRequest:request];
This is in viewDidLoad.
I have noticed that it takes around 18 seconds for the page to load in my app....but when using Safari it takes 5-8 seconds. Has anyone run into this issue before? Does it have anything to do with how I'm forming my request?
It is likely because Safari has cached the resources of the site already. A basic UIWebView does not do any caching by itself. You'll have to implement that yourself. See a question about that here:
How to cache content in UIWebView for faster loading later on?
When UIWebView loads Microsoft word documents, it just loads it as if it's one whole strip of paper, disregarding the separation between pages. Any idea how to display it properly (pages separated from each other), I'm open to lower level programming, or alternatives to UIWebView for loading Office documents. I'm currently using IPhone OS 3.2 for IPad.
E.g. I tried creating a word document with 2 pages, and one paragraph on each page, when I load it in UIWebView, it's displayed in one page.
The code I used is from Apple Technical Q&A
-(void)loadDocument:(NSString*)documentName inView:(UIWebView*)webView
{
NSString *path = [[NSBundle mainBundle] pathForResource:documentName ofType:nil];
NSURL *url = [NSURL fileURLWithPath:path];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[webView loadRequest:request];
}
// Calling -loadDocument:inView:
[self loadDocument:#"test1.doc" inView:self.myWebview];
As a side note, I'm thinking this should be possible because there are apps like Documents to Go and QuickOffice, I'm not sure how they implemented it.
At the current SDK, it's not possible. We ended up implementing our own and used UIScrollView to meet our requirements. This was a lot of work implementing our own renderer, own panning system, etc.