Fix some typos.

This commit is contained in:
Haojian Wu 2015-10-17 19:28:14 +08:00
parent dcb457e76e
commit 214f8477b3
3 changed files with 7 additions and 7 deletions

View file

@ -22,14 +22,14 @@ desktopCapturer.emit = (event_name, event, sources) ->
# Receiving sources result from main process, now send them back to renderer.
handledRequest = requestsQueue.shift 0
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
# it for reducing redunplicated `desktopCaptuer.startHandling` calls.
unhandledRequestsQueue = []
for request in requestsQueue
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
unhandledRequestsQueue.push request
requestsQueue = unhandledRequestsQueue

View file

@ -3,7 +3,7 @@ NativeImage = require 'native-image'
getSources = (options, callback) ->
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)
module.exports =

View file

@ -47,8 +47,8 @@ The `desktopCapturer` module has the following methods:
* `types` Array - An array of String that enums the types of desktop sources.
* `screen` String - Screen
* `window` String - Individual window
* `thumnailSize` Object (optional) - The suggested size that thumbnail should be
scaled.
* `thumbnailSize` Object (optional) - The suggested size that thumbnail should
be scaled.
* `width` Integer - The width 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.
**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
screen or window.
the same as the `thumnbailSize` in `options`. It also depends on the scale of
the screen or window.
## Source