Difference between revisions of "Linden Lab Official:Media Plugin System Messages"
Rand Linden (talk | contribs) |
Rand Linden (talk | contribs) |
||
(49 intermediate revisions by 5 users not shown) | |||
Line 2: | Line 2: | ||
|-- | |-- | ||
| | | | ||
{{ | {{:API Portal/navigation|media}} | ||
|-- | |-- | ||
| | | | ||
Line 9: | Line 9: | ||
{{Media Messages AlphaList}} | {{Media Messages AlphaList}} | ||
|} | |} | ||
__TOC__ | __TOC__ | ||
== Overview == | == Overview == | ||
This article specifies the messages used in the Second Life Viewer media plugin system to communicate between | This article specifies the messages used in the Second Life Viewer media rendering plugin system. These messages are used to communicate between each plugin loader shell (PLS) and its media rendering plugin, and between each PLS and the Viewer. | ||
=== Message categories === | === Message categories === | ||
Line 25: | Line 22: | ||
* '''[[#Base_messages|Base messages]]''' for initialization, connection management, and shared memory setup. All plugins must implement these basic messages. | * '''[[#Base_messages|Base messages]]''' for initialization, connection management, and shared memory setup. All plugins must implement these basic messages. | ||
* '''[[#Media messages|Media messages]]''' for negotiating the pixel buffer and handling updates of subsections of it, specifying a media source URL, and passing mouse and keyboard events. All media rendering plugins must implement these messages. | |||
* '''[[#Media_browser_messages|Time-based media messages]]''' for functions such as play, pause, stop, seek, and so on. All time-based media (video-like) rendering plugins must implement these messages. | |||
* '''[[#Media_time_messages|Browser-like media messages]]''' for functions such as forward, back, reload, and so on. All browser-like media rendering plugins must implement these messages. | |||
* '''[[ | * '''[[#Internal system messages|Internal system messages]]''' for communication between the viewer and the plugin loader shell. These messages are not delivered to a plugin. Plugin developers need not be concerned with them; their documentation is provided for Viewer developers. | ||
== Base messages == | == Base messages == | ||
All plugins need to handle these messages. | All plugins need to handle these messages. | ||
=== Messages the plugin | === Messages from the PLS to the plugin === | ||
==== init ==== | ==== init ==== | ||
Line 73: | Line 40: | ||
==== idle ==== | ==== idle ==== | ||
Call-in for plugin to do processing | Call-in for plugin to do processing. No response required. | ||
'''Parameters''' | '''Parameters''' | ||
Line 85: | Line 52: | ||
|-- | |-- | ||
| time | | time | ||
| | | Real | ||
| | | Interval (in seconds) at which idle messages are sent. | ||
|} | |} | ||
Line 92: | Line 59: | ||
The plugin is about to be unloaded, and should perform any cleanup it needs to do beforehand. | The plugin is about to be unloaded, and should perform any cleanup it needs to do beforehand. | ||
'''No parameters'''. | |||
==== shm_added ==== | ==== shm_added ==== | ||
Line 106: | Line 75: | ||
|-- | |-- | ||
| name | | name | ||
| | | String | ||
| | | Supplied to the plugin by the Viewer. Human-readable; plugin should not try to change. | ||
|-- | |-- | ||
| size | | size | ||
| | | Integer | ||
| | | Size of segment in bytes. | ||
|-- | |-- | ||
| address | | address | ||
| | | String | ||
| Since this is going from the PLS to the plugin (not crossing a process boundary), | | Since this is going from the PLS to the plugin (not crossing a process boundary), | ||
the pointer will actually be valid. LLSD doesn't have an encoding for a pointer (or even an unsigned 32 bit value), | the pointer will actually be valid. LLSD doesn't have an encoding for a pointer (or even an unsigned 32 bit value), | ||
so this will be the pointer | so this will be the full pointer (either 32 or 64 bits, depending on the pointer size of the platform) as a hexadecimal string. | ||
|} | |} | ||
==== shm_remove ==== | ==== shm_remove ==== | ||
PLS will remove the shared memory segment will be removed when plugin responds with [[#shm_remove_response|shm_remove_response]]. | PLS will remove the shared memory segment. The segment will be effectively removed when plugin responds with [[#shm_remove_response|shm_remove_response]]. | ||
'''Parameters''' | '''Parameters''' | ||
Line 140: | Line 110: | ||
|} | |} | ||
=== Messages the plugin | === Messages from the plugin to the PLS === | ||
==== init_response ==== | ==== init_response ==== | ||
Line 188: | Line 158: | ||
== Media messages == | == Media messages == | ||
=== Messages the plugin | === Messages from the PLS to the plugin === | ||
==== load_uri ==== | ==== load_uri ==== | ||
Tells the plugin to load the specified URI. | |||
'''Parameters''' | '''Parameters''' | ||
Line 207: | Line 179: | ||
==== key_event ==== | ==== key_event ==== | ||
Simulates the user pressing a key on the keyboard. | |||
'''Parameters''' | '''Parameters''' | ||
Line 232: | Line 206: | ||
| modifiers | | modifiers | ||
| String | | String | ||
| Contains zero or more of the following, concatenated together with '|' characters in between. There may be a spurious trailing '|'. | | Contains zero or more of the following, concatenated together with <nowiki>'|'</nowiki> characters in between. There may be a spurious trailing <nowiki>'|'</nowiki>. | ||
* control | * control | ||
* alt -- the 'option' key on the mac | * alt -- the 'option' key on the mac | ||
Line 256: | Line 230: | ||
| String | | String | ||
| Encoded in utf8 | | Encoded in utf8 | ||
|-- | |||
| modifiers | |||
| String | |||
| Contains zero or more of the following, concatenated together with <nowiki>'|'</nowiki> characters in between. There may be a spurious trailing <nowiki>'|'</nowiki>. | |||
* control | |||
* alt -- the 'option' key on the mac | |||
* shift | |||
* meta -- the 'command' key on the mac | |||
|} | |} | ||
==== mouse_event ==== | ==== mouse_event ==== | ||
Line 287: | Line 270: | ||
| Integer | | Integer | ||
| Y-coordinate in texture space (taking into account whether vertical flip was requested or not). | | Y-coordinate in texture space (taking into account whether vertical flip was requested or not). | ||
|-- | |||
| button | |||
| Integer | |||
| Mouse button number associated with this event. If this parameter is not present, assume the left button. | |||
* 0 -- left button | |||
* 1 -- right button | |||
* 2 -- middle button | |||
* higher numbers are not specifically assigned | |||
|-- | |-- | ||
| modifiers | | modifiers | ||
| | | String | ||
| Contains zero or more of the following, concatenated together with '|' characters in between. There may be a spurious trailing '|'. | | Contains zero or more of the following, concatenated together with <nowiki>'|'</nowiki> characters in between. There may be a spurious trailing <nowiki>'|'</nowiki>. | ||
* control | * control | ||
* alt -- the 'option' key on the mac | * alt -- the 'option' key on the mac | ||
Line 312: | Line 304: | ||
|x | |x | ||
|Integer | |Integer | ||
| x- | | x-horizontal scroll steps | ||
|-- | |-- | ||
| y | | y | ||
| Integer | | Integer | ||
| Y- | | Y-vertical scroll steps | ||
|-- | |-- | ||
| modifiers | | modifiers | ||
| | | String | ||
| Contains zero or more of the following, concatenated together with '|' characters in between. There may be a spurious trailing '|'. | | Contains zero or more of the following, concatenated together with <nowiki>'|'</nowiki> characters in between. There may be a spurious trailing <nowiki>'|'</nowiki>. | ||
* control | * control | ||
* alt -- the 'option' key on the mac | * alt -- the 'option' key on the mac | ||
Line 343: | Line 335: | ||
|-- | |-- | ||
| width | | width | ||
| | | Integer | ||
| | | Width in pixels; size at which the plugin is expected to render | ||
|-- | |-- | ||
| height | | height | ||
| | | Integer | ||
| | | Height in pixels | ||
|-- | |-- | ||
| texture_width | | texture_width | ||
| | | Integer | ||
| | | Width of texture in pixels; Number of pixesl in the buffer its being asked to draw into. May be larger than width parameter value. | ||
|-- | |-- | ||
| texture_height | | texture_height | ||
| | | Integer | ||
| | | Height of texture in pixels; Number of pixesl in the buffer its being asked to draw into. May be larger than height parameter value. | ||
|-- | |-- | ||
| name | | name | ||
| String | | String | ||
| Name of the shared memory segment the texture will draw into. | | Name of the shared memory segment the texture will draw into. Matches with the name in an shm_added. | ||
|} | |} | ||
Line 387: | Line 378: | ||
* stopped: media is not playing, shouldn't need to update at all | * stopped: media is not playing, shouldn't need to update at all | ||
* hidden: media is not being displayed or is out of view, don't need to do graphic updates, but may still update audio, playhead, etc. | * hidden: media is not being displayed or is out of view, don't need to do graphic updates, but may still update audio, playhead, etc. | ||
* slideshow: media is being displayed, but is being severely throttled to reduce resource usage | |||
* low: media is in the far distance, may be rendered at reduced size | * low: media is in the far distance, may be rendered at reduced size | ||
* normal: default priority | * normal: default priority | ||
Line 410: | Line 402: | ||
'''No parameters''' | '''No parameters''' | ||
=== Messages the plugin | === Messages from the plugin to the PLS === | ||
==== texture_params ==== | ==== texture_params ==== | ||
Line 424: | Line 416: | ||
|-- | |-- | ||
| default_width | | default_width | ||
| | | Integer | ||
| Optional. Default width for the texture. | | Optional. Default width for the texture. | ||
|-- | |-- | ||
| default_height | | default_height | ||
| | | Integer | ||
| Optional. Default height for the texture. | | Optional. Default height for the texture. | ||
|-- | |-- | ||
| depth | | depth | ||
| | | Integer | ||
| Pixel size in bytes. | | Pixel size in bytes. Although the the format and type parameters completely determine the pixel size, deriving it is complex. Thus, the plugin must provide the value to the host. | ||
|-- | |-- | ||
| internalformat | | internalformat | ||
| String | | String | ||
| Texture internal format for glTexImage2D. The value is a string containing hexadecimal digits, | | Texture internal format for glTexImage2D. The value is a string containing hexadecimal digits, (for example, "0xDEADBEEF") representing a GLint. See [[#GL_params|Note on OpenGL parameters]]. | ||
|-- | |-- | ||
| format | | format | ||
| String | | String | ||
| Texture format for glTexImage2D. The value is a string containing hexadecimal digits, | | Texture format for glTexImage2D. The value is a string containing hexadecimal digits, (for example, "0xDEADBEEF") representing a GLenum. See [[#GL_params|Note on OpenGL parameters]]. | ||
|-- | |-- | ||
|type | | type | ||
| String | | String | ||
| Texture type for glTexImage2D. The value is a string containing hexadecimal digits, | | Texture type for glTexImage2D. The value is a string containing hexadecimal digits, (for example, "0xDEADBEEF") representing a GLenum. See [[#GL_params|Note on OpenGL parameters]]. | ||
|-- | |-- | ||
| swap_bytes | | swap_bytes | ||
| Boolean | | Boolean | ||
| Optional. True if the host should use glPixelStorei(GL_UNPACK_SWAP_BYTES, 1) when loading the data. If not specified, defaults to false. | | Optional. True if the host should use <code>glPixelStorei(GL_UNPACK_SWAP_BYTES, 1)</code> when loading the data. If not specified, defaults to false. | ||
|-- | |-- | ||
| coords_opengl | | coords_opengl | ||
| Boolean | | Boolean | ||
| True if the plugin wants to work in OpenGL coordinates (where (0,0) is the lower left corner of the texture) | | True if the plugin wants to work in OpenGL coordinates (where (0,0) is the lower left corner of the texture); false to work in a coordinate system where (0,0) is the upper left. | ||
|-- | |-- | ||
| allow_downsample | | allow_downsample | ||
| Boolean | | Boolean | ||
| Optional. If true, the host may negotiate a smaller texture when the plugin's priority is reduced. The plugin should not set this if downscaling the media is more expensive than drawing it at native size | | Optional. If true, the host may negotiate a smaller texture when the plugin's priority is reduced. The plugin should not set this if downscaling the media is more expensive than drawing it at native size. | ||
If the plugin sets the allow_downsample field in the [[#texture_params|texture_params]] message and the media's priority has been lowered, the host may reduce the requested draw dimensions. | |||
* The plugin should only set allow_downsample if it can draw the media at different scales without changing the overall look of the media, such as scaling down a video stream | |||
* Media that looks different when drawn at different pixel scales (such as a web browser where font sizes depend on pixel scale) should NOT set allow_downsample | |||
* If it's more expensive to draw media downsampled than at native resolution, the plugin should NOT set allow_downsample: it's supposed to be a way to reduce load on the system, and if it doesn't accomplish that it shouldn't be used. | |||
|-- | |-- | ||
| padding | | padding | ||
| | | Integer | ||
| Optional. Specifies how the rows of the texture should be padded. Useful values: | | Optional. Specifies how the rows of the texture should be padded. Useful values: | ||
* 0 (the default) -- no padding is added | * 0 (the default) -- no padding is added | ||
Line 478: | Line 471: | ||
* 16 -- start each row on a 16 byte boundary -- NOTE: may not work correctly with odd-sized pixels like GL_RGB | * 16 -- start each row on a 16 byte boundary -- NOTE: may not work correctly with odd-sized pixels like GL_RGB | ||
* 32 -- start each row on a 32 byte boundary -- NOTE: may not work correctly with odd-sized pixels like GL_RGB | * 32 -- start each row on a 32 byte boundary -- NOTE: may not work correctly with odd-sized pixels like GL_RGB | ||
'''NOTE:''' It is possible to request pixel size/alignment combinations that don't come out even when using 3-byte RGB pixels. If the host detects this, it will disable padding. | |||
|} | |} | ||
<span id="GL_params"></span>'''Note on OpenGL parameters''': The hexadecimal GLint and GLenum values used for internalformat, format and type are set by the OpenGL, so passing them across process boundaries is generally safe. | |||
==== updated==== | ==== updated==== | ||
Specifies the update rectangle; the coordinates are specified within the buffer in which the media is being drawn. The coords_opengl flag in [[#texture_params|texture_params]] message specifies how coordinatess are interpreted. | |||
'''Parameters''' | '''Parameters''' | ||
Line 493: | Line 491: | ||
|-- | |-- | ||
| left | | left | ||
| | | Integer | ||
| | | Left x-coordinate of the update rectangle. | ||
|-- | |-- | ||
| top | | top | ||
| | | Integer | ||
| | | Top y-coordinate of the update rectangle. | ||
|-- | |-- | ||
| right | | right | ||
| | | Integer | ||
| | | Right x-coordinate of the update rectangle. | ||
|-- | |-- | ||
| bottom | | bottom | ||
| | | Integer | ||
| | | Bottom y-coordinate of the update rectangle. | ||
|-- | |-- | ||
| current_time | | current_time | ||
Line 520: | Line 518: | ||
| current_rate | | current_rate | ||
| Real | | Real | ||
| Rate at which the media is currently playing. | | Optional. Rate at which the media is currently playing. | ||
|-- | |||
| loaded_duration | |||
| Real | |||
| Optional. For media that is partially loaded, the duration through which the media could currently play or seek. For media which can't be loaded incrementally, either omit this parameter or set it to the same value as 'duration'. | |||
|} | |} | ||
==== media_status==== | ==== media_status==== | ||
Plugin describing the state to the PLS. | |||
'''Parameters''' | '''Parameters''' | ||
Line 543: | Line 548: | ||
* playing -- playing (only for time-based media) | * playing -- playing (only for time-based media) | ||
* paused -- paused (only for time-based media) | * paused -- paused (only for time-based media) | ||
|} | |||
==== name_text==== | |||
Specifies a name for the media being displayed. | |||
'''Parameters''' | |||
{| class="lltable" border="1" | |||
|-- | |||
!Key | |||
!Type | |||
!Description | |||
|-- | |||
| name | |||
| String | |||
| The name of the media. Typically the <code><title></code> tag in a Web page or the name in time based media. | |||
|} | |} | ||
Line 548: | Line 572: | ||
==== size_change_request ==== | ==== size_change_request ==== | ||
Indicates the stream wants to change its native size. | |||
'''Parameters''' | '''Parameters''' | ||
Line 560: | Line 584: | ||
|-- | |-- | ||
| width | | width | ||
| | | Integer | ||
| | | Desired width in pixels. | ||
|-- | |-- | ||
| height | | height | ||
| | | Integer | ||
| | | Desired height in pixels. | ||
|-- | |-- | ||
| name | | name | ||
| String | | String | ||
| Name of the shared memory segment the texture will draw into. This may induce the host to send a size_change message. The plugin may stop drawing to the texture until an appropriate size_change message has been received. | | Name of the shared memory segment the texture will draw into. This may induce the host to send a [[#size_change|size_change]] message. The plugin may stop drawing to the texture until an appropriate size_change message has been received. | ||
|} | |} | ||
Line 577: | Line 601: | ||
Sent by the plugin in response to [[#size_change|size_change]] when the size change is complete. | Sent by the plugin in response to [[#size_change|size_change]] when the size change is complete. | ||
See [[Media_Rendering_Plugin_Operation_and_Data_Flow#Shared_memory_size_negotiation|Shared memory size negotiation]]. | |||
'''Parameters''' | '''Parameters''' | ||
Line 588: | Line 614: | ||
|-- | |-- | ||
| width | | width | ||
| | | Integer | ||
| | | Width in pixels. | ||
|-- | |-- | ||
| height | | height | ||
| | | Integer | ||
| | | Height in pixels. | ||
|-- | |-- | ||
| texture_width | | texture_width | ||
| | | Integer | ||
| | | Width of texture in pixels; Number of pixels in the buffer its being asked to draw into. May be larger than width parameter value. | ||
|-- | |-- | ||
| texture_height | | texture_height | ||
| | | Integer | ||
| | | Height of texture in pixels; Number of pixels in the buffer its being asked to draw into. May be larger than height parameter value. | ||
|-- | |-- | ||
Line 636: | Line 662: | ||
==== edit_state ==== | ==== edit_state ==== | ||
Update the state of the edit menu items in the host. | Update the state of the edit menu items in the host. Note: | ||
* Items that are not present in the update message should have their state unchanged. | |||
* All states start out false in the host. | |||
* False means the operation is not possible and the menu should be disabled. | |||
'''Parameters''' | '''Parameters''' | ||
Line 649: | Line 679: | ||
| cut | | cut | ||
| Boolean | | Boolean | ||
| | | Optional. | ||
|-- | |-- | ||
| copy | | copy | ||
| Boolean | | Boolean | ||
| | | Optional. | ||
|-- | |-- | ||
| paste | | paste | ||
| Boolean | | Boolean | ||
| | | Optional. | ||
|} | |} | ||
== Media_browser messages == | == Media_browser messages == | ||
=== Messages the plugin | === Messages from the PLS to the plugin === | ||
==== focus ==== | ==== focus ==== | ||
Give the plugin focus. | |||
'''Parameters''' | '''Parameters''' | ||
Line 683: | Line 711: | ||
| focused | | focused | ||
| Boolean | | Boolean | ||
| | | True to give the plugin instance focus. | ||
|} | |} | ||
==== clear_cache ==== | ==== clear_cache ==== | ||
Clear any cache that the plugin maintains. | |||
'''No Parameters'''. | '''No Parameters'''. | ||
==== clear_cookies ==== | ==== clear_cookies ==== | ||
Clear any cookies that the plugin maintains. | |||
'''No Parameters'''. | '''No Parameters'''. | ||
==== enable_cookies ==== | ==== enable_cookies ==== | ||
Enable or disable use of cookies. | |||
'''Parameters''' | '''Parameters''' | ||
Line 711: | Line 745: | ||
==== proxy_setup ==== | ==== proxy_setup ==== | ||
Use a proxy and specify proxy settings. | |||
'''Parameters''' | '''Parameters''' | ||
Line 722: | Line 759: | ||
| enable | | enable | ||
|Boolean | |Boolean | ||
| | | Set to tru to enable using the spedcified proxy server. | ||
|--- | |--- | ||
| host | | host | ||
| String | | String | ||
| | | Hostname of the proxy. | ||
|--- | |--- | ||
| port | | port | ||
| | | Integer | ||
| | | TCP port to use. | ||
|} | |} | ||
Line 740: | Line 777: | ||
==== browse_reload ==== | ==== browse_reload ==== | ||
Reload the media stream. | |||
'''Parameters''' | '''Parameters''' | ||
Line 774: | Line 814: | ||
|--- | |--- | ||
| code | | code | ||
| | | Integer | ||
| The HTTP status code on which to redirect (currently, only | | The HTTP status code on which to redirect (currently, only 404). | ||
|--- | |--- | ||
Line 798: | Line 838: | ||
|} | |} | ||
=== Messages the plugin | === Messages from the plugin to the PLS === | ||
Line 834: | Line 874: | ||
|--- | |--- | ||
| result_code | | result_code | ||
| | | Integer | ||
| For example, 200, 404. | | For example, 200, 404. | ||
Line 846: | Line 886: | ||
| Boolean | | Boolean | ||
| True if the "back" button should be enabled | | True if the "back" button should be enabled | ||
|--- | |--- | ||
| history_forward_available | | history_forward_available | ||
Line 863: | Line 904: | ||
|--- | |--- | ||
| percent | | percent | ||
| | | Integer | ||
| Percent of page load that has completed | | Percent of page load that has completed; between zero (0) and 100, inclusive. | ||
|} | |} | ||
Line 902: | Line 943: | ||
==== click_href ==== | ==== click_href ==== | ||
Occurs when the user clicks on a link. | |||
'''Parameters''' | '''Parameters''' | ||
Line 941: | Line 984: | ||
== Media_time messages == | == Media_time messages == | ||
=== Messages the plugin | === Messages from the PLS to the plugin === | ||
==== stop ==== | ==== stop ==== | ||
Line 981: | Line 1,024: | ||
| time | | time | ||
| Real | | Real | ||
| | | The point in the stream to Time in seconds. Host will know the duration of the media from the [#updated|updated] message. | ||
|} | |} | ||
Line 1,010: | Line 1,053: | ||
| volume | | volume | ||
| Real | | Real | ||
| | | Muted is zero (0) and full volume is 1.0. | ||
|} | |} |
Latest revision as of 13:34, 4 May 2011
Overview
This article specifies the messages used in the Second Life Viewer media rendering plugin system. These messages are used to communicate between each plugin loader shell (PLS) and its media rendering plugin, and between each PLS and the Viewer.
Message categories
Messages fall into these general categories:
- Base messages for initialization, connection management, and shared memory setup. All plugins must implement these basic messages.
- Media messages for negotiating the pixel buffer and handling updates of subsections of it, specifying a media source URL, and passing mouse and keyboard events. All media rendering plugins must implement these messages.
- Time-based media messages for functions such as play, pause, stop, seek, and so on. All time-based media (video-like) rendering plugins must implement these messages.
- Browser-like media messages for functions such as forward, back, reload, and so on. All browser-like media rendering plugins must implement these messages.
- Internal system messages for communication between the viewer and the plugin loader shell. These messages are not delivered to a plugin. Plugin developers need not be concerned with them; their documentation is provided for Viewer developers.
Base messages
All plugins need to handle these messages.
Messages from the PLS to the plugin
init
Initialization message the PLS sends. Plugin responds with init_response.
No parameters.
idle
Call-in for plugin to do processing. No response required.
Parameters
Key | Type | Description |
---|---|---|
time | Real | Interval (in seconds) at which idle messages are sent. |
cleanup
The plugin is about to be unloaded, and should perform any cleanup it needs to do beforehand.
No parameters.
shm_added
Shared memory segment has been set up.
Parameters
Key | Type | Description |
---|---|---|
name | String | Supplied to the plugin by the Viewer. Human-readable; plugin should not try to change. |
size | Integer | Size of segment in bytes. |
address | String | Since this is going from the PLS to the plugin (not crossing a process boundary),
the pointer will actually be valid. LLSD doesn't have an encoding for a pointer (or even an unsigned 32 bit value), so this will be the full pointer (either 32 or 64 bits, depending on the pointer size of the platform) as a hexadecimal string. |
shm_remove
PLS will remove the shared memory segment. The segment will be effectively removed when plugin responds with shm_remove_response.
Parameters
Key | Type | Description |
---|---|---|
name | String | Name of memory segment to remove. |
Messages from the plugin to the PLS
init_response
This message is the plugin's response to the init message sent by the PLS.
Parameters
Key | Type | Description |
---|---|---|
versions | Map | Lists version corresponding to each plugin class.
|
plugin_version | String | Free-form version string for the plugin. This is expected to contain the versions of libraries the plugin uses (for example, quicktime, webkit, and so on) and may end up in the Viewer's about box. |
shm_remove_response
Plugin is done with the shared memory segment, safe to delete. Plugin responds with this message when it receives a shm_remove message.
Parameters
Key | Type | Description |
---|---|---|
name | String | Name of shared memory segment to delete. |
Media messages
Messages from the PLS to the plugin
load_uri
Tells the plugin to load the specified URI.
Parameters
Key | Type | Description |
---|---|---|
uri | String | URI to load. |
key_event
Simulates the user pressing a key on the keyboard.
Parameters
Key | Type | Description |
---|---|---|
event | String | One of:
|
key | String | Platform-specific keycode |
modifiers | String | Contains zero or more of the following, concatenated together with '|' characters in between. There may be a spurious trailing '|'.
|
text_event
Text input event not associated with a single keystroke.
Parameters
Key | Type | Description |
---|---|---|
text | String | Encoded in utf8 |
modifiers | String | Contains zero or more of the following, concatenated together with '|' characters in between. There may be a spurious trailing '|'.
|
mouse_event
Parameters
Key | Type | Description |
---|---|---|
event | String | One of:
|
x | Integer | x-coordinate in texture space |
y | Integer | Y-coordinate in texture space (taking into account whether vertical flip was requested or not). |
button | Integer | Mouse button number associated with this event. If this parameter is not present, assume the left button.
|
modifiers | String | Contains zero or more of the following, concatenated together with '|' characters in between. There may be a spurious trailing '|'.
|
scroll_event
Parameters
Key | Type | Description |
---|---|---|
x | Integer | x-horizontal scroll steps |
y | Integer | Y-vertical scroll steps |
modifiers | String | Contains zero or more of the following, concatenated together with '|' characters in between. There may be a spurious trailing '|'.
|
size_change
Either host-initiated or after a request from the plugin.
Parameters
Key | Type | Description |
---|---|---|
width | Integer | Width in pixels; size at which the plugin is expected to render |
height | Integer | Height in pixels |
texture_width | Integer | Width of texture in pixels; Number of pixesl in the buffer its being asked to draw into. May be larger than width parameter value. |
texture_height | Integer | Height of texture in pixels; Number of pixesl in the buffer its being asked to draw into. May be larger than height parameter value. |
name | String | Name of the shared memory segment the texture will draw into. Matches with the name in an shm_added. |
set_priority
Tells the plugin its relative priority.
Parameters
Key | Type | Description |
---|---|---|
priority | String | One of:
|
edit_cut
Perform an edit-menu "cut" operation to the system clipboard.
No parameters
edit_copy
Perform an edit-menu "copy" operation to the system clipboard.
No parameters
edit_paste
Perform an edit-menu "paste" operation from the system clipboard.
No parameters
Messages from the plugin to the PLS
texture_params
Parameters
Key | Type | Description |
---|---|---|
default_width | Integer | Optional. Default width for the texture. |
default_height | Integer | Optional. Default height for the texture. |
depth | Integer | Pixel size in bytes. Although the the format and type parameters completely determine the pixel size, deriving it is complex. Thus, the plugin must provide the value to the host. |
internalformat | String | Texture internal format for glTexImage2D. The value is a string containing hexadecimal digits, (for example, "0xDEADBEEF") representing a GLint. See Note on OpenGL parameters. |
format | String | Texture format for glTexImage2D. The value is a string containing hexadecimal digits, (for example, "0xDEADBEEF") representing a GLenum. See Note on OpenGL parameters. |
type | String | Texture type for glTexImage2D. The value is a string containing hexadecimal digits, (for example, "0xDEADBEEF") representing a GLenum. See Note on OpenGL parameters. |
swap_bytes | Boolean | Optional. True if the host should use glPixelStorei(GL_UNPACK_SWAP_BYTES, 1) when loading the data. If not specified, defaults to false.
|
coords_opengl | Boolean | True if the plugin wants to work in OpenGL coordinates (where (0,0) is the lower left corner of the texture); false to work in a coordinate system where (0,0) is the upper left. |
allow_downsample | Boolean | Optional. If true, the host may negotiate a smaller texture when the plugin's priority is reduced. The plugin should not set this if downscaling the media is more expensive than drawing it at native size.
If the plugin sets the allow_downsample field in the texture_params message and the media's priority has been lowered, the host may reduce the requested draw dimensions.
|
padding | Integer | Optional. Specifies how the rows of the texture should be padded. Useful values:
NOTE: It is possible to request pixel size/alignment combinations that don't come out even when using 3-byte RGB pixels. If the host detects this, it will disable padding. |
Note on OpenGL parameters: The hexadecimal GLint and GLenum values used for internalformat, format and type are set by the OpenGL, so passing them across process boundaries is generally safe.
updated
Specifies the update rectangle; the coordinates are specified within the buffer in which the media is being drawn. The coords_opengl flag in texture_params message specifies how coordinatess are interpreted.
Parameters
Key | Type | Description |
---|---|---|
left | Integer | Left x-coordinate of the update rectangle. |
top | Integer | Top y-coordinate of the update rectangle. |
right | Integer | Right x-coordinate of the update rectangle. |
bottom | Integer | Bottom y-coordinate of the update rectangle. |
current_time | Real | Optional. Current playhead time in seconds. |
duration | Real | Optional. Total duration of the media in seconds |
current_rate | Real | Optional. Rate at which the media is currently playing. |
loaded_duration | Real | Optional. For media that is partially loaded, the duration through which the media could currently play or seek. For media which can't be loaded incrementally, either omit this parameter or set it to the same value as 'duration'. |
media_status
Plugin describing the state to the PLS.
Parameters
Key | Type | Description |
---|---|---|
status | String | One of:
|
name_text
Specifies a name for the media being displayed.
Parameters
Key | Type | Description |
---|---|---|
name | String | The name of the media. Typically the <title> tag in a Web page or the name in time based media.
|
size_change_request
Indicates the stream wants to change its native size.
Parameters
Key | Type | Description |
---|---|---|
width | Integer | Desired width in pixels. |
height | Integer | Desired height in pixels. |
name | String | Name of the shared memory segment the texture will draw into. This may induce the host to send a size_change message. The plugin may stop drawing to the texture until an appropriate size_change message has been received. |
size_change_response
Sent by the plugin in response to size_change when the size change is complete.
See Shared memory size negotiation.
Parameters
Key | Type | Description |
---|---|---|
width | Integer | Width in pixels. |
height | Integer | Height in pixels. |
texture_width | Integer | Width of texture in pixels; Number of pixels in the buffer its being asked to draw into. May be larger than width parameter value. |
texture_height | Integer | Height of texture in pixels; Number of pixels in the buffer its being asked to draw into. May be larger than height parameter value. |
name | String | Name of the shared memory segment the texture will draw into |
cursor_changed
Parameters
Key | Type | Description |
---|---|---|
name | String | One of:
|
edit_state
Update the state of the edit menu items in the host. Note:
- Items that are not present in the update message should have their state unchanged.
- All states start out false in the host.
- False means the operation is not possible and the menu should be disabled.
Parameters
Key | Type | Description |
---|---|---|
cut | Boolean | Optional. |
copy | Boolean | Optional. |
paste | Boolean | Optional. |
Media_browser messages
Messages from the PLS to the plugin
focus
Give the plugin focus.
Parameters
Key | Type | Description |
---|---|---|
focused | Boolean | True to give the plugin instance focus. |
clear_cache
Clear any cache that the plugin maintains.
No Parameters.
clear_cookies
Clear any cookies that the plugin maintains.
No Parameters.
enable_cookies
Enable or disable use of cookies.
Parameters
Key | Type | Description |
---|---|---|
enable | Boolean | Whether to enable cookies. |
proxy_setup
Use a proxy and specify proxy settings.
Parameters
Key | Type | Description |
---|---|---|
enable | Boolean | Set to tru to enable using the spedcified proxy server. |
host | String | Hostname of the proxy. |
port | Integer | TCP port to use. |
browse_stop
No Parameters.
browse_reload
Reload the media stream.
Parameters
Key | Type | Description |
---|---|---|
ignore_cache | Boolean | If true, bypass cache for this reload. |
browse_forward
No Parameters.
browse_back
No Parameters.
set_status_redirect
Parameters
Key | Type | Description |
---|---|---|
code | Integer | The HTTP status code on which to redirect (currently, only 404). |
url | String | URL to which to redirect. |
init_history
Parameters
Key | Type | Description |
---|---|---|
history | Array of strings | Array of string URIs to add to the browser history. |
Messages from the plugin to the PLS
Parameters
Key | Type | Description |
---|---|---|
uri | String | URI to which the browser is navigating. |
Parameters
Key | Type | Description |
---|---|---|
uri | String | URI to which the browser was navigating. |
result_code | Integer | For example, 200, 404. |
result_string | String | "OK", "Not Found", etc. |
history_back_available | Boolean | True if the "back" button should be enabled |
history_forward_available | Boolean | True if the "forward" button should be enabled |
progress
Parameters
Key | Type | Description |
---|---|---|
percent | Integer | Percent of page load that has completed; between zero (0) and 100, inclusive. |
status_text
Parameters
Key | Type | Description |
---|---|---|
status | String | New browser status string. |
location_changed
Parameters
Key | Type | Description |
---|---|---|
uri | String | New browser URI for the navigation bar. |
click_href
Occurs when the user clicks on a link.
Parameters
Key | Type | Description |
---|---|---|
uri | String | URI of the link. |
target | String | Target property of the link. |
click_nofollow
Parameters
Key | Type | Description |
---|---|---|
uri | String | URI of the link. |
Media_time messages
Messages from the PLS to the plugin
stop
No parameters.
start
Key | Type | Description |
---|---|---|
rate | Real | Optional. Rate to play at:
|
pause
No parameters.
seek
Key | Type | Description |
---|---|---|
time | Real | updated] message. |
set_loop
Key | Type | Description |
---|---|---|
loop | Boolean | True to make the media loop, false to make it play once. |
set_volume
Key | Type | Description |
---|---|---|
volume | Real | Muted is zero (0) and full volume is 1.0. |