This is my first time posting here. So please bear with me. I am using Webkit to display some content from YouTube in a webview.
As I stated before I am using a WebView to display content from YouTube. But, I ran into some problems which I have outlined below
When attempting to use the YouTube's fullscreen action this is what happens:
Observations:
What wrong I did: When using the Flash player on YouTube’s website when I attempt to play a video everything worked fine. Additionally, when I clicked the YouTube video’s full screen button the window did appear in full screen. However, it is not completely fullscreen (the menu bar is still visible)
What I expected: I expected that the video would have entered fullscreen entirely. In Safari everything works fine.
Observations:
What I did: When using the HTML5 player on YouTube’s website when I attempted to play a video everything worked fine. However, when I clicked the YouTube video’s full screen button nothing happened.
What I expected: I expected that the video would have entered full screen. I did noticed when doing this ins Safari everything worked as expected.
Can someone please help me with this matter? I have searched everywhere and found nothing.
Here is a sample of the test app I did to illustrate this problem:
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
// Insert code here to initialize your application
NSURL *url = [NSURL URLWithString:@"https://www.youtube.com"];
NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url];
[[[self webView] mainFrame] loadRequest:urlRequest];
[self.window setContentView:self.webView];
//When YES WebView will use Flash if available, else will use HTML5
BOOL shouldUsePlugin = YES;
if (shouldUsePlugin == YES) {
[[[self webView] preferences] setPlugInsEnabled:YES];
//Test 1: Using Flash
} else {
[[[self webView]preferences]setPlugInsEnabled:NO];
//Test 2: Using HTML5
}
}
For those using the newer WebKit API (WKWebView
) see my answer here: WKWebView Mac Browser Enable fullscreen html5? for enabling fullscreen on HTML5 content
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With