fix(media): add status as a parmeter instead of property of instance

This commit is contained in:
Ibby 2016-10-01 15:05:08 -04:00
parent 66e9e46458
commit 58a99a14d5

View File

@ -118,19 +118,17 @@ export class MediaPlugin {
// Properties // Properties
private _objectInstance: any; private _objectInstance: any;
status: Observable<any>;
init: Promise<any>; init: Promise<any>;
// Methods // Methods
/** /**
* Open a media file * Open a media file
* @param src {string} A URI containing the audio content. * @param src {string} A URI containing the audio content.
* @param onStatusUpdate {Function} A callback function to be invoked when the status of the file changes
*/ */
constructor(src: string) { constructor(src: string, onStatusUpdate?: Function) {
this.init = new Promise<any>((resolve, reject) => { this.init = new Promise<any>((resolve, reject) => {
this.status = new Observable((observer) => { this._objectInstance = new Media(src, resolve, reject, onStatusUpdate);
this._objectInstance = new Media(src, resolve, reject, observer.next.bind(observer));
});
}); });
} }