refractor(media): change MediaError to interface, and error codes to static members (#463)

This commit is contained in:
Alex Muramoto 2016-08-21 07:42:11 -07:00 committed by Ibrahim Hadeed
parent a94912912e
commit eab0bf44b2

View File

@ -4,6 +4,11 @@ import { Observable } from 'rxjs/Observable';
declare var Media: any;
export interface MediaError {
code: number;
message: string;
}
/**
* @name MediaPlugin
* @description
@ -78,6 +83,12 @@ export class MediaPlugin {
static MEDIA_PAUSED: number = 3;
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
private _objectInstance: any;
status: Observable<any>;
@ -188,13 +199,4 @@ export class MediaPlugin {
})
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;
}
}