Dart Documentationchrome.mediaGalleriesChromeMediaGalleries

ChromeMediaGalleries class

class ChromeMediaGalleries extends ChromeApi {
 static final JsObject _mediaGalleries = chrome['mediaGalleries'];

 ChromeMediaGalleries._();

 bool get available => _mediaGalleries != null;

 /**
  * Get the media galleries configured in this user agent. If none are
  * configured or available, the callback will receive an empty array.
  */
 Future<List<FileSystem>> getMediaFileSystems([MediaFileSystemsDetails details]) {
   if (_mediaGalleries == null) _throwNotAvailable();

   var completer = new ChromeCompleter<List<FileSystem>>.oneArg((e) => listify(e, _createDOMFileSystem));
   _mediaGalleries.callMethod('getMediaFileSystems', [jsify(details), completer.callback]);
   return completer.future;
 }

 /**
  * Get metadata about a specific media file system.
  */
 MediaFileSystemMetadata getMediaFileSystemMetadata(FileSystem mediaFileSystem) {
   if (_mediaGalleries == null) _throwNotAvailable();

   return _createMediaFileSystemMetadata(_mediaGalleries.callMethod('getMediaFileSystemMetadata', [jsify(mediaFileSystem)]));
 }

 void _throwNotAvailable() {
   throw new UnsupportedError("'chrome.mediaGalleries' is not available");
 }
}

Extends

ChromeApi > ChromeMediaGalleries

Properties

final bool available #

Returns true if the API is available. The common causes of an API not being avilable are:

  • a permission is missing in the application's manifest.json file
  • the API is defined on a newer version of Chrome then the current runtime
docs inherited from ChromeApi
bool get available => _mediaGalleries != null;

Methods

MediaFileSystemMetadata getMediaFileSystemMetadata(FileSystem mediaFileSystem) #

Get metadata about a specific media file system.

MediaFileSystemMetadata getMediaFileSystemMetadata(FileSystem mediaFileSystem) {
 if (_mediaGalleries == null) _throwNotAvailable();

 return _createMediaFileSystemMetadata(_mediaGalleries.callMethod('getMediaFileSystemMetadata', [jsify(mediaFileSystem)]));
}

Future<List<FileSystem>> getMediaFileSystems([MediaFileSystemsDetails details]) #

Get the media galleries configured in this user agent. If none are configured or available, the callback will receive an empty array.

Future<List<FileSystem>> getMediaFileSystems([MediaFileSystemsDetails details]) {
 if (_mediaGalleries == null) _throwNotAvailable();

 var completer = new ChromeCompleter<List<FileSystem>>.oneArg((e) => listify(e, _createDOMFileSystem));
 _mediaGalleries.callMethod('getMediaFileSystems', [jsify(details), completer.callback]);
 return completer.future;
}