diff options
author | Martin Stransky <stransky@redhat.com> | 2020-11-12 14:33:57 +0100 |
---|---|---|
committer | Martin Stransky <stransky@redhat.com> | 2020-11-12 14:33:57 +0100 |
commit | d6756537dd8cf4d9816dc63ada66ea026e0fd128 (patch) | |
tree | 73822a6950c9dc87de309cccda7234e40a4f9fa4 /pw7.patch | |
parent | changelog date fix (diff) | |
download | librewolf-fedora-ff-d6756537dd8cf4d9816dc63ada66ea026e0fd128.tar.gz librewolf-fedora-ff-d6756537dd8cf4d9816dc63ada66ea026e0fd128.tar.bz2 librewolf-fedora-ff-d6756537dd8cf4d9816dc63ada66ea026e0fd128.zip |
Updated to 83.0, Updated PipeWire patches from mozbz#1672944
Diffstat (limited to 'pw7.patch')
-rw-r--r-- | pw7.patch | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/pw7.patch b/pw7.patch new file mode 100644 index 0000000..db75dea --- /dev/null +++ b/pw7.patch @@ -0,0 +1,95 @@ +diff --git a/browser/actors/WebRTCParent.jsm b/browser/actors/WebRTCParent.jsm +--- a/browser/actors/WebRTCParent.jsm ++++ b/browser/actors/WebRTCParent.jsm +@@ -756,6 +756,8 @@ + ); + menupopup.appendChild(doc.createXULElement("menuseparator")); + ++ let isPipeWire = false; ++ + // Build the list of 'devices'. + let monitorIndex = 1; + for (let i = 0; i < devices.length; ++i) { +@@ -783,6 +785,7 @@ + // Don't mark it as scary as there's an extra confirmation step by + // PipeWire portal dialog. + if (name == PIPEWIRE_PORTAL_NAME && device.id == PIPEWIRE_ID) { ++ isPipeWire = true; + let sawcStringId = "getUserMedia.sharePipeWirePortal.label"; + let item = addDeviceToList( + menupopup, +@@ -908,39 +911,41 @@ + perms.EXPIRE_SESSION + ); + +- video.deviceId = deviceId; +- let constraints = { +- video: { mediaSource: type, deviceId: { exact: deviceId } }, +- }; +- chromeWin.navigator.mediaDevices.getUserMedia(constraints).then( +- stream => { +- if (video.deviceId != deviceId) { +- // The user has selected a different device or closed the panel +- // before getUserMedia finished. +- stream.getTracks().forEach(t => t.stop()); +- return; ++ if (!isPipeWire) { ++ video.deviceId = deviceId; ++ let constraints = { ++ video: { mediaSource: type, deviceId: { exact: deviceId } }, ++ }; ++ chromeWin.navigator.mediaDevices.getUserMedia(constraints).then( ++ stream => { ++ if (video.deviceId != deviceId) { ++ // The user has selected a different device or closed the panel ++ // before getUserMedia finished. ++ stream.getTracks().forEach(t => t.stop()); ++ return; ++ } ++ video.srcObject = stream; ++ video.stream = stream; ++ doc.getElementById("webRTC-preview").hidden = false; ++ video.onloadedmetadata = function(e) { ++ video.play(); ++ }; ++ }, ++ err => { ++ if ( ++ err.name == "OverconstrainedError" && ++ err.constraint == "deviceId" ++ ) { ++ // Window has disappeared since enumeration, which can happen. ++ // No preview for you. ++ return; ++ } ++ Cu.reportError( ++ `error in preview: ${err.message} ${err.constraint}` ++ ); + } +- video.srcObject = stream; +- video.stream = stream; +- doc.getElementById("webRTC-preview").hidden = false; +- video.onloadedmetadata = function(e) { +- video.play(); +- }; +- }, +- err => { +- if ( +- err.name == "OverconstrainedError" && +- err.constraint == "deviceId" +- ) { +- // Window has disappeared since enumeration, which can happen. +- // No preview for you. +- return; +- } +- Cu.reportError( +- `error in preview: ${err.message} ${err.constraint}` +- ); +- } +- ); ++ ); ++ } + }; + menupopup.addEventListener("command", menupopup._commandEventListener); + } + |