• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2013 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5[
6  {
7    "namespace": "desktopCapture",
8    "description": "Desktop Capture API that can be used to capture content of screen, individual windows or tabs.",
9    "types": [
10      {
11        "id": "DesktopCaptureSourceType",
12        "type": "string",
13        "enum": ["screen", "window", "tab"],
14        "description": "Enum used to define set of desktop media sources used in chooseDesktopMedia()."
15      }
16    ],
17    "functions": [
18      {
19        "name": "chooseDesktopMedia",
20        "type": "function",
21        "description": "Shows desktop media picker UI with the specified set of sources.",
22        "parameters": [
23          {
24            "type": "array",
25            "items": { "$ref": "DesktopCaptureSourceType" },
26            "name": "sources",
27            "description": "Set of sources that should be shown to the user."
28          },
29          {
30            "$ref": "tabs.Tab",
31            "name": "targetTab",
32            "optional": true,
33            "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."
34          },
35          {
36            "type": "function",
37            "name": "callback",
38            "parameters": [
39              {
40                "name": "streamId",
41                "type": "string",
42                "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>"
43              }
44            ]
45          }
46        ],
47        "returns": {
48          "type": "integer",
49          "description": "An id that can be passed to cancelChooseDesktopMedia() in case the prompt need to be canceled."
50        }
51      },
52      {
53        "name": "cancelChooseDesktopMedia",
54        "type": "function",
55        "description": "Hides desktop media picker dialog shown by chooseDesktopMedia().",
56        "parameters": [
57          {
58            "name": "desktopMediaRequestId",
59            "type": "integer",
60            "description": "Id returned by chooseDesktopMedia()"
61          }
62        ]
63      }
64    ]
65  }
66]
67