我正在尝试使用集成的 webkit webview 构建一个 osx cocoa 应用程序来显示网页。
网页上有 html5 视频元素,用户应该能够全屏播放。但是全屏只是在山狮(10.8.2)上显示黑屏音频仍在播放,但在osx lion上它可以工作,这是一个错误还是我错过了什么。
最小样本:
脚步:
创建一个可可应用程序添加一个 webview 连接属性“web”并添加 webkit 框架
代码:
#AppDelegate.h
#import <Cocoa/Cocoa.h>
#import <WebKit/WebKit.h>
@interface AppDelegate : NSObject <NSApplicationDelegate>
@property (assign) IBOutlet NSWindow *window;
@property (weak) IBOutlet WebView *web;
@end
#AppDelegate.m
#import "AppDelegate.h"
@implementation AppDelegate
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
NSString *html = @"<html><body><video src=\"http://video-js.zencoder.com/oceans-clip.mp4\" controls></body></html>";
[[self.web mainFrame] loadHTMLString:html baseURL:nil];
}
@end
在 OSX 10.8.3 中修复:
问题似乎已在 OSX 10.8.3 中得到修复 全屏现在可以正常工作,即使没有像 OSX 10.8.2 之前那样的沙盒