blob: 8359a7bd3b851e14323ad7ceaf96c783580ea827 [file] [log] [blame]
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
[
{
"namespace": "desktopCapture",
"description": "Desktop Capture API that can be used to capture content of screen, individual windows or tabs.",
"types": [
{
"id": "DesktopCaptureSourceType",
"type": "string",
"enum": ["screen", "window", "tab"],
"description": "Enum used to define set of desktop media sources used in chooseDesktopMedia()."
}
],
"functions": [
{
"name": "chooseDesktopMedia",
"type": "function",
"description": "Shows desktop media picker UI with the specified set of sources.",
"parameters": [
{
"type": "array",
"items": { "$ref": "DesktopCaptureSourceType" },
"name": "sources",
"description": "Set of sources that should be shown to the user."
},
{
"$ref": "tabs.Tab",
"name": "targetTab",
"optional": true,
"description": "Optional tab for which the stream is created. If not specified then the resulting stream can be used only by the calling extension, otherwise the stream can be used only by the specified tab. If the tab's security origin changes before this function returns, the call may fail."
},
{
"type": "function",
"name": "callback",
"parameters": [
{
"name": "streamId",
"type": "string",
"description": "An opaque string that can be passed to <code>getUserMedia()</code> API to generate media stream that corresponds to the source selected by the user. If user didn't select any source (i.e. canceled the prompt) then the callback is called with an empty <code>streamId</code>"
}
]
}
],
"returns": {
"type": "integer",
"description": "An id that can be passed to cancelChooseDesktopMedia() in case the prompt need to be canceled."
}
},
{
"name": "cancelChooseDesktopMedia",
"type": "function",
"description": "Hides desktop media picker dialog shown by chooseDesktopMedia().",
"parameters": [
{
"name": "desktopMediaRequestId",
"type": "integer",
"description": "Id returned by chooseDesktopMedia()"
}
]
}
]
}
]