Skip to content

Commit

Permalink
fix(media): nest the constructor logic
Browse files Browse the repository at this point in the history
  • Loading branch information
ihadeed committed Sep 7, 2016
1 parent d03d70f commit a566240
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/plugins/media.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,11 @@ export class MediaPlugin {
* @param src {string} A URI containing the audio content.
*/
constructor(src: string) {
let res, rej, next;
this.init = new Promise<any>((resolve, reject) => { res = resolve; rej = reject; });
this.status = new Observable((observer) => {
next = data => observer.next(data);
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, res, rej, next);
}

/**
Expand Down

0 comments on commit a566240

Please sign in to comment.