Fix some typos.
This commit is contained in:
parent
dcb457e76e
commit
214f8477b3
3 changed files with 7 additions and 7 deletions
|
@ -22,14 +22,14 @@ desktopCapturer.emit = (event_name, event, sources) ->
|
||||||
# Receiving sources result from main process, now send them back to renderer.
|
# Receiving sources result from main process, now send them back to renderer.
|
||||||
handledRequest = requestsQueue.shift 0
|
handledRequest = requestsQueue.shift 0
|
||||||
result = ({ id: source.id, name: source.name, thumbnail: source.thumbnail.toDataUrl() } for source in sources)
|
result = ({ id: source.id, name: source.name, thumbnail: source.thumbnail.toDataUrl() } for source in sources)
|
||||||
handledRequest.webContents?.send 'ATOM_REDNERER_DESKTOP_CAPTURER_RESULT', result
|
handledRequest.webContents?.send 'ATOM_RENDERER_DESKTOP_CAPTURER_RESULT', result
|
||||||
|
|
||||||
# Check the queue to see whether there is other same request. If has, handle
|
# Check the queue to see whether there is other same request. If has, handle
|
||||||
# it for reducing redunplicated `desktopCaptuer.startHandling` calls.
|
# it for reducing redunplicated `desktopCaptuer.startHandling` calls.
|
||||||
unhandledRequestsQueue = []
|
unhandledRequestsQueue = []
|
||||||
for request in requestsQueue
|
for request in requestsQueue
|
||||||
if isOptionsEqual handledRequest.options, request.options
|
if isOptionsEqual handledRequest.options, request.options
|
||||||
request.webContents?.send 'ATOM_REDNERER_DESKTOP_CAPTURER_RESULT', result
|
request.webContents?.send 'ATOM_RENDERER_DESKTOP_CAPTURER_RESULT', result
|
||||||
else
|
else
|
||||||
unhandledRequestsQueue.push request
|
unhandledRequestsQueue.push request
|
||||||
requestsQueue = unhandledRequestsQueue
|
requestsQueue = unhandledRequestsQueue
|
||||||
|
|
|
@ -3,7 +3,7 @@ NativeImage = require 'native-image'
|
||||||
|
|
||||||
getSources = (options, callback) ->
|
getSources = (options, callback) ->
|
||||||
ipc.send 'ATOM_BROWSER_DESKTOP_CAPTURER_GET_SOURCES', options
|
ipc.send 'ATOM_BROWSER_DESKTOP_CAPTURER_GET_SOURCES', options
|
||||||
ipc.once 'ATOM_REDNERER_DESKTOP_CAPTURER_RESULT', (sources) ->
|
ipc.once 'ATOM_RENDERER_DESKTOP_CAPTURER_RESULT', (sources) ->
|
||||||
callback ({id: source.id, name: source.name, thumbnail: NativeImage.createFromDataUrl source.thumbnail} for source in sources)
|
callback ({id: source.id, name: source.name, thumbnail: NativeImage.createFromDataUrl source.thumbnail} for source in sources)
|
||||||
|
|
||||||
module.exports =
|
module.exports =
|
||||||
|
|
|
@ -47,8 +47,8 @@ The `desktopCapturer` module has the following methods:
|
||||||
* `types` Array - An array of String that enums the types of desktop sources.
|
* `types` Array - An array of String that enums the types of desktop sources.
|
||||||
* `screen` String - Screen
|
* `screen` String - Screen
|
||||||
* `window` String - Individual window
|
* `window` String - Individual window
|
||||||
* `thumnailSize` Object (optional) - The suggested size that thumbnail should be
|
* `thumbnailSize` Object (optional) - The suggested size that thumbnail should
|
||||||
scaled.
|
be scaled.
|
||||||
* `width` Integer - The width of thumbnail. By default, it is 150px.
|
* `width` Integer - The width of thumbnail. By default, it is 150px.
|
||||||
* `height` Integer - The height of thumbnail. By default, it is 150px.
|
* `height` Integer - The height of thumbnail. By default, it is 150px.
|
||||||
|
|
||||||
|
@ -59,8 +59,8 @@ The `desktopCapturer` module has the following methods:
|
||||||
Gets all desktop sources.
|
Gets all desktop sources.
|
||||||
|
|
||||||
**Note:** There is no garuantee that the size of `source.thumbnail` is always
|
**Note:** There is no garuantee that the size of `source.thumbnail` is always
|
||||||
the same as the `thumnailSize` in `options`. It also depends on the scale of the
|
the same as the `thumnbailSize` in `options`. It also depends on the scale of
|
||||||
screen or window.
|
the screen or window.
|
||||||
|
|
||||||
## Source
|
## Source
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue