mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-20 01:22:52 +08:00
refractor(media): change MediaError to interface, and error codes to static members (#463)
This commit is contained in:
parent
a94912912e
commit
eab0bf44b2
@ -4,6 +4,11 @@ import { Observable } from 'rxjs/Observable';
|
|||||||
|
|
||||||
declare var Media: any;
|
declare var Media: any;
|
||||||
|
|
||||||
|
export interface MediaError {
|
||||||
|
code: number;
|
||||||
|
message: string;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name MediaPlugin
|
* @name MediaPlugin
|
||||||
* @description
|
* @description
|
||||||
@ -78,6 +83,12 @@ export class MediaPlugin {
|
|||||||
static MEDIA_PAUSED: number = 3;
|
static MEDIA_PAUSED: number = 3;
|
||||||
static MEDIA_STOPPED: number = 4;
|
static MEDIA_STOPPED: number = 4;
|
||||||
|
|
||||||
|
//error codes
|
||||||
|
static MEDIA_ERR_ABORTED: number = 1;
|
||||||
|
static MEDIA_ERR_NETWORK: number = 2;
|
||||||
|
static MEDIA_ERR_DECODE: number = 3;
|
||||||
|
static MEDIA_ERR_NONE_SUPPORTED: number = 4;
|
||||||
|
|
||||||
// Properties
|
// Properties
|
||||||
private _objectInstance: any;
|
private _objectInstance: any;
|
||||||
status: Observable<any>;
|
status: Observable<any>;
|
||||||
@ -188,13 +199,4 @@ export class MediaPlugin {
|
|||||||
})
|
})
|
||||||
stop(): void { }
|
stop(): void { }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export class MediaError {
|
|
||||||
static get MEDIA_ERR_ABORTED() { return 1; }
|
|
||||||
static get MEDIA_ERR_NETWORK() { return 2; }
|
|
||||||
static get MEDIA_ERR_DECODE() { return 3; }
|
|
||||||
static get MEDIA_ERR_NONE_SUPPORTED() { return 4; }
|
|
||||||
code: number;
|
|
||||||
message: string;
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user