Π·Π΅ΡΠΊΠ°Π»ΠΎ ΠΈΠ· https://github.com/electron/website.git
chore: update ref to docs (π€)
This commit is contained in:
Π ΠΎΠ΄ΠΈΡΠ΅Π»Ρ
0b985d88ac
ΠΠΎΠΌΠΌΠΈΡ
9869d52608
|
@ -27,7 +27,11 @@ app.whenReady().then(() => {
|
|||
// Grant access to the first screen found.
|
||||
callback({ video: sources[0], audio: 'loopback' })
|
||||
})
|
||||
})
|
||||
// If true, use the system picker if available.
|
||||
// Note: this is currently experimental. If the system picker
|
||||
// is available, it will be used and the media request handler
|
||||
// will not be invoked.
|
||||
}, { useSystemPicker: true })
|
||||
|
||||
mainWindow.loadFile('index.html')
|
||||
})
|
||||
|
|
|
@ -960,7 +960,7 @@ session.fromPartition('some-partition').setPermissionCheckHandler((webContents,
|
|||
})
|
||||
```
|
||||
|
||||
#### `ses.setDisplayMediaRequestHandler(handler)`
|
||||
#### `ses.setDisplayMediaRequestHandler(handler[, opts])`
|
||||
|
||||
* `handler` Function | null
|
||||
* `request` Object
|
||||
|
@ -987,12 +987,18 @@ session.fromPartition('some-partition').setPermissionCheckHandler((webContents,
|
|||
and this is set to `true`, then local playback of audio will not be muted (e.g. using `MediaRecorder`
|
||||
to record `WebFrameMain` with this flag set to `true` will allow audio to pass through to the speakers
|
||||
while recording). Default is `false`.
|
||||
* `opts` Object (optional) _macOS_ _Experimental_
|
||||
* `useSystemPicker` Boolean - true if the available native system picker should be used. Default is `false`. _macOS_ _Experimental_
|
||||
|
||||
This handler will be called when web content requests access to display media
|
||||
via the `navigator.mediaDevices.getDisplayMedia` API. Use the
|
||||
[desktopCapturer](latest/api/desktop-capturer.md) API to choose which stream(s) to grant
|
||||
access to.
|
||||
|
||||
`useSystemPicker` allows an application to use the system picker instead of providing a specific video source from `getSources`.
|
||||
This option is experimental, and currently available for MacOS 15+ only. If the system picker is available and `useSystemPicker`
|
||||
is set to `true`, the handler will not be invoked.
|
||||
|
||||
```js
|
||||
const { session, desktopCapturer } = require('electron')
|
||||
|
||||
|
@ -1001,7 +1007,11 @@ session.defaultSession.setDisplayMediaRequestHandler((request, callback) => {
|
|||
// Grant access to the first screen found.
|
||||
callback({ video: sources[0] })
|
||||
})
|
||||
})
|
||||
// Use the system picker if available.
|
||||
// Note: this is currently experimental. If the system picker
|
||||
// is available, it will be used and the media request handler
|
||||
// will not be invoked.
|
||||
}, { useSystemPicker: true })
|
||||
```
|
||||
|
||||
Passing a [WebFrameMain](latest/api/web-frame-main.md) object as a video or audio stream
|
||||
|
|
ΠΠ°Π³ΡΡΠ·ΠΊΠ°β¦
Π‘ΡΡΠ»ΠΊΠ° Π² Π½ΠΎΠ²ΠΎΠΉ Π·Π°Π΄Π°ΡΠ΅