mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2025-06-28 12:19:54 +00:00
Updated contraints def code to allow share screen
Updated "constraints" Variable to "DisplayMediaStreamConstraints" (Uncommented code) Updated to include system audio (Uncommented code) Added link to Browser compatability API webdoc
This commit is contained in:
parent
27896f18b7
commit
d3ce48afa4
1 changed files with 5 additions and 5 deletions
|
@ -1379,11 +1379,11 @@ const processCommand = (function () {
|
|||
async function getLocalMediaStream(mic: boolean, camera: boolean, facingMode: VideoCamera): Promise<MediaStream> {
|
||||
if (!mic && !camera) return new MediaStream()
|
||||
const constraints = callMediaConstraints(mic, camera, facingMode)
|
||||
return await navigator.mediaDevices.getDisplayMedia(constraints)
|
||||
return await navigator.mediaDevices.getDisplayMedia(DisplayMediaStreamConstraints)
|
||||
}
|
||||
|
||||
function getLocalScreenCaptureStream(): Promise<MediaStream> {
|
||||
const constraints: any /* DisplayMediaStreamConstraints */ = {
|
||||
const DisplayMediaStreamConstraints = {
|
||||
video: {
|
||||
frameRate: 24,
|
||||
//width: {
|
||||
|
@ -1394,10 +1394,10 @@ const processCommand = (function () {
|
|||
//aspectRatio: 1.33,
|
||||
},
|
||||
audio: allowSendScreenAudio,
|
||||
// This works with Chrome, Edge, Opera, but not with Firefox and Safari
|
||||
// systemAudio: "include"
|
||||
// This works with Chrome, Edge, Opera, but not with Firefox and Safari (https://developer.mozilla.org/en-US/docs/Web/API/Screen_Capture_API/Using_Screen_Capture#browser_compatibility)
|
||||
systemAudio: "include"
|
||||
}
|
||||
return navigator.mediaDevices.getDisplayMedia(constraints)
|
||||
return navigator.mediaDevices.getDisplayMedia(DisplayMediaStreamConstraints)
|
||||
}
|
||||
|
||||
async function browserHasCamera(): Promise<boolean> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue