When UIWebView plays a video, you can see a figpluginview figure in the view hierarchy. The path for this class from QuickTime Plugin,plugin is:/applications/xcode.app/contents/developer/platforms/iphonesimulator.platform /developer/sdks/iphonesimulator6.1.sdk/system/library/internet Plug-ins/quicktime Plugin.webplugin
This is a folder with a library of links and file and picture resources. QuickTime plugin This name is very loud, in fact, the code is not much, Objective-c class only 9, it is only Figpluginview-based. It is coupled to the webkit.framework, or is meant to encapsulate the video playback control for Webkit.framework. Class relationships such as:
Uiwebdocumentview will pair Figpluginview and Uiwebpluginview with member variable struct __cfdictionary *_pluginviews, where Figpluginview is key, Uiwebpluginview is value.
Uiwebpluginview has a member variable UIView *_uiview points to Figpluginview,
Figpluginview has a member variable Wakview *_wakview points to Uiwebpluginview.
Of course, video is just one of Pluginview, Uiwebpluginview also manages other kinds of plugin.
There is this relationship in the rendering process:
renderlayerbacking when updating the layer tree, from renderwidget to get uiwebpluginview through several layers of relationships, Call its function Attachpluginlayer to add Figpluginview to Uiwebdocumentview. Note that this "add" is implemented indirectly through many layers of calayer, and Uiwebpluginview also creates a hostlayer as Medialayer. The end implementation code of the call chain is as follows:
- (void) _connectpluginlayers {webthreadlock (); if(!_hostinglayer) {_hostinglayer=[[Calayer alloc] init]; } [_webview.layer Insertsublayer:_hostinglayer atindex:0]; if([[[_webview WebView] _setmedialayer:_hostinglayer forpluginview:self]) {Self.parentedinlayer=YES; [_uiview retain]; [_hostinglayer Addsublayer:_uiview.layer]; [_uiview release]; [_webview _setsubviewcachesneedupdate:yes]; [Self _reshapeonmainthread]; } } /*how to ask Hovertree.com*/
Here is only a general list, the inter-class mesh dependency, it is difficult to draw and the text description. In short can be more certain, Wakview is to replace the NSView, in order to and Mac WebView Common code, but iOS application is a single process program, can only use Calayer tree instead of NSView tree to do the combination.
Recommendation: http://www.cnblogs.com/roucheng/p/3528371.html
QuickTime Plugin for iOS