mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-01 02:53:03 +08:00
fix(media): add status as a parmeter instead of property of instance
This commit is contained in:
parent
66e9e46458
commit
58a99a14d5
@ -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));
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user