Namespace ax.ext.media
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
Media Extension API.
|
Method Summary
Namespace Detail
ax.ext.media
Media Extension API.
Method Detail
-
<static> ax.ext.media.captureImage(callback, errback, opts)capture an image(take a picture with camera).
var scb = function(file){ console.log(file); deviceapis.filesystem.resolve( function(file){ document.body.innerHTML = ''; }, function(e){ console.log('resolve err:' + e.message); }, file, "r" ); }; var ecb = function(e){ console.log(e.message); }; // for android // var opts = {'crop':true, 'out': 'removable/capturedImage.jpg'}; var opts = {'crop':true, 'out': 'images/capturedImage.jpg'}; ax.ext.media.captureImage(scb, ecb, opts);
- Parameters:
- {function}callback
- {function}errback
- {ax.ext.media.CaptureImageOpts}opts
- Returns:
- AxRequest
-
<static> ax.ext.media.captureScreen(callback, errback, opts)capture the current screen(take a screenshot).
var scb = function(file){ console.log(file); deviceapis.filesystem.resolve( function(file){ document.body.innerHTML = ''; }, function(e){ console.log('resolve err:' + e.message); }, file, "r" ); }; var ecb = function(e){ console.log(e.message); }; // for android // var opts = {'out': 'removable/capturedScreenImage.jpg'}; var opts = {'out': 'images/capturedScreenImage.jpg'}; ax.ext.media.captureScreen(scb, ecb, opts);
- Parameters:
- {function}callback
- {function}errback
- {ax.ext.media.CaptureScreenOpts}opts
- Returns:
- AxRequest
-
<static> ax.ext.media.pickImage(callback, errback, opts)pick an image(choose a picture from gallery).
var scb = function(file){ console.log(file); deviceapis.filesystem.resolve( function(file){ document.body.innerHTML = ''; }, function(e){ console.log('resolve err:' + e.message); }, file, "r" ); }; var ecb = function(e){ console.log(e.message); }; // for android // var opts = {'crop':true, 'out': 'removable/pickedImage.jpg'}; var opts = {'crop':true, 'out': 'images/pickedImage.jpg'}; ax.ext.media.pickImage(scb, ecb, opts);
- Parameters:
- {function}callback
- {function}errback
- {ax.ext.media.PickImageOpts}opts
- target dir & crop option
- Returns:
- AxRequest
