Dynamic creation, alteration, and deletion of Ppapi plugins

Source: Internet
Author: User

Tag: Width Color Presence Action Note pre NES license RET

Once you're done. PPAPI plug-in development, actual use may have the following requirements:

    • Dynamically creating PPAPI Plugins
    • Remove Ppapi Plugin
    • Changing the size of the PPAPI plug-in

The implementation is very easy, from JS directly to the DOM (BOM) can be. The following is a demo sample HTML file:

<!   DOCTYPE html>

The above HTML shows several common operations for creating, deleting, and resizing.

It is important to note that when you delete a Ppapi plug-in, you call the Diddestroy method to Ppp_instance, and you need to remove the plugin instance from the C++/C code here and release the corresponding resource. For example, the graphics 2D. Image data, and so on. Diddestroy call, after a while. Assume that no other plug-in instance exists. It will then call Ppp_shutdownmodule. Assuming there is, it will not.

The logic, can participate in understanding PPAPI design .

When you set the width and Height properties of the Embed element, the Ppapi plugin is in. The Ppp_instance Didchangeview method is called, and you need to create the relevant resources again, based on the new dimensions.

That's it.

Other reference articles are described in my column: "CEF and Ppapi development ".

Dynamic creation, alteration, and deletion of Ppapi plugins

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.