0

update: player can be opened when user clicks on the webview

#pragma mark -
#pragma mark addYouTubeView

- (void)addYouTubeVideoWebView:(NSString*)url frame:(CGRect)frame 
{  
    // embed
    NSString* embedHTML = @"\
    <html>\
        <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:frame];
    [webView setOpaque:NO];
    [webView setBackgroundColor:[UIColor clearColor]];
    [webView loadHTMLString:html baseURL:nil];

    // fix webview in the frame and make it no move
    [self removeBounceEffect:webView];

    [self.view addSubview:webView];
}

Hi folks I got some problem that I cannot solve.

I saw this answer here then I decide to dump the view to see if there is something called ** YTMoviePlayer**. Then I tried to use a method here to dump views. Since I dont know how to trigger "dump" method when the video is playing, I use "performselector":

[self performSelector:@selector(dumpViews:) withObject:[[UIApplication sharedApplication] keyWindow] afterDelay:3];

- (void) dumpViews:(UIView *)view
{
    dumpViews(view, @"", @"");
}

The problem is, views dumped in log are still views before the player shows, so I cannot see what player is it. So my question is how to dump views at any time? And why the "dump" method is different from a typical objective-c method?

Thanks you.

Community
  • 1
  • 1
ThinkChris
  • 1,169
  • 2
  • 15
  • 38

1 Answers1

1

The dumpViews you linked to is actually a normal C function and not an Objective C method.

sch
  • 27,436
  • 3
  • 68
  • 83