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