// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Use the <code>chrome.mediaGalleries</code> API to access media files (images,
-// video, audio) from the user's local disks (with the user's consent).
+// Use the <code>chrome.mediaGalleries</code> API to access media files (audio,
+// images, video) from the user's local disks (with the user's consent).
namespace mediaGalleries {
[inline_doc] enum GetMediaFileSystemsInteractivity {
cancel,
// The scan finished but none of the result have been added,
// addScanResults() has to be called to ask the user for permission.
- finish
+ finish,
+ // The scan encountered an error and could not proceed.
+ error
};
[inline_doc] dictionary MediaFileSystemsDetails {
};
callback MediaFileSystemsCallback =
- void ([instanceOf=DOMFileSystem] optional object[] mediaFileSystems);
+ void ([instanceOf=DOMFileSystem] object[] mediaFileSystems);
callback AddUserFolderCallback =
void ([instanceOf=DOMFileSystem] object[] mediaFileSystems,
DOMString selectedFileSystemName);
+ callback DropPermissionForMediaFileSystemCallback = void ();
+
[inline_doc] dictionary MediaFileSystemMetadata {
// The name of the file system.
DOMString name;
// Appoximate number of media files found; some file types can be either
// audio or video and are included in both counts.
- long? imageCount;
long? audioCount;
+ long? imageCount;
long? videoCount;
};
callback MediaFileSystemsMetadataCallback =
void (MediaFileSystemMetadata[] metadata);
+ dictionary StreamInfo {
+ // Describes format of container or codec of stream, i.e. "mp3", "h264".
+ DOMString type;
+
+ // An unfiltered string->string dictionary of tags for the stream.
+ object tags;
+ };
+
dictionary MediaMetadata {
// The browser sniffed mime type.
DOMString mimeType;
-
+
// Defined for images and video. In pixels.
long? height;
long? width;
-
+
+ // Defined for images only.
+ double? xResolution;
+ double? yResolution;
+
// Defined for audio and video. In seconds.
double? duration;
- // Generic metadata tags.
+ // Defined for images and video. In degrees.
+ long? rotation;
+
+ // Defined for images only.
+ DOMString? cameraMake;
+ DOMString? cameraModel;
+ double? exposureTimeSeconds;
+ boolean? flashFired;
+ double? fNumber;
+ double? focalLengthMm;
+ double? isoEquivalent;
+
+ // Defined for audio and video only.
DOMString? album;
DOMString? artist;
DOMString? comment;
DOMString? language;
DOMString? title;
long? track;
+
+ // All the metadata in the media file. For formats with multiple streams,
+ // stream order will be preserved. Container metadata is the first element.
+ StreamInfo[] rawTags;
};
callback MediaMetadataCallback = void (MediaMetadata metadata);
// gesture, the callback will run as though the user canceled.
static void addUserSelectedFolder(AddUserFolderCallback callback);
+ // Give up access to a given media gallery.
+ static void dropPermissionForMediaFileSystem(
+ DOMString galleryId,
+ optional DropPermissionForMediaFileSystemCallback callback);
+
// Start a scan of the user's hard disks for directories containing media.
// The scan may take a long time so progress and completion is communicated
// by events. No permission is granted as a result of the scan, see
// Show the user the scan results and let them add any or all of them as
// galleries. This should be used after the 'finish' onScanProgress()
- // event has happened. A galleries the app has access to are returned, not
+ // event has happened. All galleries the app has access to are returned, not
// just the newly added galleries.
static void addScanResults(MediaFileSystemsCallback callback);