Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8246661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T22:34:47+00:00 2026-06-07T22:34:47+00:00

This is very strange to me… I have a simple WebView that loads and

  • 0

This is very strange to me…

I have a simple WebView that loads and interacts with the user exactly like safari mobile (iPhone). Now when you visit m.youtube.com in safari, the url changes when you click on a link to something like this…

http://m.youtube.com/watch?gl=US&hl=en&client=mv-google&v=HX6SyoZ5kw8

The problem with this is I don’t think that url is being used in my webview… What do I mean? The following code is used to load a url every time the user try’s to click on a link, and it works, but I have a problem with Youtube…

- (BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType {
NSURL *url = request.URL;
NSString *urlString = url.absoluteString;
NSLog(@"%@",urlString);
VideoURLTextBox.text = urlString;
return YES;
}

When I first start up the webview it loads m.youtube.com and NSLogs() it into my console, but when I decide to click on a video it fails to NSLog() therefore I don’t think a new url is being loaded, but when you load m.youtube.com in safari and click on a video you load a url like above, so why does this not NSLog() in my iPhone application?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T22:34:49+00:00Added an answer on June 7, 2026 at 10:34 pm

    What your probably seeing is that the youtube video is running javascript to play the video, you’d have to intercept the javascript callbacks to see that. Here’s a link to the youtube video player api, detailing the callbacks, https://developers.google.com/youtube/js_api_reference#SubscribingEvents

    If you just want to embed a youtube video in an iOS application then use this.

    Using the mobile YouTube site isn’t great, I had lots of problems with it in the past and ended up making a UIWebView category. I came across your question and decided to throw it on github 🙂

    https://github.com/enigmaticflare/UIWebView-YouTube–iOS-Category–ARC-compliant-code

    UIWebView+YouTube iOS category to simplify loading youtube videos.

    Instructions

    1) Add these files to your project

    UIWebView+YouTube.h
    UIWebView+YouTube.m
    

    2) Initiate UIWebView for example

    @property (strong, nonatomic) UIWebView *webView;
    @synthesize webView = _webView
    
    _webView = [[UIWebView alloc] initWithFrame:CGRectMake(0,0,212,172];
    //set the X,Y origin of CGRect to where you want the webView to appear.
    
    _webView.delegate = self;
    [_webView loadYouTubeVideoID:@"gR8dO7Cln6M"];
    [self.view addSubView:_webView];
    

    Good luck, hope this is what your looking for 🙂

    Adam

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This seems very strange to me but I have a script that I'm running
This is very strange. I have an XAML file that looks as follows... <Window
This is very strange. I've got a simple form. I have a file input
This is very strange and I don't know why. I have a ViewModel that
I have a very strange issue with PHP. I run this very simple code:
This is a very strange problem, and I just hope that I can clearly
it is very strange, because this error doesn't happen all the time... I have
Starting from Android 3.2 I have this strange problem. It's very easy to reproduce:
I have this very strange problem while compiling the project. MOC seems to be
I have this very strange issue with my MVC 2 project. Often times, I'll

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.