mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-20 01:22:52 +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
|
||||
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);
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user