NPAPI:AudioControl: Difference between revisions
(On the mailing list I suggested that if this is needed it can be proposed at a later time) |
(Clarify the value is a pointer to a bool) |
||
Line 24: | Line 24: | ||
</pre> | </pre> | ||
This NPPVariable, when set via NPN_SetValue, will let the plugin instance signal via a BOOL if the current instance is currently playing audio. | This NPPVariable, when set via NPN_SetValue, will let the plugin instance signal via a pointer to a BOOL if the current instance is currently playing audio. | ||
== Mute/Unmute a plugin instance == | == Mute/Unmute a plugin instance == | ||
Line 32: | Line 32: | ||
</pre> | </pre> | ||
This NPNVariable, when set via NPP_SetValue, will let the browser notify the plugin that it should mute audio for the current plugin instance. | This NPNVariable, when set via NPP_SetValue, will let the browser notify the plugin that it should mute audio for the current plugin instance. The value will be a pointer to a BOOL. |
Revision as of 17:15, 10 June 2015
Status
Drafting.
Contributors
- Last modified: June 1, 2015
- Authors: Kyle Huey (Mozilla), Benoit Girard (Mozilla)
- Contributors:
Changes
Modified in 2015 to be a push API instead of a pull API and to use Get/SetValue.
Use case
The ability to mute/unmute tabs or determine which tabs are playing audio is a commonly requested feature in web browsers. This specification allows browsers to mute/unmute instances of cooperating plugins and determine which instances are playing audio. Browsers can use these APIs to implement per-tab audio control.
Proposed Specification
Determine if an instance is playing audio
NPPVpluginIsPlayingAudio = 4000
This NPPVariable, when set via NPN_SetValue, will let the plugin instance signal via a pointer to a BOOL if the current instance is currently playing audio.
Mute/Unmute a plugin instance
NPNVmuteAudioBool = 4000
This NPNVariable, when set via NPP_SetValue, will let the browser notify the plugin that it should mute audio for the current plugin instance. The value will be a pointer to a BOOL.