OLD | NEW |
1 <div id="pageData-name" class="pageData">Media Galleries</div> | 1 <div id="pageData-name" class="pageData">Media Galleries</div> |
2 | 2 |
3 <!-- BEGIN AUTHORED CONTENT --> | 3 <!-- BEGIN AUTHORED CONTENT --> |
4 <p> | 4 <p> |
5 The media galleries API allows you to access media files (images, | 5 The media galleries API allows you to access media files (images, |
6 video, audio) from the user's local disks (with the user's consent). | 6 video, audio) from the user's local disks (with the user's consent). |
7 </p> | 7 </p> |
8 | 8 |
9 <p> | 9 <p> |
10 Using the API, you can prompt the user for permission to access the media | 10 Using the API, you can prompt the user for permission to access the media |
11 galleries. The permission dialog will contain common media locations for | 11 galleries. The permission dialog will contain common media locations for |
12 the platform and will allow the user to add additional locations. From those | 12 the platform and will allow the user to add additional locations. From those |
13 locations, only media files will be present in the file system objects. | 13 locations, only media files will be present in the file system objects. |
14 </P> | 14 </P> |
15 | 15 |
16 <h2 id="manifest">Manifest</h2> | 16 <h2 id="manifest">Manifest</h2> |
17 <p>You must declare the type of access to the media gallery you require | 17 <p>The media galleries API has two axes of permissions; the locations that |
18 in your extension's manifest to use the API. Currently only the | 18 can be accessed, and the type of access (read-only, read-write, add-files).</p> |
19 "mediaGalleriesRead" permission is allowed. This permission does not | |
20 currently trigger an install time permission prompt because it requires | |
21 the user to grant permission at runtime.</p> | |
22 | 19 |
23 <p> | 20 <p>On the location axis, specifying no location-type permission means that |
24 You may also specify the "mediaGalleriesAllGalleries" permission to get | 21 no media galleries are accessible until the user grants permission to |
25 access to all auto-detected media galleries on the user's computer. This | 22 specific media galleries at runtime using the media gallery configuration |
| 23 dialog. This dialog can be programmatically triggered. Alternatively, |
| 24 specifying the "mediaGalleriesAllGalleries" permission grants access to all |
| 25 auto-detected media galleries on the user's computer. However, this |
26 permission displays an install time prompt indicating that the extension | 26 permission displays an install time prompt indicating that the extension |
27 will have access to all of the user's media files. | 27 will have access to all of the user's media files.</p> |
28 </p> | 28 |
| 29 <p>On the access type axis, the "mediaGalleriesRead" permission grants the |
| 30 extension the right to read files. This permission does not trigger an install |
| 31 time permission prompt because the user must still grant access to particular |
| 32 galleries, either with the "mediaGalleriesAllGalleries" permission or at |
| 33 runtime by using the media gallery management dialog. For example:</p> |
| 34 |
| 35 <pre>{ |
| 36 "name": "My extension", |
| 37 ... |
| 38 "permissions": [ |
| 39 <b>"mediaGalleriesAllGalleries"</b> |
| 40 <b>"mediaGalleriesRead"</b> |
| 41 ], |
| 42 ... |
| 43 }</pre> |
| 44 |
| 45 <p>This set of permissions will trigger an install time permission prompt |
| 46 and let the extension read from all auto-detected media galleries on the |
| 47 user's computer. The user may add or remove galleries using the |
| 48 media gallery management dialog, after which the extension will be able |
| 49 to read all the media files from galleries that the user has selected.</p> |
| 50 |
| 51 <p>Currently "mediaGalleriesRead" is the only access type supported by |
| 52 this API. Read-write and add-file access with be implemented soon.</p> |
29 | 53 |
30 <!-- END AUTHORED CONTENT --> | 54 <!-- END AUTHORED CONTENT --> |
OLD | NEW |