mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1180824 - Implement media playback events for browser-element / Graphene. r=fabrice
This commit is contained in:
parent
e0404d2093
commit
d78efaf293
@ -55,6 +55,7 @@ let CERTIFICATE_ERROR_PAGE_PREF = 'security.alternate_certificate_error_page';
|
||||
|
||||
const OBSERVED_EVENTS = [
|
||||
'xpcom-shutdown',
|
||||
'media-playback',
|
||||
'activity-done'
|
||||
];
|
||||
|
||||
@ -279,14 +280,22 @@ BrowserElementChild.prototype = {
|
||||
observe: function(subject, topic, data) {
|
||||
// Ignore notifications not about our document. (Note that |content| /can/
|
||||
// be null; see bug 874900.)
|
||||
if (topic !== 'activity-done' && (!content || subject != content.document))
|
||||
|
||||
if (topic !== 'activity-done' && topic !== 'media-playback' &&
|
||||
(!content || subject !== content.document)) {
|
||||
return;
|
||||
}
|
||||
if (topic == 'activity-done' && docShell !== subject)
|
||||
return;
|
||||
switch (topic) {
|
||||
case 'activity-done':
|
||||
sendAsyncMsg('activitydone', { success: (data == 'activity-success') });
|
||||
break;
|
||||
case 'media-playback':
|
||||
if (subject === content) {
|
||||
sendAsyncMsg('mediaplaybackchange', { _payload_: data });
|
||||
}
|
||||
break;
|
||||
case 'xpcom-shutdown':
|
||||
this._shuttingDown = true;
|
||||
break;
|
||||
|
@ -215,6 +215,7 @@ BrowserElementParent.prototype = {
|
||||
};
|
||||
|
||||
let mmSecuritySensitiveCalls = {
|
||||
"mediaplaybackchange": this._fireEventFromMsg,
|
||||
"showmodalprompt": this._handleShowModalPrompt,
|
||||
"contextmenu": this._fireCtxMenuEvent,
|
||||
"securitychange": this._fireEventFromMsg,
|
||||
|
Loading…
Reference in New Issue
Block a user