@livepeer/core
Version:
Livepeer UI Kit's core vanilla JS library.
64 lines (62 loc) • 3.19 kB
JavaScript
;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/errors.ts
var errors_exports = {};
__export(errors_exports, {
ACCESS_CONTROL_ERROR_MESSAGE: () => ACCESS_CONTROL_ERROR_MESSAGE,
BFRAMES_ERROR_MESSAGE: () => BFRAMES_ERROR_MESSAGE,
NOT_ACCEPTABLE_ERROR_MESSAGE: () => NOT_ACCEPTABLE_ERROR_MESSAGE,
PERMISSIONS_ERROR_MESSAGE: () => PERMISSIONS_ERROR_MESSAGE,
STREAM_OFFLINE_ERROR_MESSAGE: () => STREAM_OFFLINE_ERROR_MESSAGE,
STREAM_OPEN_ERROR_MESSAGE: () => STREAM_OPEN_ERROR_MESSAGE,
isAccessControlError: () => isAccessControlError,
isBframesError: () => isBframesError,
isNotAcceptableError: () => isNotAcceptableError,
isPermissionsError: () => isPermissionsError,
isStreamOfflineError: () => isStreamOfflineError
});
module.exports = __toCommonJS(errors_exports);
// src/media/errors.ts
var STREAM_OPEN_ERROR_MESSAGE = "stream open failed";
var STREAM_OFFLINE_ERROR_MESSAGE = "stream is offline";
var STREAM_WAITING_FOR_DATA_ERROR_MESSAGE = "stream is waiting for data";
var ACCESS_CONTROL_ERROR_MESSAGE = "shutting down since this session is not allowed to view this stream";
var BFRAMES_ERROR_MESSAGE = "metadata indicates that webrtc playback contains bframes";
var NOT_ACCEPTABLE_ERROR_MESSAGE = "response indicates unacceptable playback protocol";
var PERMISSIONS_ERROR_MESSAGE = "user did not allow the permissions request";
var isStreamOfflineError = (error) => error.message.toLowerCase().includes(STREAM_OPEN_ERROR_MESSAGE) || error.message.toLowerCase().includes(STREAM_WAITING_FOR_DATA_ERROR_MESSAGE) || error.message.toLowerCase().includes(STREAM_OFFLINE_ERROR_MESSAGE);
var isAccessControlError = (error) => error.message.toLowerCase().includes(ACCESS_CONTROL_ERROR_MESSAGE);
var isBframesError = (error) => error.message.toLowerCase().includes(BFRAMES_ERROR_MESSAGE);
var isNotAcceptableError = (error) => error.message.toLowerCase().includes(NOT_ACCEPTABLE_ERROR_MESSAGE);
var isPermissionsError = (error) => error.message.toLowerCase().includes(PERMISSIONS_ERROR_MESSAGE);
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
ACCESS_CONTROL_ERROR_MESSAGE,
BFRAMES_ERROR_MESSAGE,
NOT_ACCEPTABLE_ERROR_MESSAGE,
PERMISSIONS_ERROR_MESSAGE,
STREAM_OFFLINE_ERROR_MESSAGE,
STREAM_OPEN_ERROR_MESSAGE,
isAccessControlError,
isBframesError,
isNotAcceptableError,
isPermissionsError,
isStreamOfflineError
});
//# sourceMappingURL=index.cjs.map