How to get only the sound of a YouTube video?

I ran into a rather strange problem. What I'm trying to do right now is to get a YouTube audio video for this link. I tried a couple of things, but it either didn't work or was ineffective.

So I decided to turn to more experienced iOS developers. Thanks in advance.

@implementation ViewController
@synthesize web;

- (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:0\"><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];

        UIWebView *webView =[[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
        [webView loadHTMLString:html baseURL:nil];
        [self.view addSubview:webView];
}

-(IBAction)play{

    [self embedYouTube:@"http://www.youtube.com/watch?v=iw1aT5c1Lus" frame:CGRectMake(0, 0, 320, 480)];

}
+3
source share
1 answer

just play the video with the media player, but don’t give it a frame, it will play sound but not load the image

+4
source

All Articles