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

  • SEARCH
  • Home
  • 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 6715465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:37:03+00:00 2026-05-26T08:37:03+00:00

My application needs to support to play YouTube video and shows the first frame

  • 0

My application needs to support to play YouTube video and shows the first frame as Thumbnail. Since we need to keep our application running about playing video, therefore, in iOS 4.3.5, we used a method to embed a HTML link in a WebView. It works fine to play Video with YouTube player and it would return to my application upon finished.

Unfortunately, this method does not work. Any suggestion ?

My previous method is as follows:

NSString* embedHTML = @”body {background-color: transparent;color: white;}
“;

NSString* html = [NSString stringWithFormat:embedHTML, url, frame.size.width, frame.size.height];

NSLog(@"HTML = %@", html);
UIWebView* videoView = [[UIWebView alloc] initWithFrame:frame];  
videoView.backgroundColor = [UIColor clearColor];
[videoView loadHTMLString:html baseURL:nil];
[_supview addSubview:videoView];  
[videoView release];
  • 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-05-26T08:37:04+00:00Added an answer on May 26, 2026 at 8:37 am

    Use this:

    - (void)embedYouTube:(NSString*)url frame:(CGRect)frame {
       NSString* embedHTML = @"\
        <html><head>\
        <style type=\"text/css\">\
        body {\
        background-color: transparent;\
        color: white;\
        }\
        </style>\
        </head><body style=\"margin:0px\">\
        <embed id=\"yt\" src=\"%@\" type=\"application/x-shockwave-flash\" \
                 width=\"%0.0f\" height=\"%0.0f\"></embed>\
        </body></html>";
    
       NSString* html = [NSString stringWithFormat:embedHTML, url, 
              frame.size.width, frame.size.height];
       NSLog(@"%@",html);
       if(youtube == nil) {
            youtube = [[UIWebView alloc] initWithFrame:frame];
            [self.view addSubview:youtube];
       }
      [youtube loadHTMLString:html baseURL:nil];
      [youtube setUserInteractionEnabled:YES];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My application needs to send video data frame by frame from Server to Client.
Our application (Eclipse RCP-based, using a JFace/SWT-based interface) needs to support editing of mathematical
I need to support Chinese in one of my application on Windows, the problem
i need to update my application so it can support retina display in New
Hello I need to have multiple language support of my django admin application.I can
my application needs multiple jars to work. Since it is a desktop application i
Our application needs a simple scheduling mechanism - we can schedule only one visit
i am developing an android application. In my application i need to play different
I am working on a web forms application that needs to support multiple languages
I'm writing a new web application that needs to support drag and drop operations

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.