Skip to content

Commit

Permalink
fix(media): add status as a parmeter instead of property of instance
Browse files Browse the repository at this point in the history
  • Loading branch information
ihadeed committed Oct 1, 2016
1 parent 66e9e46 commit 58a99a1
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/plugins/media.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,19 +118,17 @@ export class MediaPlugin {

// Properties
private _objectInstance: any;
status: Observable<any>;
init: Promise<any>;

// Methods
/**
* Open a media file
* @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.status = new Observable((observer) => {
this._objectInstance = new Media(src, resolve, reject, observer.next.bind(observer));
});
this._objectInstance = new Media(src, resolve, reject, onStatusUpdate);
});
}

Expand Down

0 comments on commit 58a99a1

Please sign in to comment.