doc(media): improve docs

This commit is contained in:
mhartington 2016-09-06 15:48:53 -04:00
parent 2dc68a4785
commit d5513db9bb

View File

@ -77,16 +77,43 @@ export interface MediaError {
export class MediaPlugin { export class MediaPlugin {
// Constants // Constants
/**
* @private
*/
static MEDIA_NONE: number = 0; static MEDIA_NONE: number = 0;
/**
* @private
*/
static MEDIA_STARTING: number = 1; static MEDIA_STARTING: number = 1;
/**
* @private
*/
static MEDIA_RUNNING: number = 2; static MEDIA_RUNNING: number = 2;
/**
* @private
*/
static MEDIA_PAUSED: number = 3; static MEDIA_PAUSED: number = 3;
/**
* @private
*/
static MEDIA_STOPPED: number = 4; static MEDIA_STOPPED: number = 4;
// error codes // error codes
/**
* @private
*/
static MEDIA_ERR_ABORTED: number = 1; static MEDIA_ERR_ABORTED: number = 1;
/**
* @private
*/
static MEDIA_ERR_NETWORK: number = 2; static MEDIA_ERR_NETWORK: number = 2;
/**
* @private
*/
static MEDIA_ERR_DECODE: number = 3; static MEDIA_ERR_DECODE: number = 3;
/**
* @private
*/
static MEDIA_ERR_NONE_SUPPORTED: number = 4; static MEDIA_ERR_NONE_SUPPORTED: number = 4;
// Properties // Properties
@ -109,19 +136,22 @@ export class MediaPlugin {
} }
/** /**
* Returns the current amplitude of the current recording. * Get the current amplitude of the current recording.
* @returns {Promise} Returns a promise with the amplitude of the current recording
*/ */
@CordovaInstance() @CordovaInstance()
getCurrentAmplitude(): Promise<any> { return; } getCurrentAmplitude(): Promise<any> { return; }
/** /**
* Returns the current position within an audio file. Also updates the Media object's position parameter. * Get the current position within an audio file. Also updates the Media object's position parameter.
* @returns {Promise} Returns a promise with the position of the current recording
*/ */
@CordovaInstance() @CordovaInstance()
getCurrentPosition(): Promise<any> { return; } getCurrentPosition(): Promise<any> { return; }
/** /**
* Returns the duration of an audio file in seconds. If the duration is unknown, it returns a value of -1. * Get the duration of an audio file in seconds. If the duration is unknown, it returns a value of -1.
* @returns {Promise} Returns a promise with the duration of the current recording
*/ */
@CordovaInstance({ @CordovaInstance({
sync: true sync: true
@ -157,7 +187,7 @@ export class MediaPlugin {
/** /**
* Sets the current position within an audio file. * Sets the current position within an audio file.
* @param milliseconds * @param {number} milliseconds The time position you want to set for the current audio file
*/ */
@CordovaInstance({ @CordovaInstance({
sync: true sync: true