IOS QuickTime plugin

Source: Internet
Author: User
When playing a video in uiwebview, You can see figininview in view hierarchy. This class comes from QuickTime plugin. The plugin path 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 Link Libraries and file and image resources. The name of QuickTime plugin is very loud. In fact, there are not many codes. There are only nine objective-C classes, which are dominated by figpluginview. It is coupled with WebKit. framework, or used to encapsulate video playback controls for WebKit. framework. Class relationships such:

Uiwebdocumentview pairs figpluginview and uiwebpluginview with the member variable struct _ cfdictionary * _ pluginviews. The figpluginview is the key and uiwebpluginview is the value.
Uiwebpluginview has a member variable uiview * _ uiview pointing to figpluginview,
Figpluginview has the member variable wakview * _ wakview pointing to uiwebpluginview.

Of course, video is only one type of pluginview. uiwebpluginview also manages other types of plugin.

The rendering process has the following relationship:

When updating the layer tree, renderlayerbacking obtains the uiwebpluginview from the renderwidget through the layer relationship and calls its function attachpluginlayer to add the figpluginview to the uiwebdocumentview. Note that this "add" is indirectly implemented through multi-layer calayer. uiwebpluginview also creates a hostlayer as medialayer. The implementation code at the end 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];    }}

Here, we only have a rough list of items, and the inter-class mesh dependency makes it difficult to draw pictures and use text instructions. In short, we can be more sure that wakview replaces nsview to share code with Mac webview. However, IOS application is a single-process program and can only be combined with the calayer tree instead of the nsview tree.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.