Mac Cocoa WebView (WebKit) - YouTube videos show as black squares but audio works

Discussion in 'Mac Apps and Mac App Store' started by gwelmarten, Nov 22, 2013.

  1. gwelmarten macrumors 6502

    Joined:
    Jan 17, 2011
    Location:
    England!
    #1
    Hi

    I am trying to access youtube.com through a WebKit WebView in my native Mac App.

    The problem is that YouTube videos just show as black squares (see image below). However, if I click them they start to play (but stay black) - the sounds starts. I can also right click and the YouTube right click menu comes up (with things like 'Stats for Nerds').

    Does anyone know what is happening here?

    I use the standard WebView component, dragged in in Interface Builder. In my header I have the standard:

    Code:
    IBOutlet WebView *firstWebView;
    and in my .m the standard:

    Code:
    [firstWebView setHidden:FALSE];
    [[firstWebView mainFrame] loadRequest:[NSURLRequest requestWithURL: [NSURL URLWithString:@"http://youtube.com"]]];
    The same thing happens when I access a site with an embedded YouTube video.

    Thanks!

    Sam
     

    Attached Files:

Share This Page