refactor(media):

This commit is contained in:
Ibby Hadeed 2017-05-17 07:34:54 -04:00
parent ee4b61e405
commit 4333bc950d

View File

@ -29,17 +29,13 @@ export class MediaObject {
* Get 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 {number} Returns a promise with the duration of the current recording * @returns {number} Returns a promise with the duration of the current recording
*/ */
@CordovaInstance({ @CordovaInstance({ sync: true })
sync: true
})
getDuration(): number { return; } getDuration(): number { return; }
/** /**
* Starts or resumes playing an audio file. * Starts or resumes playing an audio file.
*/ */
@CordovaInstance({ @CordovaInstance({ sync: true })
sync: true
})
play(iosOptions?: { play(iosOptions?: {
numberOfLoops?: number, numberOfLoops?: number,
playAudioWhenScreenIsLocked?: boolean playAudioWhenScreenIsLocked?: boolean
@ -48,75 +44,57 @@ export class MediaObject {
/** /**
* Pauses playing an audio file. * Pauses playing an audio file.
*/ */
@CordovaInstance({ @CordovaInstance({ sync: true })
sync: true
})
pause(): void { } pause(): void { }
/** /**
* Releases the underlying operating system's audio resources. This is particularly important for Android, since there are a finite amount of OpenCore instances for media playback. Applications should call the release function for any Media resource that is no longer needed. * Releases the underlying operating system's audio resources. This is particularly important for Android, since there are a finite amount of OpenCore instances for media playback. Applications should call the release function for any Media resource that is no longer needed.
*/ */
@CordovaInstance({ @CordovaInstance({ sync: true })
sync: true
})
release(): void { } release(): void { }
/** /**
* Sets the current position within an audio file. * Sets the current position within an audio file.
* @param {number} milliseconds The time position you want to set for the current audio file * @param {number} milliseconds The time position you want to set for the current audio file
*/ */
@CordovaInstance({ @CordovaInstance({ sync: true })
sync: true
})
seekTo(milliseconds: number): void { } seekTo(milliseconds: number): void { }
/** /**
* Set the volume for an audio file. * Set the volume for an audio file.
* @param volume {number} The volume to set for playback. The value must be within the range of 0.0 to 1.0. * @param volume {number} The volume to set for playback. The value must be within the range of 0.0 to 1.0.
*/ */
@CordovaInstance({ @CordovaInstance({ sync: true })
sync: true
})
setVolume(volume: number): void { } setVolume(volume: number): void { }
/** /**
* Starts recording an audio file. * Starts recording an audio file.
*/ */
@CordovaInstance({ @CordovaInstance({ sync: true })
sync: true
})
startRecord(): void { } startRecord(): void { }
/** /**
* Stops recording * Stops recording
*/ */
@CordovaInstance({ @CordovaInstance({ sync: true })
sync: true
})
stopRecord(): void { } stopRecord(): void { }
/** /**
* Pauses recording * Pauses recording
*/ */
@CordovaInstance({ @CordovaInstance({ sync: true })
sync: true
})
pauseRecord(): void { } pauseRecord(): void { }
/** /**
* Resumes recording * Resumes recording
*/ */
@CordovaInstance({ @CordovaInstance({ sync: true })
sync: true
})
resumeRecord(): void { } resumeRecord(): void { }
/** /**
* Stops playing an audio file. * Stops playing an audio file.
*/ */
@CordovaInstance({ @CordovaInstance({ sync: true })
sync: true
})
stop(): void { } stop(): void { }
} }