mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-19 16:52:53 +08:00
fix(media): nest the constructor logic
This commit is contained in:
parent
d03d70ff0b
commit
a566240266
@ -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.init = new Promise<any>((resolve, reject) => {
|
||||
this.status = new Observable((observer) => {
|
||||
next = data => observer.next(data);
|
||||
this._objectInstance = new Media(src, resolve, reject, observer.next.bind(observer));
|
||||
});
|
||||
});
|
||||
this._objectInstance = new Media(src, res, rej, next);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user