UNPKG

@slashedcloud/player

Version:

A media player application utilizing Shaka Player for adaptive video streaming, capable of playing HLS, MPD and plain HTTP video streams.

73 lines (72 loc) 2.4 kB
var I = Object.defineProperty; var n = (e) => { throw TypeError(e); }; var g = (e, s, r) => s in e ? I(e, s, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[s] = r; var t = (e, s, r) => g(e, typeof s != "symbol" ? s + "" : s, r), l = (e, s, r) => s.has(e) || n("Cannot " + r); var d = (e, s, r) => s.has(e) ? n("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(e) : s.set(e, r); var R = (e, s, r) => (l(e, s, "access private method"), r); /*! * SlashedCloud v0.1.2 (https://github.com/SlashedCloud/player#readme) * Copyright 2024-2024 rogerio.jardim@fedrax.pt * Licensed under Apache (https://github.com/SlashedCloud/player/blob/develop/LICENSE) */ var u = /* @__PURE__ */ ((e) => (e[e.INFO = 0] = "INFO", e[e.WARNING = 1] = "WARNING", e[e.ERROR = 2] = "ERROR", e[e.CRITICAL = 3] = "CRITICAL", e[e.FATAL = 4] = "FATAL", e))(u || {}), h, o; class N extends Error { constructor(r, c, i, a) { super(i); d(this, h); t(this, "name"); t(this, "message"); t(this, "severity"); t(this, "code"); t(this, "description"); t(this, "reason"); this.name = r, this.message = i, this.severity = c, this.code = a == null ? void 0 : a.code, this.description = a == null ? void 0 : a.description, this.reason = a == null ? void 0 : a.reason, R(this, h, o).call(this); } get severityString() { switch (this.severity) { case 3: return "CRITICAL"; case 2: return "ERROR"; case 1: return "WARNING"; case 0: default: return "INFO"; } } toObject() { return { errorName: this.name, errorMessage: this.message, errorSeverity: this.severityString, errorCode: this.code, errorDescription: this.description, errorReason: this.reason }; } } h = new WeakSet(), o = function() { var c, i, a; let r = `${this.severityString}: ${this.name} | ${this.message}`; switch (this.description && (r += ` | ${this.description}`), this.code && (r += ` [${this.code}]`), this.severity) { case 0: console.info(r, (c = this.reason) != null ? c : ""); break; case 1: console.warn(r, (i = this.reason) != null ? i : ""); break; case 2: case 3: case 4: default: console.error(r, (a = this.reason) != null ? a : ""); break; } }; export { N as P, u as S };