mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-01 02:53:03 +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.
|
* @param src {string} A URI containing the audio content.
|
||||||
*/
|
*/
|
||||||
constructor(src: string) {
|
constructor(src: string) {
|
||||||
let res, rej, next;
|
this.init = new Promise<any>((resolve, reject) => {
|
||||||
this.init = new Promise<any>((resolve, reject) => { res = resolve; rej = reject; });
|
this.status = new Observable((observer) => {
|
||||||
this.status = new Observable((observer) => {
|
this._objectInstance = new Media(src, resolve, reject, observer.next.bind(observer));
|
||||||
next = data => observer.next(data);
|
});
|
||||||
});
|
});
|
||||||
this._objectInstance = new Media(src, res, rej, next);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user