From eab0bf44b26a6c5368fb4f882679d3607f92ec0e Mon Sep 17 00:00:00 2001 From: Alex Muramoto Date: Sun, 21 Aug 2016 07:42:11 -0700 Subject: [PATCH] refractor(media): change MediaError to interface, and error codes to static members (#463) --- src/plugins/media.ts | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/plugins/media.ts b/src/plugins/media.ts index 78e01ce47..b9d91a14b 100644 --- a/src/plugins/media.ts +++ b/src/plugins/media.ts @@ -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; @@ -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; -} +} \ No newline at end of file