To configure parameters for the PPAPI plug-in in HTML

Source: Internet
Author: User
Tags skia

Foruok original, if you need to reprint please pay attention to Foruok subscription number "program Horizon" contact Foruok.

In HTML, you can configure the plug-in by embed or the object tag. Using embed is similar to the following:

<embed id="myplugin" type="application/x-ppapi-myplugin" width="1200px" height="520px">

Using object is similar to the following:

<object id="myplugin" type="application/x-ppapi-myplugin" width="1200px" height="520px" custom="i am custom">  <param name="tang" value="desktop" /></object>

When the Ppapi plugin is instantiated, you can receive the parameters configured in embed or object. All attributes that are embedded in the tag (such as id= "Myplugin"), param specified parameters, are passed to the Ppp_instance method in the form of a name-value pair. The method is prototyped as follows:

PP_Bool (*DidCreate)(PP_Instance instance,                     uint32_t argc,                     const char* argn[],                     const char* argv[]);

Where ARGC is the number of arguments in a CEF-collected embed or object, argn array is the parameter name, and the argv array is the value of the parameter. The parameters can be handled in code like this:

PP_Bool Instance_DidCreate(PP_Instance instance,    uint32_t argc,    const char* argn[],    const char* argv[]) {    ...    char szLog[256] = { 0 };    sprintf_s(szLog, 256, "PPAPI Got %d params\r\n", argc);    OutputDebugStringA(szLog);    for (int i = 0; i < argc; i++)    {        sprintf_s(szLog, 256, "name=%s, value=%s\r\n", argn[i], argv[i]);        OutputDebugStringA(szLog);    }    ...}

For the previous example of the object tag, using DebugView you might see the following output:

Ok, the parameters can be processed, the plugin can be customized.

Other reference articles:

    • CEF Windows Development Environment Setup
    • CEF Load Ppapi Plugin
    • VS2013 compiling the simplest Ppapi plugin
    • Understanding the design of PPAPI
    • Ppapi plugin-to-browser interaction process
    • Windows compiled from the source CEF
    • Media_stream_video Example of compiling PPAPI
    • PPAPI plug-in drawing and input event handling
    • Creating a local window in the PPAPI plug-in
    • PPAPI plug-in communication with the browser
    • Skia compiled from source under Windows
    • Using Skia drawing in the Ppapi plug-in
    • Load a picture resource in a DLL to generate a Skbitmap object in Skia
    • Ppapi+skia implementation of Graffiti Board
    • 3D graphics interface using chromium in PPAPI
    • Using OpenGL ES drawing in Ppapi
    • JS in CEF interacts with C + +
    • Communication between browser process and render process in CEF
    • Multi-process model and related parameters of chromium and CEF
    • Use ASYNCIPC communication between PPAPI and browser

To configure parameters for the PPAPI plug-in in HTML

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.